Overview of Dapr configuration options

    Self-hosted sidecar

    In self hosted mode the Dapr configuration is a configuration file, for example . By default the Dapr sidecar looks in the default Dapr folder for the runtime configuration eg: $HOME/.dapr/config.yaml in Linux/MacOS and %USERPROFILE%\.dapr\config.yaml in Windows.

    A Dapr sidecar can also apply a configuration by using a --config flag to the file path with dapr run CLI command.

    Kubernetes sidecar

    In Kubernetes mode the Dapr configuration is a Configuration CRD, that is applied to the cluster. For example;

    You can use the Dapr CLI to list the Configuration CRDs

    1. dapr configurations -k

    A Dapr sidecar can apply a specific configuration by using a dapr.io/config annotation. For example:

    Note: There are more Kubernetes annotations available to configure the Dapr sidecar on activation by sidecar Injector system service.

    The following configuration settings can be applied to Dapr application sidecars;

    Tracing

    Tracing configuration turns on tracing for an application.

    1. tracing:
    2. samplingRate: "1"
    3. zipkin:
    4. endpointAddress: "http://zipkin.default.svc.cluster.local:9411/api/v2/spans"

    The following table lists the properties for tracing:

    samplingRate is used to enable or disable the tracing. To disable the sampling rate , set samplingRate : "0" in the configuration. The valid range of samplingRate is between 0 and 1 inclusive. The sampling rate determines whether a trace span should be sampled or not based on value. samplingRate : "1" samples all traces. By default, the sampling rate is (0.0001) or 1 in 10,000 traces.

    See Observability distributed tracing for more information

    Metrics

    The metrics section can be used to enable or disable metrics for an application.

    The metrics section under the Configuration spec contains the following properties:

    The following table lists the properties for metrics:

    See metrics documentation for more information

    Middleware

    Middleware configuration set named Http pipeline middleware handlers The httpPipeline section under the Configuration spec contains the following properties:

    1. handlers:
    2. - name: oauth2
    3. - name: uppercase
    4. type: middleware.http.uppercase

    See Middleware pipelines for more information

    Scope secret store access

    See the Scoping secrets guide for information and examples on how to scope secrets to an application.

    Access Control allow lists for building block APIs

    See the selectively enable Dapr APIs on the Dapr sidecar guide for information and examples on how to set ACLs on the building block APIs lists.

    Access Control allow lists for service invocation API

    See the Allow lists for service invocation guide for information and examples on how to set allow lists with ACLs which using service invocation API.

    Turning on preview features

    See the preview features guide for information and examples on how to opt-in to preview features for a release. Preview feature enable new capabilities to be added that still need more time until they become generally available (GA) in the runtime.

    The following yaml shows an example configuration file that can be applied to an applications’ Dapr sidecar.

    Control-plane configuration

    There is a single configuration file called default installed with the Dapr control plane system services that applies global settings. This is only set up when Dapr is deployed to Kubernetes.

    A Dapr control plane configuration can configure the following settings:

    1. apiVersion: dapr.io/v1alpha1
    2. kind: Configuration
    3. metadata:
    4. name: default
    5. namespace: default
    6. spec:
    7. mtls:
    8. enabled: true