-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WatchGuard - add connector #1166
base: main
Are you sure you want to change the base?
Conversation
Test Results17 tests +7 16 ✅ +6 0s ⏱️ ±0s Results for commit 10447b8. ± Comparison against base commit abca275. This pull request removes 10 and adds 17 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1166 +/- ##
===========================================
+ Coverage 75.53% 88.85% +13.31%
===========================================
Files 26 259 +233
Lines 605 9440 +8835
Branches 0 554 +554
===========================================
+ Hits 457 8388 +7931
- Misses 148 981 +833
- Partials 0 71 +71
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
… lv/watchguard_to_connector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work.
I pushed a suggestion and made some comments
@@ -0,0 +1,103 @@ | |||
import base64 | |||
from datetime import datetime, timedelta | |||
from urllib.parse import urljoin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using from posixpath import join as urljoin
instead (see SEKOIA-IO/sekoia-automation-sdk#139)
INCOMING_MESSAGES.labels(type=event_type_name).inc(len(message_batch)) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you not keep the metrics here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics, without intake_key, are hardly exploitable. And, as this trigger is a trigger (and not connector), we don't have this information.
We did the same for Vade M365
OUTCOMING_EVENTS.labels(type=event_type_name).inc(len(message_batch)) | ||
|
||
# get the ending time and compute the duration to fetch the events | ||
batch_end_time = time.time() | ||
batch_duration = int(batch_end_time - batch_start_time) | ||
FORWARD_EVENTS_DURATION.labels(type=event_type_name).observe(batch_duration) | ||
|
||
# compute the events lag | ||
last_message_timestamp = datetime.strptime(last_message_date, self.RFC3339_STRICT_FORMAT) | ||
events_lag = (datetime.utcnow() - last_message_timestamp).total_seconds() | ||
EVENTS_LAG.labels(type=event_type_name).set(events_lag) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
No description provided.