Documentation ¶
Overview ¶
Package transform implements mappings from OTLP to DD semantics, and helpers
Index ¶
- Constants
- func GetFirstFromMap(m map[string]string, keys ...string) (string, string)
- func MarshalEvents(events ptrace.SpanEventSlice) string
- func MarshalLinks(links ptrace.SpanLinkSlice) string
- func ObfuscateRedisSpan(o *obfuscate.Obfuscator, span *pb.Span, removeAllArgs bool)
- func ObfuscateSQLSpan(o *obfuscate.Obfuscator, span *pb.Span) (*obfuscate.ObfuscatedQuery, error)
- func OperationAndResourceNameV2Enabled(conf *config.AgentConfig) bool
- func OtelSpanToDDSpan(otelspan ptrace.Span, otelres pcommon.Resource, ...) *pb.Span
- func OtelSpanToDDSpanMinimal(otelspan ptrace.Span, otelres pcommon.Resource, ...) *pb.Span
- func SetMetaOTLP(s *pb.Span, k, v string)
- func SetMetricOTLP(s *pb.Span, k string, v float64)
- func Status2Error(status ptrace.Status, events ptrace.SpanEventSlice, span *pb.Span)
- func TagSpanIfContainsExceptionEvent(otelspan ptrace.Span, ddspan *pb.Span)
Constants ¶
const ( // TagRedisRawCommand represents a redis raw command tag TagRedisRawCommand = "redis.raw_command" // TagMemcachedCommand represents a memcached command tag TagMemcachedCommand = "memcached.command" // TagMongoDBQuery represents a MongoDB query tag TagMongoDBQuery = "mongodb.query" // TagElasticBody represents an Elasticsearch body tag TagElasticBody = "elasticsearch.body" // TagOpenSearchBody represents an OpenSearch body tag TagOpenSearchBody = "opensearch.body" // TagSQLQuery represents a SQL query tag TagSQLQuery = "sql.query" // TagHTTPURL represents an HTTP URL tag TagHTTPURL = "http.url" // TagDBMS represents a DBMS tag TagDBMS = "db.type" )
const (
// TextNonParsable is the error text used when a query is non-parsable
TextNonParsable = "Non-parsable SQL query"
)
Variables ¶
This section is empty.
Functions ¶
func GetFirstFromMap ¶
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 ¶
func MarshalLinks(links ptrace.SpanLinkSlice) string
MarshalLinks marshals span links into JSON.
func ObfuscateRedisSpan ¶
func ObfuscateRedisSpan(o *obfuscate.Obfuscator, span *pb.Span, removeAllArgs bool)
ObfuscateRedisSpan obfuscates a Redis span using pkg/obfuscate logic
func ObfuscateSQLSpan ¶
func ObfuscateSQLSpan(o *obfuscate.Obfuscator, span *pb.Span) (*obfuscate.ObfuscatedQuery, error)
ObfuscateSQLSpan obfuscates a SQL span using pkg/obfuscate logic
func OperationAndResourceNameV2Enabled ¶ added in v0.61.0
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 ¶
SetMetaOTLP sets the k/v OTLP attribute pair as a tag on span s.
func SetMetricOTLP ¶
SetMetricOTLP sets the k/v OTLP attribute pair as a metric on span s.
func Status2Error ¶
Status2Error checks the given status and events and applies any potential error and messages to the given span attributes.
Types ¶
This section is empty.