Global settings¶
In the following examples, client is an AgentManagementClient created as described in The main AgentManagementClient class. Reading or updating global settings requires instance administration rights.
Reading and updating settings¶
Retrieve the settings, modify their raw dictionary, and save the changes.
settings = client.get_settings()
print(settings.get_raw()["timezone"])
print(settings.get_raw()["metricsWeekStartDay"])
settings.get_raw()["logFetchManagedDatasetConnectionName"] = "filesystem_managed"
settings.save()
The connection must already exist. Keep the retrieved fetchedRevision so that concurrent changes cause saving to fail instead of overwriting another administrator’s changes.
Reconciling users in Usage¶
Configure a dataset to link platform accounts belonging to the same person in the portfolio Usage dashboard. Use its full PROJECT_KEY.dataset_name identifier.
settings = client.get_settings()
settings.get_raw()["usageUserReconciliationDatasetId"] = "AGENTMONITORING.user_identities"
settings.save()
The dataset must already exist, be non-partitioned, contain at most 100,000 rows, and be readable by the user viewing Usage. It must provide the following string columns; additional columns are allowed.
Column |
Meaning |
|---|---|
|
Shared identity used to group accounts belonging to the same person. |
|
Platform ID in Agent Management. |
|
User ID reported by that platform. |
Provide one row per platform account, with all three values filled in. Accounts sharing a user_name are grouped. If the same platform_id and platform_user_id pair is associated with different user_name values, that account is excluded from reconciliation.
This setting applies to the portfolio Usage dashboard. Public per-agent metrics such as activity.distinct_users_count count stored user IDs independently of this dataset. Summing per-agent counts can count the same person more than once.
Configuring periodic alert evaluation¶
settings = client.get_settings()
settings.get_raw()["alertEvaluationEnabled"] = True
settings.get_raw()["alertEvaluationScheduleMode"] = "MINUTES"
settings.get_raw()["alertEvaluationFrequencyMinutes"] = 10
settings.save()
To request evaluation without waiting for the schedule, see Working with triggered alerts.
Changing metric calendar settings¶
The global timezone and first day of the week determine when the time intervals used to group metrics start and end. Changing them can make existing stored metrics incompatible and require deleting those metrics.
settings = client.get_settings()
settings.get_raw()["timezone"] = "Europe/Paris"
settings.get_raw()["metricsWeekStartDay"] = "MONDAY"
settings.save()
By default, saving rejects changes that require a metric reset. After checking which metrics will be affected, use settings.save(confirm_metric_reset=True) to allow their deletion.
For global business KPI definitions, see KPIs. For taxonomy settings, use the dedicated API in Risk taxonomy and overall exposure.
Reference documentation¶
Classes¶
The global Agent Management settings. |
