| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Runtime.Telemetry.Resolve.Internal
Description
The environment reads and the projections behind Ecluse.Runtime.Telemetry.Resolve, which
documents the configuration model and re-exports the curated surface. Importing this module opts
out of that stability promise, the convention text and bytestring use, so production code
imports the public one.
Synopsis
- data ResolvedTelemetry = ResolvedTelemetry {}
- data TelemetryEndpoint = TelemetryEndpoint {
- teUrl :: Text
- teSource :: EndpointSource
- data EndpointSource
- resolveTelemetry :: [(String, String)] -> ResolvedTelemetry
- declaredEnv :: String -> [(String, String)] -> Maybe Text
- otelEnvironmentOverrides :: [(String, String)] -> [(String, String)]
- data ResourceAttributes = ResourceAttributes {}
- resourceAttributes :: [(String, String)] -> ResourceAttributes
- telemetryWarnings :: [(String, String)] -> [Text]
- prepareTelemetry :: LogEnv -> [(String, String)] -> IO ()
The resolved telemetry identity
data ResolvedTelemetry Source #
The telemetry identity the SDK configuration and the dd log object share. The process
cannot know its own deployment environment, so rtEnvironment stays optional.
Constructors
| ResolvedTelemetry | |
Fields
| |
Instances
| Show ResolvedTelemetry Source # | |
Defined in Ecluse.Runtime.Telemetry.Resolve.Internal Methods showsPrec :: Int -> ResolvedTelemetry -> ShowS # show :: ResolvedTelemetry -> String # showList :: [ResolvedTelemetry] -> ShowS # | |
| Eq ResolvedTelemetry Source # | |
Defined in Ecluse.Runtime.Telemetry.Resolve.Internal Methods (==) :: ResolvedTelemetry -> ResolvedTelemetry -> Bool # (/=) :: ResolvedTelemetry -> ResolvedTelemetry -> Bool # | |
data TelemetryEndpoint Source #
A resolved OTLP export endpoint and the source it was resolved from.
Constructors
| TelemetryEndpoint | |
Fields
| |
Instances
| Show TelemetryEndpoint Source # | |
Defined in Ecluse.Runtime.Telemetry.Resolve.Internal Methods showsPrec :: Int -> TelemetryEndpoint -> ShowS # show :: TelemetryEndpoint -> String # showList :: [TelemetryEndpoint] -> ShowS # | |
| Eq TelemetryEndpoint Source # | |
Defined in Ecluse.Runtime.Telemetry.Resolve.Internal Methods (==) :: TelemetryEndpoint -> TelemetryEndpoint -> Bool # (/=) :: TelemetryEndpoint -> TelemetryEndpoint -> Bool # | |
data EndpointSource Source #
Where a resolved OTLP endpoint came from, so the boot path can tell a configured target from the silent default.
Constructors
| FromDdAgentHost | Derived from |
| FromOtelEndpoint | Taken verbatim from |
| DefaultedEndpoint | No endpoint was configured, so the |
Instances
| Show EndpointSource Source # | |
Defined in Ecluse.Runtime.Telemetry.Resolve.Internal Methods showsPrec :: Int -> EndpointSource -> ShowS # show :: EndpointSource -> String # showList :: [EndpointSource] -> ShowS # | |
| Eq EndpointSource Source # | |
Defined in Ecluse.Runtime.Telemetry.Resolve.Internal Methods (==) :: EndpointSource -> EndpointSource -> Bool # (/=) :: EndpointSource -> EndpointSource -> Bool # | |
resolveTelemetry :: [(String, String)] -> ResolvedTelemetry Source #
Resolve the telemetry identity, each field falling __Datadog value, then vanilla
OpenTelemetry, then the default__. The resolver never reads DD_API_KEY or DD_SITE.
>>>rtServiceName (resolveTelemetry [("DD_SERVICE", "api"), ("OTEL_SERVICE_NAME", "ignored")])"api"
>>>teUrl (rtEndpoint (resolveTelemetry []))"http://localhost:4318"
declaredEnv :: String -> [(String, String)] -> Maybe Text Source #
Read one environment variable, counting a present but blank value as unset.
Canonical OTEL_* projection
otelEnvironmentOverrides :: [(String, String)] -> [(String, String)] Source #
Project the resolved identity back to the canonical OTEL_* variables the env-driven SDK
reads. The protocol is pinned to http/protobuf because gRPC sits behind a disabled cabal flag.
data ResourceAttributes Source #
The members the exported header carries, and the keys the W3C baggage limits left out.
Constructors
| ResourceAttributes | |
Instances
| Show ResourceAttributes Source # | |
Defined in Ecluse.Runtime.Telemetry.Resolve.Internal Methods showsPrec :: Int -> ResourceAttributes -> ShowS # show :: ResourceAttributes -> String # showList :: [ResourceAttributes] -> ShowS # | |
| Eq ResourceAttributes Source # | |
Defined in Ecluse.Runtime.Telemetry.Resolve.Internal Methods (==) :: ResourceAttributes -> ResourceAttributes -> Bool # (/=) :: ResourceAttributes -> ResourceAttributes -> Bool # | |
resourceAttributes :: [(String, String)] -> ResourceAttributes Source #
Decide what the exported header carries. The SDK's encoder would shed the overflow in hash order, so the choice is made here: the carried set is stable and every shed key warns at boot.
Boot wiring
telemetryWarnings :: [(String, String)] -> [Text] Source #
The boot warnings the environment raises, in the order prepareTelemetry surfaces them.