View Source Datadog.DataStreams.Context (Data Streams Ex v1.2.2)

This module deals with storing a Datadog.DataStreams.Pathway in process, so it can be propagated later on. In Golang, this is handled via Context which is a grab bag that is passed down the whole calling stack. We don't have an equivalent in Elixir, so we instead piggy back off of OpenTelemetry.Baggage. This essentially lets us do the same thing without needing to manually pass data down the calling stack.

This is optional. If you do not have Open Telemetry installed or setup, functions here will not propagate the Pathway. You will need to manually propagate it in your application.

Summary

Functions

Removes the current existing Pathway from OpenTelemetry. Returns the value that existing in OpenTelemetry.

Returns the current existing Pathway from OpenTelemetry. If there is no Pathway in the current context, nil will be returned

Sets the given Pathway to the current Pathway in OpenTelemetry.

Sets a checkpoint on the current existing Pathway. If one does not exist, a new Pathway is created from the edge tags and returned.

Functions

@spec clear() :: Datadog.DataStreams.Pathway.t() | nil

Removes the current existing Pathway from OpenTelemetry. Returns the value that existing in OpenTelemetry.

@spec get() :: Datadog.DataStreams.Pathway.t() | nil

Returns the current existing Pathway from OpenTelemetry. If there is no Pathway in the current context, nil will be returned

Sets the given Pathway to the current Pathway in OpenTelemetry.

Sets a checkpoint on the current existing Pathway. If one does not exist, a new Pathway is created from the edge tags and returned.