Crate relay_dynamic_config

Source
Expand description

Protocol for dynamic configuration passed down to Relay from Sentry.

In contrast to static configuration files, parts of Relay’s configuration is generated by Sentry and polled by Relay in regular intervals. Dynamic configuration includes (but is not limited to)

  1. rate limits and quotas,
  2. feature flags,
  3. settings that the user configured in Sentry’s UI.

§Project Configuration

So far, the only scope of dynamic configuration is per relay_auth::PublicKey a.k.a. DSN. The schema for this configuration is defined in ProjectConfig.

§Example Config

{
    "organizationId": 1,
    "config": {
        "excludeFields": [],
        "filterSettings": {},
        "scrubIpAddresses": False,
        "sensitiveFields": [],
        "scrubDefaults": True,
        "scrubData": True,
        "groupingConfig": {
            "id": "legacy:2019-03-12",
            "enhancements": "eJybzDhxY05qemJypZWRgaGlroGxrqHRBABbEwcC",
        },
        "blacklistedIps": ["127.43.33.22"],
        "trustedRelays": [],
    },
}

§Global configuration

This is the configuration for all Relays, independently from what per-project configuration is, and is defined in GlobalConfig.

§Example Config

{
    "measurements": {
       "builtinMeasurements": [
           {
               "name": "app_start_cold",
               "unit": "millisecond"
           }
       ],
       "maxCustomMeasurements": 1
    }
}

Structs§

BucketEncodings
Configuration container to control BucketEncoding per namespace.
CombinedMetricExtractionConfig
Combined view of global and project-specific metrics extraction configs.
CustomMeasurementConfig
Configuration for extracting custom measurements from transaction payloads.
FeatureSet
A set of Features.
GlobalConfig
A dynamic configuration for all Relays passed down from Sentry.
LimitedProjectConfig
Subset of ProjectConfig that is passed to external Relays.
MetricExtractionConfig
Configuration for generic extraction of metrics from all data categories.
MetricExtractionGroup
Group of metrics & tags that can be enabled or disabled as a group.
MetricExtractionGroupOverride
Configures global metrics extraction groups.
MetricExtractionGroups
Global groups for metric extraction.
MetricSpec
Specification for a metric to extract from some data.
Metrics
Configuration for metrics filtering.
Options
All options passed down from Sentry to Relay.
ProjectConfig
Dynamic, per-DSN configuration passed down from Sentry.
SessionMetricsConfig
Configuration for metric extraction from sessions.
Tag
Builder for TagSpec.
TagBlock
Configuration for removing tags matching the tag pattern on metrics whose name matches the name pattern.
TagMapping
Mapping between extracted metrics and additional tags to extract.
TagSpec
Configuration for a tag to add to a metric.
TagWithSource
Intermediate result of the tag spec builder.
TaggingRule
Rule defining when a target tag should be set on a metric.
TransactionMetricsConfig
Configuration for extracting metrics from transaction payloads.

Enums§

AcceptTransactionNames
Deprecated. Defines whether URL transactions should be considered low cardinality.
BucketEncoding
All supported metric bucket encodings.
CardinalityLimiterMode
Kill switch for controlling the cardinality limiter.
ErrorBoundary
Wraps a serialization / deserialization result to prevent error from bubbling up.
Feature
Features exposed by project config.
GroupKey
Enumeration of keys in MetricExtractionGroups. In JSON, this is simply a string.
TagSource
Specifies how to obtain the value of a tag in TagSpec.

Constants§

GRADUATED_FEATURE_FLAGS
Feature flags of graduated features are no longer sent by sentry, but Relay needs to insert them for outdated downstream Relays that may still rely on the feature flag.

Functions§

convert_conditional_tagging
Converts the given tagging rules from conditional_tagging to the newer metric extraction config.
normalize_json
Normalizes the given value by deserializing it and serializing it back.