You can enrich telemetry from Dynatrace-provided and custom extensions with one or more dt.security_context values. With multiple values, a single monitoring configuration can serve several teams or security boundaries at once, without duplicating the configuration or deriving the values later in OpenPipeline.
You can set security contexts at two levels:
You can set security contexts when you activate an extension, individually for each monitoring configuration, or later by editing the configuration.
For general guidance on when and how to use security context, see Configure security context.
To avoid vulnerabilities, such as unauthorized access or data leakage, configure the security context for extensions according to our recommended practices.
Go to
Extensions and select your extension.
On the Monitoring configurations tab, create a monitoring configuration, or select Edit in the Actions column of an existing one.
To set security contexts for a single endpoint, locate the endpoint within the configuration form.

To set security contexts for the whole configuration, select Next to go to the Attributes page of the monitoring configuration form.
Select Save.
A monitoring configuration with more than one security context requires ActiveGate and Extensions module version 1.351+.
Use the Extensions API to set security contexts on an extension monitoring configuration. Add the dt.security_context.list property to a dtAttributes object.
PUT /api/v2/extensions/{extensionName}/monitoringConfigurations/{configurationId}
Set dtAttributes at the top level of the monitoring configuration.
{"dtAttributes": {"dt.security_context.list": ["foo","bar"],"dt.cost.product": "cost"}}
You can also set up a security context via the Environment API. For details, see Monitored entities API - security context.
Security contexts set at the endpoint level replace the security contexts set for the whole configuration. Values aren't merged across levels.
The following cases show which security contexts are added to the data of an endpoint.
| Case | Configuration security contexts | Endpoint security contexts | Enrichment result |
|---|---|---|---|
| 1 | ["foo","bar"] | Not defined | dt.security_context=["foo","bar"] |
| 2 | ["foo","bar"] | ["baz"] | dt.security_context=["baz"] |
| 3 | Not defined | ["baz"] | dt.security_context=["baz"] |
Local extensions run on OneAgent and inherit dt.security_context from the host. If the host defines multiple security contexts, all of them are applied to the data from local extensions on that host. For details, see Set up Grail permissions for OneAgent.
With multiple values, dt.security_context is an array. Use the in function to filter for a single value:
fetch logs| filter in("foo", dt.security_context)
dt.security_context field isn't added to the data.
Extensions