pipelines

package module
v0.0.0-...-89ab3b9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2022 License: Apache-2.0, BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PropagationKey is the key to use to propagate the pathway between services.
	PropagationKey = "dd-pathway-ctx"
)

Variables

This section is empty.

Functions

func MergeContexts

func MergeContexts(ctxs ...context.Context) context.Context

MergeContexts returns the first context which includes the pathway resulting from merging the pathways contained in all contexts.

func Start

func Start(opts ...StartOption)

Start starts the pipeline processor that will record pipeline stats and send them to the agent.

func Stop

func Stop()

Stop stops the pipeline processor.

func ToContext

func ToContext(ctx context.Context, p Pathway) context.Context

ToContext returns a copy of the given context which includes the pathway p.

Types

type Pathway

type Pathway struct {
	// contains filtered or unexported fields
}

Pathway represents a path points can take. It is defined as nodes (services) linked together with edges. To reduce the size of the propagated serialized pathway, instead of storing a list of edges and services, a hash of the path is computed. The hash is then resolved in the Datadog backend.

func Decode

func Decode(data []byte) (p Pathway, err error)

Decode decodes a pathway

func FromContext

func FromContext(ctx context.Context) (p Pathway, ok bool)

FromContext returns the pathway contained in the given context.

func Merge

func Merge(pathways []Pathway) Pathway

Merge merges multiple pathways

func NewPathway

func NewPathway() Pathway

NewPathway creates a new pathway.

func SetCheckpoint

func SetCheckpoint(ctx context.Context, edge string) (Pathway, context.Context)

SetCheckpoint sets a checkpoint on the pathway in the context. if there is no pathway in the context, it creates a new one.

func (Pathway) Encode

func (p Pathway) Encode() []byte

Encode encodes the pathway

func (Pathway) SetCheckpoint

func (p Pathway) SetCheckpoint(edge string) Pathway

SetCheckpoint sets a checkpoint on a pathway.

type StartOption

type StartOption func(*config)

StartOption represents a function that can be provided as a parameter to Start.

func WithAgentAddr

func WithAgentAddr(addr string) StartOption

WithAgentAddr sets the address where the agent is located. The default is localhost:8126. It should contain both host and port.

func WithAgentLess

func WithAgentLess(apiKey string) StartOption

WithAgentLess starts the pipeline processor in a mode where stats are sent directly to the datadog backend instead of going through the agent.

func WithDogstatsdAddress

func WithDogstatsdAddress(addr string) StartOption

WithDogstatsdAddress specifies the address to connect to for sending metrics to the Datadog Agent. If not set, it defaults to "localhost:8125" or to the combination of the environment variables DD_AGENT_HOST and DD_DOGSTATSD_PORT. This option is in effect when WithRuntimeMetrics is enabled.

func WithEnv

func WithEnv(env string) StartOption

WithEnv sets the environment to which all traces started by the tracer will be submitted. The default value is the environment variable DD_ENV, if it is set.

func WithService

func WithService(name string) StartOption

WithService sets the default service name for the program.

func WithSite

func WithSite(site string) StartOption

WithSite starts the pipeline processor with a given site to send data to.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL