Skip to content

Commit

Permalink
move constants to span_pointers.go
Browse files Browse the repository at this point in the history
  • Loading branch information
nhulston committed Dec 17, 2024
1 parent f804396 commit a7573a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions pkg/serverless/invocationlifecycle/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package invocationlifecycle
import (
"bytes"
"fmt"
"github.com/DataDog/datadog-agent/pkg/serverless/spanpointers"
"net/http"
"os"
"regexp"
Expand All @@ -28,9 +29,7 @@ import (
)

const (
functionNameEnvVar = "AWS_LAMBDA_FUNCTION_NAME"
spanPointerLinkKind = "span-pointer"
spanPointerUpDirection = "u" // Tracers will handle cases where direction is down
functionNameEnvVar = "AWS_LAMBDA_FUNCTION_NAME"
)

var /* const */ runtimeRegex = regexp.MustCompile(`^(dotnet|go|java|ruby)(\d+(\.\d+)*|\d+(\.x))$`)
Expand Down Expand Up @@ -169,8 +168,8 @@ func (lp *LifecycleProcessor) endExecutionSpan(endDetails *InvocationEndDetails)
for _, sp := range lp.requestHandler.spanPointers {
spanLink := map[string]interface{}{
"attributes": map[string]string{
"link.kind": spanPointerLinkKind,
"ptr.dir": spanPointerUpDirection,
"link.kind": spanpointers.SpanPointerLinkKind,
"ptr.dir": spanpointers.SpanPointerUpDirection,
"ptr.hash": sp.Hash,
"ptr.kind": sp.Kind,
},
Expand Down
4 changes: 3 additions & 1 deletion pkg/serverless/spanpointers/span_pointers.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import (
)

const (
s3PointerKind = "aws.s3.object"
s3PointerKind = "aws.s3.object"
SpanPointerLinkKind = "span-pointer"
SpanPointerUpDirection = "u" // Tracers will handle cases where direction is down
)

// SpanPointer is a struct that stores a hash and span kind to uniquely
Expand Down

0 comments on commit a7573a4

Please sign in to comment.