transform

package
v0.61.0-rc.7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package transform implements mappings from OTLP to DD semantics, and helpers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFirstFromMap

func GetFirstFromMap(m map[string]string, keys ...string) (string, string)

GetFirstFromMap checks each key in the given keys in the map and returns the first key-value pair whose key matches, or empty strings if none matches.

func MarshalEvents

func MarshalEvents(events ptrace.SpanEventSlice) string

MarshalEvents marshals events into JSON.

func MarshalLinks(links ptrace.SpanLinkSlice) string

MarshalLinks marshals span links into JSON.

func OperationAndResourceNameV2Enabled

func OperationAndResourceNameV2Enabled(conf *config.AgentConfig) bool

OperationAndResourceNameV2Enabled checks if the new operation and resource name logic should be used

func OtelSpanToDDSpan

func OtelSpanToDDSpan(
	otelspan ptrace.Span,
	otelres pcommon.Resource,
	lib pcommon.InstrumentationScope,
	conf *config.AgentConfig,
	peerTagKeys []string,
) *pb.Span

OtelSpanToDDSpan converts an OTel span to a DD span.

func OtelSpanToDDSpanMinimal

func OtelSpanToDDSpanMinimal(
	otelspan ptrace.Span,
	otelres pcommon.Resource,
	lib pcommon.InstrumentationScope,
	isTopLevel, topLevelByKind bool,
	conf *config.AgentConfig,
	peerTagKeys []string,
) *pb.Span

OtelSpanToDDSpanMinimal otelSpanToDDSpan converts an OTel span to a DD span. The converted DD span only has the minimal number of fields for APM stats calculation and is only meant to be used in OTLPTracesToConcentratorInputs. Do not use them for other purposes.

func SetMetaOTLP

func SetMetaOTLP(s *pb.Span, k, v string)

SetMetaOTLP sets the k/v OTLP attribute pair as a tag on span s.

func SetMetricOTLP

func SetMetricOTLP(s *pb.Span, k string, v float64)

SetMetricOTLP sets the k/v OTLP attribute pair as a metric on span s.

func Status2Error

func Status2Error(status ptrace.Status, events ptrace.SpanEventSlice, span *pb.Span)

Status2Error checks the given status and events and applies any potential error and messages to the given span attributes.

func TagSpanIfContainsExceptionEvent

func TagSpanIfContainsExceptionEvent(otelspan ptrace.Span, ddspan *pb.Span)

TagSpanIfContainsExceptionEvent tags spans that contain at least on exception span event.

Types

This section is empty.

Jump to

Keyboard shortcuts

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