Try it free

Configure security context

  • Latest Dynatrace
  • How-to guide
  • 6-min read
  • Published Jul 23, 2026

The dt.security_context field is a core Grail attribute that enables fine-grained, record-level access control on all telemetry data. It is part of the primary Grail field set and, once set on a signal, propagates to all derived data, including Davis events and problems.

When to use security context

Security context is the right choice when deployment- or bucket-level permissions are insufficient.

Typical scenarios include:

  • Shared infrastructure where multiple teams coexist on the same hosts or in the same namespace, and each team should only see its own data.
  • Regulated environments where access to specific application data must be restricted to authorized personnel.
  • Multi-tenant setups where data isolation between organizational units is required within a single Dynatrace environment.

If your organization can rely on deployment-level primary Grail fields such as k8s.namespace.name or dt.host_group.id for access control, you may not need dt.security_context at all. It becomes essential when the same deployment scope contains data that different audiences need access to.

Configuration patterns

Set the dt.security_context field as early as possible in the data pipeline, ideally at the source.

The following patterns are listed in order of preference.

At-source enrichment is always preferred over OpenPipeline-based enrichment for the security context. Setting security context at the source ensures it is available before pipeline routing, so data is routed to the correct pipeline and bucket from the start.

Set security context at the source

This is the preferred pattern.

Set dt.security_context at the point where telemetry is generated:

  • OneAgent host tags: Add dt.security_context=<value> as a host tag during installation or via Deployment Status. This applies the security context to all telemetry from that host.
  • DT_TAGS environment variable: For process-level granularity on shared infrastructure, add DT_TAGS:"dt.security_context=<value>" as an environment variable on the process. This scopes the security context to that specific process.
  • Kubernetes labels and annotations: Use namespace labels or annotations as the source for dt.security_context via Kubernetes metadata enrichment. This applies to all telemetry originating from that namespace.
  • OpenTelemetry resource attributes: Add dt.security_context as a resource attribute in OTEL_RESOURCE_ATTRIBUTES or via the OpenTelemetry Collector.

Set security context via central configuration

Where telemetry is collected via Dynatrace components (OneAgent, cloud integrations, Dynatrace Operator), configure the dt.security_context field in the central primary Grail tag configuration under Settings > Collect and capture. This ensures that all components apply a consistent mapping at source.

Within this configuration, you can:

  • Map a specific cloud or Kubernetes tag or label as the source of dt.security_context.
  • Select a host, process, Kubernetes, or cloud resource attribute as the source, with an optional regex extractor for the value.
  • Set a fixed value for all signals within a given scope (environment, Kubernetes cluster, host group).
  • Restrict application via filters (for example, only if environment=prod).

Set security context via OpenPipeline

Where further refinement is needed beyond at-source enrichment, define dt.security_context in OpenPipeline using dedicated Set security context processors. These are available for spans, logs, and metrics.

In OpenPipeline, you can derive dt.security_context from any combination of primary Grail fields, primary Grail tags, and other incoming attributes. This is useful when the security context value needs to be computed or transformed from multiple source fields.

Signal-specific guidance

Dynatrace provides signal-specific guides for configuring security context and Grail permissions:

  • Configure advanced permissions with security context
  • Set up Grail permissions for Distributed Tracing
  • Set up Grail permissions for logs
  • Set up Grail permissions for metrics
  • Set up Grail permissions for OneAgent
  • OpenTelemetry security context
  • Kubernetes security context

Related topics

  • Organize your data with primary Grail fields and tags
  • Primary Grail fields and tags
  • Best practices for enriching primary Grail fields and tags
  • Scope Dynatrace configuration with DQL matchers
  • Configure cost allocation
  • Configure advanced permissions with security context
  • Set up Grail permissions for logs
  • Set up Grail permissions for Distributed Tracing
  • Set up Grail permissions for Metrics
  • Set up Grail permissions for OneAgent
  • Set up Grail permissions for OpenTelemetry
  • Set up Grail permissions for telemetry from Kubernetes and Kubernetes workloads
Related tags
Dynatrace Platform