Skip to content

Merging changes for timestamps and API rate limits#40

Open
am-napier wants to merge 16 commits into
splunk:mainfrom
am-napier:main
Open

Merging changes for timestamps and API rate limits#40
am-napier wants to merge 16 commits into
splunk:mainfrom
am-napier:main

Conversation

@am-napier
Copy link
Copy Markdown

I've updated a few things on most inputs to ensure good defaults are used when an input first runs and the input doesn't over use the API and cause accounts to be rate limited. In my case the splunk user was consuming so much of the API it was at risk of stopping the business users from access API as genesys cloud rate limits this at the account not user level. In general all inputs have been changed to make the default starting run collect just the last 5 mins of data. Some where collecting 4 years, some were using epoch 0 for 1970. I changed conversation details from start_date to days_history as it makes a more intuitive experience.
I've added some logging to record every API action (posts and gets) to help monitor call volumes.
I've added collections to enable SPL to view and manage the checkpoint collections ie | outputlookup genesys_cloud_conversation_details_chkpt will truncate the collection enabling it to restart as if it were fresh. Use with caution during setup and development.
I've added some saved search to build status lookups to make the consumption of the status page data more efficient. The searches are not enabled by default. Note to use this efficiently the status input should write to a different index low volume long term index, not the same as the other inputs as its extracting timestamps correctly.
Added explicit sourcetypes for all inputs.

Added macros (genesys_index and genesys_status_index) for genesys cloud indexes.  Indexes need to be added elsewhere
Added all sourcetypes for all inputs

Savedsearches.conf
Created 2 savedsearches to populate lookups for genesys status API data

Transforms.conf
Added transforms to 1. create lookups for input check points and 2. support status API lookups
Added automatic lookup (LOOKUP-Genesys API Status) for new field called function (aka name) to status API data

Lookups
Added empty CSV files for lookups
…id API rate limiting on initial loads.

Added debug/info logging to track API call rates plus other useful info.
updated "Genesys Cloud Status Name Lookup"
added _time to Genesys Cloud Status Lookup
globalConfig.json for new version
Copy link
Copy Markdown
Collaborator

@edro15 edro15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @am-napier! I added some comments, requested a couple of changes and clarifications. Looking forward to discussing this later. Thanks for your input and efforts so far! ❤️

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]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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?

from dateutil.relativedelta import relativedelta
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]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

Comment thread globalConfig.json Outdated
Comment thread package/app.manifest
"group": null,
"name": "genesys_cloud_ta",
"version": "0.3.0"
"version": "0.0.33"
Copy link
Copy Markdown
Collaborator

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.

Suggested change
"version": "0.0.33"
"version": "0.3.0"

Comment thread package/bin/user_aggregates_helper.py Outdated
Comment on lines +14 to +17
import sys, os
sys.path.append(os.path.join(os.environ['SPLUNK_HOME'],'etc','apps','SA-VSCode','bin'))
import splunk_debug as dbg
dbg.enable_debugging(timeout=25)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this part. It's linked to local resources that won't be found elsewhere and it's a reason for tests to fail.

Suggested change
import sys, os
sys.path.append(os.path.join(os.environ['SPLUNK_HOME'],'etc','apps','SA-VSCode','bin'))
import splunk_debug as dbg
dbg.enable_debugging(timeout=25)

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# An 2025-10-14: Changed default start date to 5 minutes ago to reduce data volume on first run
# if we don't have any checkpoint, we default it to 5 minutes ago to reduce data volume on first run

Comment thread package/bin/conversations_metrics_helper.py Outdated
Comment on lines +84 to +86
start_time = now - relativedelta(days=int(history))
else:
start_time = now - relativedelta(mins=5)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use timedelta instead of relativedelta as for the other inputs. Adjust imported libraries accordingly.

@@ -11,6 +11,7 @@
from dateutil.relativedelta import relativedelta
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use timedelta instead of relativedelta to keep code consistency and reduce dependencies. See other comments.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will ask for some clarifications here..

am-napier and others added 3 commits December 12, 2025 14:20
Co-authored-by: Erica Pescio <epescio@splunk.com>
Co-authored-by: Erica Pescio <epescio@splunk.com>
removed splunk_dbg code from imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants