apm

package
v0.0.0-...-a1b9285 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

* Unless explicitly stated otherwise all files in this repository are licensed * under the Apache License Version 2.0. * * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2021 Datadog, Inc.

* Unless explicitly stated otherwise all files in this repository are licensed * under the Apache License Version 2.0. * * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2021 Datadog, Inc.

* Unless explicitly stated otherwise all files in this repository are licensed * under the Apache License Version 2.0. * * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2021 Datadog, Inc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTagsToTracePayloads

func AddTagsToTracePayloads(tracePayloads []*pb.TracePayload, tags string)

AddTagsToTracePayloads takes a single string of tags, eg 'a:b,c:d', and applies them to each span in a trace

func ComputeAPMStats

func ComputeAPMStats(tracePayload *pb.TracePayload) *stats.Payload

ComputeAPMStats calculates the stats that should be submitted to APM about a given trace

func GetAnalyzedSpans

func GetAnalyzedSpans(sps []*pb.Span) []*pb.Span

GetAnalyzedSpans finds all the analyzed spans in a trace, including top level spans and spans marked as anaylzed by the tracer. A span is considered top-level if:

  • it's a root span
  • its parent is unknown (other part of the code, distributed trace)
  • its parent belongs to another service (in that case it's a "local root" being the highest ancestor of other spans belonging to this service and attached to it).

func IsParentedToXray

func IsParentedToXray(span *pb.Span) bool

IsParentedToXray detects whether the parent of a trace is an X-Ray span

func NewClient

func NewClient(InsecureSkipVerify bool) *http.Client

NewClient returns a http.Client configured with the Agent options.

func ObfuscatePayload

func ObfuscatePayload(obfuscator *obfuscate.Obfuscator, tracePayloads []*pb.TracePayload)

ObfuscatePayload applies obfuscator rules to the trace payloads

func ParseTrace

func ParseTrace(content string) ([]*pb.TracePayload, error)

ParseTrace reads a trace using the standard log format

func ProcessTrace

func ProcessTrace(content string, obfuscator *obfuscate.Obfuscator, tags string) ([]*pb.TracePayload, error)

ProcessTrace parses, applies tags, and obfuscates a trace

func SetExtraHeaders

func SetExtraHeaders(h http.Header, extras map[string]string)

SetExtraHeaders appends a header map to HTTP headers.

Types

type Payload

type Payload struct {
	CreationDate time.Time
	Bytes        []byte
	Headers      map[string]string
}

Payload represents a data payload to be sent to some endpoint

func NewPayload

func NewPayload(bytes []byte, headers map[string]string) *Payload

NewPayload constructs a new payload object with the provided data and with CreationDate initialized to the current time.

type TraceEdgeConnection

type TraceEdgeConnection interface {
	SendTraces(ctx context.Context, trace *pb.TracePayload, maxRetries int) error
	SendStats(ctx context.Context, stats *stats.Payload, maxRetries int) error
}

TraceEdgeConnection is used to send data to trace edge

func CreateTraceEdgeConnection

func CreateTraceEdgeConnection(rootURL, apiKey string, InsecureSkipVerify bool) TraceEdgeConnection

CreateTraceEdgeConnection returns a new TraceEdgeConnection

Jump to

Keyboard shortcuts

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