-
Notifications
You must be signed in to change notification settings - Fork 2
Merging changes for timestamps and API rate limits #40
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
base: main
Are you sure you want to change the base?
Changes from all commits
ec14729
5621cf0
3c8a473
e8c3956
7eb60c9
bd7a4a3
ba58118
73982cc
1a5d68b
7bc9ca8
ec76595
f7959e0
1ebd92e
f871e31
7c5e6df
8729ed4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,4 @@ local.meta | |
| dist/ | ||
| .pytest_cache | ||
| *.ipynb | ||
| genesys_cloud_ta-*.tar.gz | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ | |
| from datetime import datetime, timezone | ||
| from genesyscloud_client import GenesysCloudClient | ||
|
|
||
| # Permissions required : [403] Forbidden - Unable to perform the requested action. You must have at least one of the following permissions assigned: [integrations:action:view, bridge:actions:view] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes this is mentioned in documentation. Would you need the comment here as well? |
||
|
|
||
| ADDON_NAME = "genesys_cloud_ta" | ||
|
|
||
| def logger_for_input(input_name: str) -> logging.Logger: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| from dateutil.relativedelta import relativedelta | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
| from genesyscloud_client import GenesysCloudClient | ||
|
|
||
| # Permissions issues: [403] Forbidden - Unable to perform the requested action. You are missing the following permission(s): [audits:audit:view] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed, as mentioned in documentation... Shall we add these errors in the Troubleshooting section of docs?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me |
||
| ADDON_NAME = "genesys_cloud_ta" | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,26 +69,26 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |
| account_region = get_account_property(session_key, input_item.get("account"), "region") | ||
| client_id = get_account_property(session_key, input_item.get("account"), "client_id") | ||
| client_secret = get_account_property(session_key, input_item.get("account"), "client_secret") | ||
| # Setting a default start date of 7 days ago from now | ||
| now = datetime.now() | ||
| fallback_start = (now - relativedelta(days=7)).strftime("%Y-%m-%dT%H:%M:%SZ") | ||
| start_date = input_item.get("start_date") | ||
| if start_date is not None: | ||
| fallback_start = datetime.strptime(start_date, "%Y-%m-%d").strftime("%Y-%m-%dT%H:%M:%SZ") | ||
|
|
||
| client = GenesysCloudClient( | ||
| logger, client_id, client_secret, account_region | ||
| ) | ||
| checkpointer_key_name = input_name.split("/")[-1] | ||
|
|
||
| # Retrieve the last checkpoint or set it to the fallback start date. | ||
| start_time = ( | ||
| kvstore_checkpointer.get(checkpointer_key_name) | ||
| or fallback_start | ||
| ) | ||
| end_time = now.strftime("%Y-%m-%dT%H:%M:%SZ") | ||
| interval = f"{start_time}/{end_time}" | ||
|
|
||
| # Retrieve the last checkpoint or set it to the fallback start date, then format it | ||
| now = datetime.now() | ||
| start_time = kvstore_checkpointer.get(checkpointer_key_name) | ||
| if start_time is None: | ||
| history = input_item.get("days_history") | ||
| if history is not None: | ||
| start_time = now - relativedelta(days=int(history)) | ||
| else: | ||
| start_time = now - relativedelta(mins=5) | ||
|
Comment on lines
+84
to
+86
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
| else: | ||
| start_time = datetime.fromtimestamp(float(start_time)) | ||
|
|
||
| interval = f'{start_time.strftime("%Y-%m-%dT%H:%M:%SZ")}/{now.strftime("%Y-%m-%dT%H:%M:%SZ")}' | ||
| logger.debug(f"Fetching data for interval: {interval}") | ||
| body = { | ||
| "interval": interval | ||
| } | ||
|
|
@@ -121,8 +121,9 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |
|
|
||
| if event_counter > 0: | ||
| logger.debug(f"Indexed '{event_counter}' events") | ||
| logger.debug(f"Updating checkpointer to {end_time}") | ||
| kvstore_checkpointer.update(checkpointer_key_name, end_time) | ||
| new_checkpoint = now.timestamp() | ||
| logger.debug(f"Updating checkpointer to {new_checkpoint}") | ||
| kvstore_checkpointer.update(checkpointer_key_name, new_checkpoint) | ||
|
|
||
| log.events_ingested( | ||
| logger, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,8 +7,10 @@ | |||||||
| from splunklib import modularinput as smi | ||||||||
|
|
||||||||
| from datetime import datetime, timezone | ||||||||
| from dateutil.relativedelta import relativedelta | ||||||||
|
Comment on lines
9
to
+10
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| from genesyscloud_client import GenesysCloudClient | ||||||||
|
|
||||||||
|
|
||||||||
| ADDON_NAME = "genesys_cloud_ta" | ||||||||
|
|
||||||||
| def logger_for_input(input_name: str) -> logging.Logger: | ||||||||
|
|
@@ -59,9 +61,10 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||
| client = GenesysCloudClient(logger, client_id, client_secret, account_region) | ||||||||
|
|
||||||||
| checkpointer_key_name = normalized_input_name | ||||||||
| # An 2025-10-14: Changed default start date to 5 minutes ago to reduce data volume on first run | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| current_checkpoint = ( | ||||||||
| kvstore_checkpointer.get(checkpointer_key_name) | ||||||||
| or datetime(1970, 1, 1).timestamp() | ||||||||
| or (datetime.now() - timedelta(minutes=5)).timestamp() | ||||||||
| ) | ||||||||
|
|
||||||||
| start_time = datetime.fromtimestamp(current_checkpoint, tz=timezone.utc) | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||||
| from splunklib import modularinput as smi | ||||||||
|
|
||||||||
| from datetime import datetime | ||||||||
| from dateutil.relativedelta import relativedelta | ||||||||
|
Comment on lines
10
to
+11
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See other comments..
Suggested change
|
||||||||
| from genesyscloud_client import GenesysCloudClient | ||||||||
| from genesyscloud_models import EdgeModel | ||||||||
|
|
||||||||
|
|
@@ -73,9 +74,10 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||
|
|
||||||||
| checkpointer_key_name = input_name.split("/")[-1] | ||||||||
| # if we don't have any checkpoint, we default it to 1970 | ||||||||
| # AN 2025-10-14: Changed default start date to 5 minutes ago to reduce data volume on first run | ||||||||
|
Comment on lines
76
to
+77
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| current_checkpoint = ( | ||||||||
| kvstore_checkpointer.get(checkpointer_key_name) | ||||||||
| or datetime(1970, 1, 1).timestamp() | ||||||||
| or (datetime.now() - relativedelta(minutes=5)).timestamp() | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| ) | ||||||||
|
|
||||||||
| e_model = EdgeModel(client.get( | ||||||||
|
|
@@ -104,7 +106,8 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||
| metric = metric_obj.to_dict() | ||||||||
| metric["event_time"] = e_model.to_string(metric_obj.event_time) | ||||||||
| metric["edge"] = e_model.get_edge(metric_obj.edge.id) | ||||||||
| if event_time_epoch > current_checkpoint: | ||||||||
| # always true for now until we determine if we need checkpointing here | ||||||||
| if event_time_epoch > current_checkpoint or 1==1: | ||||||||
| event_writer.write_event( | ||||||||
| smi.Event( | ||||||||
| data=json.dumps(metric, ensure_ascii=False, default=str), | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |||||||
| from splunklib import modularinput as smi | ||||||||
|
|
||||||||
| from datetime import datetime | ||||||||
| from dateutil.relativedelta import relativedelta | ||||||||
|
Comment on lines
10
to
+11
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To keep code consistency and avoid adding another dependency,
Suggested change
|
||||||||
| from genesyscloud_client import GenesysCloudClient | ||||||||
| from genesyscloud_models import PhoneModel | ||||||||
|
|
||||||||
|
|
@@ -72,9 +73,10 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||
|
|
||||||||
| checkpointer_key_name = input_name.split("/")[-1] | ||||||||
| # if we don't have any checkpoint, we default it to 1970 | ||||||||
| # AN 2025-10-14: Changed default start date to 5 minutes ago to reduce data volume on first run | ||||||||
|
Comment on lines
75
to
+76
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| current_checkpoint = ( | ||||||||
| kvstore_checkpointer.get(checkpointer_key_name) | ||||||||
| or datetime(1970, 1, 1).timestamp() | ||||||||
| or (datetime.now() - relativedelta(minutes=5)).timestamp() | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| ) | ||||||||
|
|
||||||||
| p_model = PhoneModel( | ||||||||
|
|
@@ -92,19 +94,38 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||
| sourcetype = "genesyscloud:telephonyprovidersedge:edges:phones" | ||||||||
| event_counter = 0 | ||||||||
| for status_obj in statuses: | ||||||||
| ''' | ||||||||
| This is failing in some situations on the following but for time sake I'm not debugging it further: | ||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please open an issue for this? 🙏 |
||||||||
|
|
||||||||
| File "/home/splunk/genesys_cloud_ta/output/genesys_cloud_ta/bin/edges_phones_helper.py", line 97, in stream_events | ||||||||
| event_time_epoch = p_model.to_datetime(status_obj["event_creation_time"]).timestamp() | ||||||||
| if event_time_epoch > current_checkpoint: | ||||||||
| event_writer.write_event( | ||||||||
| smi.Event( | ||||||||
| data=json.dumps(status_obj, ensure_ascii=False, default=str), | ||||||||
| time=event_time_epoch, | ||||||||
| index=input_item.get("index"), | ||||||||
| sourcetype=sourcetype, | ||||||||
| File "/home/splunk/genesys_cloud_ta/output/genesys_cloud_ta/bin/genesyscloud_models.py", line 29, in to_datetime | ||||||||
| return datetime.datetime.strptime(dt_string, format) | ||||||||
| File "/opt/splunk/lib/python3.9/_strptime.py", line 568, in _strptime_datetime | ||||||||
| tt, fraction, gmtoff_fraction = _strptime(data_string, format) | ||||||||
| File "/opt/splunk/lib/python3.9/_strptime.py", line 349, in _strptime | ||||||||
| raise ValueError("time data %r does not match format %r" % | ||||||||
| ValueError: time data '2025-10-09T02:04:58.285926652Z' does not match format '%Y-%m-%dT%H:%M:%S.%fZ' | ||||||||
| ''' | ||||||||
|
|
||||||||
| # AN removing the checkpointing (ie 1==1) and indexing regardless of time to avoid losing data | ||||||||
| try: | ||||||||
| event_time_epoch = p_model.to_datetime(status_obj["event_creation_time"]).timestamp() | ||||||||
| if event_time_epoch > current_checkpoint or 1==1: | ||||||||
| event_writer.write_event( | ||||||||
| smi.Event( | ||||||||
| data=json.dumps(status_obj, ensure_ascii=False, default=str), | ||||||||
| time=event_time_epoch, | ||||||||
| index=input_item.get("index"), | ||||||||
| sourcetype=sourcetype, | ||||||||
| ) | ||||||||
| ) | ||||||||
| ) | ||||||||
| event_counter += 1 | ||||||||
| event_counter += 1 | ||||||||
| except Exception as e: | ||||||||
| logger.error(f"Error processing status object: {e}. Object data: {status_obj}") | ||||||||
|
|
||||||||
| # Updating checkpoint if data was indexed to avoid losing info | ||||||||
| # this could introduce loss if events are written during processing, only msec delays but still possible | ||||||||
| if event_counter > 0: | ||||||||
| logger.debug(f"Indexed '{event_counter}' events") | ||||||||
| new_checkpoint = datetime.utcnow().timestamp() | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,9 +8,11 @@ | |||||||||||||||||
| from splunklib import modularinput as smi | ||||||||||||||||||
|
|
||||||||||||||||||
| from datetime import datetime | ||||||||||||||||||
| from dateutil.relativedelta import relativedelta | ||||||||||||||||||
|
Comment on lines
10
to
+11
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
|
||||||||||||||||||
| from genesyscloud_client import GenesysCloudClient | ||||||||||||||||||
| from genesyscloud_models import TrunkModel | ||||||||||||||||||
|
|
||||||||||||||||||
| # TODO - validate event time stamps for this TA, seems to be extracting incorrect time using US format mm-dd-yyyy instead of dd-mm-yyyy | ||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tell me more.. 🤔 |
||||||||||||||||||
|
|
||||||||||||||||||
| ADDON_NAME = "genesys_cloud_ta" | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -73,11 +75,13 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||||||||||||
|
|
||||||||||||||||||
| checkpointer_key_name = input_name.split("/")[-1] | ||||||||||||||||||
| # if we don't have any checkpoint, we default it to 1970 | ||||||||||||||||||
| # AN 2025-10-14: Changed default start date to 5 minutes ago to reduce data volume on first run | ||||||||||||||||||
|
Comment on lines
77
to
+78
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||
| current_checkpoint = ( | ||||||||||||||||||
| kvstore_checkpointer.get(checkpointer_key_name) | ||||||||||||||||||
| or datetime(1970, 1, 1).timestamp() | ||||||||||||||||||
| or (datetime.now() - relativedelta(minutes=5)).timestamp() | ||||||||||||||||||
| #or datetime(1970, 1, 1).timestamp() | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
||||||||||||||||||
| logger.info(f"Trunk Current checkpoint is: {current_checkpoint}") | ||||||||||||||||||
|
Comment on lines
+81
to
+84
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using
Suggested change
|
||||||||||||||||||
| t_model = TrunkModel(client.get( | ||||||||||||||||||
| "TelephonyProvidersEdgeApi", "get_telephony_providers_edges_trunks") | ||||||||||||||||||
| ) | ||||||||||||||||||
|
|
@@ -87,7 +91,7 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||||||||||||
| "get_telephony_providers_edges_trunks_metrics", | ||||||||||||||||||
| ','.join(t_model.trunk_ids) | ||||||||||||||||||
| ) | ||||||||||||||||||
| logger.debug(f"Fetched '{len(data)}' trunks metrics") | ||||||||||||||||||
| logger.info(f"Fetched '{len(data)}' trunks metrics") | ||||||||||||||||||
|
|
||||||||||||||||||
| sourcetype = "genesyscloud:telephonyprovidersedge:trunks:metrics" | ||||||||||||||||||
| event_counter = 0 | ||||||||||||||||||
|
|
@@ -96,12 +100,15 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||||||||||||
| metric = metric_obj.to_dict() | ||||||||||||||||||
| metric["event_time"] = t_model.to_string(metric_obj.event_time) | ||||||||||||||||||
| metric["trunk"] = t_model.get_trunk(metric_obj.trunk.id) | ||||||||||||||||||
| if event_time_epoch > current_checkpoint: | ||||||||||||||||||
| logger.info(f"Trunk Metric Event Time: {metric['event_time']} (epoch: {event_time_epoch})") | ||||||||||||||||||
| # 1==1 because testing the event_time against the checkpoint fails is most cases because event_time is unique to the trunk | ||||||||||||||||||
| # but checkpoint is global to the input. So we are indexing all events and relying on Splunk to dedup them if needed | ||||||||||||||||||
| if event_time_epoch > current_checkpoint or 1==1: | ||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's discuss |
||||||||||||||||||
| event_writer.write_event( | ||||||||||||||||||
| smi.Event( | ||||||||||||||||||
| data=json.dumps(metric, ensure_ascii=False, default=str), | ||||||||||||||||||
| index=input_item.get("index"), | ||||||||||||||||||
| sourcetype=sourcetype, | ||||||||||||||||||
| sourcetype=sourcetype | ||||||||||||||||||
| ) | ||||||||||||||||||
| ) | ||||||||||||||||||
| event_counter += 1 | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,6 +86,10 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |
| logger.debug(f"Component updated at timestamp: {component_updated_at}") | ||
|
|
||
| # Only process if newer than our checkpoint | ||
| ''' | ||
| AN 2025-10-09 - this is so rarely the case its not worth indexing duplicates and we create | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's discuss! |
||
| a few knowledge objects with CSVs/data models etc in splunk to track status history. | ||
| ''' | ||
| if component_updated_at > status_page_checkpoint: | ||
|
|
||
| component["page"] = page | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,19 @@ | |||||||||||||||||||||||
| from genesyscloud_client import GenesysCloudClient | ||||||||||||||||||||||||
| from genesyscloud_models import UserModel | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ''' | ||||||||||||||||||||||||
| ****************** | ||||||||||||||||||||||||
| WARNING: Dangerous Input | ||||||||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shall we maybe address this in other places as well? E.g. documentation, banner as soon as you try to create such an input? |
||||||||||||||||||||||||
| ****************** | ||||||||||||||||||||||||
| This input will breach the fair usage limits if you have a lot of users | ||||||||||||||||||||||||
| There is 1 API call for every user plus some overhead for pagination, 1 call per 25 users to build the initial list | ||||||||||||||||||||||||
| The fair usage limit is system wide for the customner and if Splunk breaches it business critical systems may be affected. | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Consider limiting this input to a few users using the filter option in the input configuration | ||||||||||||||||||||||||
| call it infrequently, use A3S if available | ||||||||||||||||||||||||
| or event bridge instead if you need near real time data. | ||||||||||||||||||||||||
| ''' | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ADDON_NAME = "genesys_cloud_ta" | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -63,9 +76,11 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||||||||||||||||||
| checkpointer_key_name = input_name.split("/")[-1] | ||||||||||||||||||||||||
| now = datetime.now() | ||||||||||||||||||||||||
| # No checkpoint? Default it to four years ago per API docs | ||||||||||||||||||||||||
| # AN 2025-10-14: Changed default start date to 5 minutes ago to reduce data volume on first run | ||||||||||||||||||||||||
| last_checkpoint = ( | ||||||||||||||||||||||||
| kvstore_checkpointer.get(checkpointer_key_name) | ||||||||||||||||||||||||
| or (now - relativedelta(years=4)).strftime("%Y-%m-%dT%H:%M:%SZ") | ||||||||||||||||||||||||
| or (datetime.now() - relativedelta(minutes=5)).timestamp() | ||||||||||||||||||||||||
| #(now - relativedelta(years=4)).strftime("%Y-%m-%dT%H:%M:%SZ") | ||||||||||||||||||||||||
|
Comment on lines
78
to
+83
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleaned up comment and used
Suggested change
|
||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
| new_checkpoint = now.strftime("%Y-%m-%dT%H:%M:%SZ") | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
|
@@ -77,7 +92,7 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # Getting metrics | ||||||||||||||||||||||||
| interval = f"{last_checkpoint}/{new_checkpoint}" | ||||||||||||||||||||||||
| logger.debug(f"Range interval: {interval}") | ||||||||||||||||||||||||
| logger.info(f"Range interval: {interval}") | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # Max 100 userids supported according to specs (??) | ||||||||||||||||||||||||
| results = [] | ||||||||||||||||||||||||
|
|
@@ -154,4 +169,4 @@ def stream_events(inputs: smi.InputDefinition, event_writer: smi.EventWriter): | |||||||||||||||||||||||
| e, | ||||||||||||||||||||||||
| "IngestionError", | ||||||||||||||||||||||||
| msg_before=f"Exception raised while ingesting data for input: {normalized_input_name}" | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||
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.
Please do not change version. This will be changed only at release time. If you do, please keep it local.