Skip to content

Commit

Permalink
Merge pull request #216 from signalfx/invalids
Browse files Browse the repository at this point in the history
Use traceID:spanID as format for spanfilter values
  • Loading branch information
mdubbyap authored Mar 17, 2021
2 parents 317e4fe + 5669db2 commit c5ab602
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions trace/translator/sfx.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ func GetLocalEndpointInfo(sfxSpan *trace.Span, span *jaegerpb.Span) {
func SAPMSpanFromSFXSpan(sfxSpan *trace.Span, sm *spanfilter.Map) (span *jaegerpb.Span) {
spanID, err := jaegerpb.SpanIDFromString(sfxSpan.ID)
if err != nil {
sm.Add(spanfilter.InvalidSpanID, sfxSpan.ID)
sm.Add(spanfilter.InvalidSpanID, spanFilterValue(sfxSpan))
return
}

traceID, err := jaegerpb.TraceIDFromString(sfxSpan.TraceID)
if err != nil {
sm.Add(spanfilter.InvalidTraceID, sfxSpan.ID)
sm.Add(spanfilter.InvalidTraceID, spanFilterValue(sfxSpan))
return
}

Expand Down Expand Up @@ -131,6 +131,10 @@ func SAPMSpanFromSFXSpan(sfxSpan *trace.Span, sm *spanfilter.Map) (span *jaegerp
return span
}

func spanFilterValue(span *trace.Span) string {
return fmt.Sprintf("%s:%s", span.TraceID, span.ID)
}

// SFXTagsToJaegerTags returns process tags and span tags from the SignalFx span tags, endpoint (remote), and kind
func SFXTagsToJaegerTags(tags map[string]string, remoteEndpoint *trace.Endpoint, kind *string) ([]jaegerpb.KeyValue, []jaegerpb.KeyValue) {
maxNumTags := len(tags) + 4
Expand Down

0 comments on commit c5ab602

Please sign in to comment.