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

A pathway is used to monitor how payloads are sent across different services.

An example pathway would be:

service A -- edge 1 --> service B -- edge 2 --> service C

So it's a bunch of services (we also call them "nodes") connected via edges. As the payload is sent around, we save the start time (start of service A), and the start time of the previous service. This allows us to measure the latency of each edge, as well as the latency from origin of any service.

See the data-streams-go package for more details.

Summary

Functions

Merges multiple pathways into one. The current implementation samples one resulting pathway. A future implementation could be more clever and actually merge the pathways.

Creates a new pathway struct.

Creates a new pathway at a given time in unix epoch nanoseconds.

Hashes all data for a pathway.

Hashes together a node and parent hash

Sets a checkpoint on the pathway.

Sets a checkpoint on the pathway at the given time in unix epoch nanoseconds.

Types

@type t() :: %Datadog.DataStreams.Pathway{
  edge_start: non_neg_integer(),
  hash: non_neg_integer(),
  pathway_start: non_neg_integer()
}

Functions

@spec merge([t()]) :: t()

Merges multiple pathways into one. The current implementation samples one resulting pathway. A future implementation could be more clever and actually merge the pathways.

@spec new_pathway(Datadog.DataStreams.Tags.input()) :: t()

Creates a new pathway struct.

@spec new_pathway(non_neg_integer(), Datadog.DataStreams.Tags.input()) :: t()

Creates a new pathway at a given time in unix epoch nanoseconds.

Link to this function

node_hash(service, env, primary_tag, tags \\ [])

View Source

Hashes all data for a pathway.

Examples

iex> Pathway.node_hash("service-1", "env", "d:1", [])
2071821778175304604

iex> # Invalid edge tag
...> Pathway.node_hash("service-1", "env", "d:1", [{"edge", "1"}])
2071821778175304604

iex> Pathway.node_hash("service-1", "env", "d:1", [{"type", "kafka"}])
9272613839978655432
Link to this function

pathway_hash(node_hash, parent_hash)

View Source
@spec pathway_hash(non_neg_integer(), non_neg_integer()) :: non_neg_integer()

Hashes together a node and parent hash

Examples

iex> Pathway.pathway_hash(0, 0)
9808874869469701221

iex> Pathway.pathway_hash(2071821778175304604, 0)
17210443572488294574

iex> Pathway.pathway_hash(0, 2071821778175304604)
12425197808660046030

iex> Pathway.pathway_hash(2071821778175304604, 17210443572488294574)
2003974475228685984
Link to this function

set_checkpoint(pathway, tags)

View Source
@spec set_checkpoint(t() | nil, Datadog.DataStreams.Tags.input()) :: t()

Sets a checkpoint on the pathway.

Link to this function

set_checkpoint(pathway, now, tags)

View Source
@spec set_checkpoint(t() | nil, non_neg_integer(), Datadog.DataStreams.Tags.input()) ::
  t()

Sets a checkpoint on the pathway at the given time in unix epoch nanoseconds.