inferredspan

package
v0.0.0-...-8cb7df0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIsInferredSpan

func CheckIsInferredSpan(span *pb.Span) bool

CheckIsInferredSpan determines if a span belongs to a managed service or not _inferred_span.tag_source = "self" => managed service span _inferred_span.tag_source = "lambda" or missing => lambda related span

func CreateServiceMapping

func CreateServiceMapping(val string) map[string]string

func DetermineServiceName

func DetermineServiceName(serviceMapping map[string]string, specificKey string, genericKey string, defaultValue string) string

func FilterFunctionTags

func FilterFunctionTags(input map[string]string) map[string]string

FilterFunctionTags filters out DD tags & function specific tags

func GenerateSpanId

func GenerateSpanId() uint64

GenerateSpanId creates a secure random span id in specific scenarios, otherwise return a pseudo random id

func GetServiceMapping

func GetServiceMapping() map[string]string

This function gets a snapshot of the current service mapping without modifying it.

func IsInferredSpansEnabled

func IsInferredSpansEnabled() bool

IsInferredSpansEnabled is used to determine if we need to generate and enrich inferred spans for a particular invocation

func SetServiceMapping

func SetServiceMapping(newServiceMapping map[string]string)

SetServiceMapping sets the serviceMapping global variable, primarily for tests.

Types

type InferredSpan

type InferredSpan struct {
	Span    *pb.Span
	IsAsync bool
	// CurrentInvocationStartTime is the start time of the
	// current invocation not he inferred span. It is used
	// for async function calls to calculate the duration.
	CurrentInvocationStartTime time.Time
}

InferredSpan contains the pb.Span and Async information of the inferredSpan for the current invocation

func (*InferredSpan) AddTagToInferredSpan

func (inferredSpan *InferredSpan) AddTagToInferredSpan(key string, value string)

AddTagToInferredSpan is used to add new tags to the inferred span in inferredSpan.Span.Meta[]. Should be used before completing an inferred span.

func (*InferredSpan) EnrichInferredSpanWithAPIGatewayHTTPEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithAPIGatewayHTTPEvent(eventPayload events.APIGatewayV2HTTPRequest)

EnrichInferredSpanWithAPIGatewayHTTPEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from a HTTP event.

func (*InferredSpan) EnrichInferredSpanWithAPIGatewayRESTEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithAPIGatewayRESTEvent(eventPayload events.APIGatewayProxyRequest)

EnrichInferredSpanWithAPIGatewayRESTEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from a REST event.

func (*InferredSpan) EnrichInferredSpanWithAPIGatewayWebsocketEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithAPIGatewayWebsocketEvent(eventPayload events.APIGatewayWebsocketProxyRequest)

EnrichInferredSpanWithAPIGatewayWebsocketEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from a Websocket event.

func (*InferredSpan) EnrichInferredSpanWithDynamoDBEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithDynamoDBEvent(eventPayload events.DynamoDBEvent)

EnrichInferredSpanWithDynamoDBEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from a DynamoDB event.

func (*InferredSpan) EnrichInferredSpanWithEventBridgeEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithEventBridgeEvent(eventPayload events.EventBridgeEvent)

EnrichInferredSpanWithEventBridgeEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from an EventBridge event.

func (*InferredSpan) EnrichInferredSpanWithKinesisEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithKinesisEvent(eventPayload events.KinesisEvent)

EnrichInferredSpanWithKinesisEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from a Kinesis event.

func (*InferredSpan) EnrichInferredSpanWithLambdaFunctionURLEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithLambdaFunctionURLEvent(eventPayload events.LambdaFunctionURLRequest)

EnrichInferredSpanWithLambdaFunctionURLEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from a Lambda Function URL event.

func (*InferredSpan) EnrichInferredSpanWithS3Event

func (inferredSpan *InferredSpan) EnrichInferredSpanWithS3Event(eventPayload events.S3Event)

EnrichInferredSpanWithS3Event uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from an S3 event.

func (*InferredSpan) EnrichInferredSpanWithSNSEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithSNSEvent(eventPayload events.SNSEvent)

EnrichInferredSpanWithSNSEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from an SNS event.

func (*InferredSpan) EnrichInferredSpanWithSQSEvent

func (inferredSpan *InferredSpan) EnrichInferredSpanWithSQSEvent(eventPayload events.SQSEvent)

EnrichInferredSpanWithSQSEvent uses the parsed event payload to enrich the current inferred span. It applies a specific set of data to the span expected from an SQS event.

func (*InferredSpan) GenerateInferredSpan

func (inferredSpan *InferredSpan) GenerateInferredSpan(startTime time.Time)

GenerateInferredSpan declares and initializes a new inferred span with a SpanID

Jump to

Keyboard shortcuts

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