Skip to content

Commit

Permalink
Standardized tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ADI-ROXX committed Jan 11, 2025
1 parent 980dc31 commit ed98b7d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/collector/app/span_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (sp *spanProcessor) enqueueSpan(span *model.Span, originalFormat processor.
}

// add format tag
span.Tags = append(span.Tags, model.String("internal.span.format", string(originalFormat)))
span.Tags = append(span.Tags, model.String("@jaeger@format", string(originalFormat)))

item := queueItem{
queuedTime: time.Now(),
Expand Down
2 changes: 1 addition & 1 deletion internal/jptrace/warning.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
// store various warnings produced from transformations,
// such as inbound sanitizers and outbound adjusters.
// The value type of the attribute is a string slice.
WarningsAttribute = "jaeger.internal.warnings"
WarningsAttribute = "@jaeger@warnings"
)

func AddWarnings(span ptrace.Span, warnings ...string) {
Expand Down
8 changes: 4 additions & 4 deletions internal/jptrace/warning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ func TestAddWarning(t *testing.T) {
span := ptrace.NewSpan()
attrs := span.Attributes()
if test.existing != nil {
warnings := attrs.PutEmptySlice("jaeger.internal.warnings")
warnings := attrs.PutEmptySlice("@jaeger@warnings")
for _, warn := range test.existing {
warnings.AppendEmpty().SetStr(warn)
}
}
AddWarnings(span, test.newWarn)
warnings, ok := attrs.Get("jaeger.internal.warnings")
warnings, ok := attrs.Get("@jaeger@warnings")
assert.True(t, ok)
assert.Equal(t, len(test.expected), warnings.Slice().Len())
for i, expectedWarn := range test.expected {
Expand All @@ -61,7 +61,7 @@ func TestAddWarning(t *testing.T) {
func TestAddWarning_MultipleWarnings(t *testing.T) {
span := ptrace.NewSpan()
AddWarnings(span, "warning-1", "warning-2")
warnings, ok := span.Attributes().Get("jaeger.internal.warnings")
warnings, ok := span.Attributes().Get("@jaeger@warnings")
require.True(t, ok)
require.Equal(t, "warning-1", warnings.Slice().At(0).Str())
require.Equal(t, "warning-2", warnings.Slice().At(1).Str())
Expand Down Expand Up @@ -94,7 +94,7 @@ func TestGetWarnings(t *testing.T) {
span := ptrace.NewSpan()
attrs := span.Attributes()
if test.existing != nil {
warnings := attrs.PutEmptySlice("jaeger.internal.warnings")
warnings := attrs.PutEmptySlice("@jaeger@warnings")
for _, warn := range test.existing {
warnings.AppendEmpty().SetStr(warn)
}
Expand Down

0 comments on commit ed98b7d

Please sign in to comment.