Skip to content

Commit

Permalink
Address Feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 committed Dec 15, 2024
1 parent 517a969 commit d916c00
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion cmd/query/app/querysvc/adjuster/adjuster.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

// Adjuster is an interface for modifying a trace object in place.
// If an issue is encountered that prevents modifications, an error should be returned.
// The original trace object is modified directly and not returned.
// The caller must ensure that all spans in the ptrace.Traces argument
// belong to the same trace and represent the complete trace.
type Adjuster interface {
Expand Down
4 changes: 2 additions & 2 deletions cmd/query/app/querysvc/adjuster/resourceattributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/ptrace"

"github.com/jaegertracing/jaeger/internal/jotlp"
"github.com/jaegertracing/jaeger/internal/jptrace"
"github.com/jaegertracing/jaeger/pkg/otelsemconv"
)

Expand Down Expand Up @@ -58,7 +58,7 @@ func (ResourceAttributesAdjuster) moveAttributes(span ptrace.Span, resource pcom
for k, v := range replace {
existing, ok := resource.Attributes().Get(k)
if ok && existing.AsRaw() != v.AsRaw() {
jotlp.AddWarning(span, "conflicting values between Span and Resource for attribute "+k)
jptrace.AddWarning(span, "conflicting values between Span and Resource for attribute "+k)
continue
}
v.CopyTo(resource.Attributes().PutEmpty(k))
Expand Down
4 changes: 2 additions & 2 deletions cmd/query/app/querysvc/adjuster/resourceattributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/pdata/ptrace"

"github.com/jaegertracing/jaeger/internal/jotlp"
"github.com/jaegertracing/jaeger/internal/jptrace"
"github.com/jaegertracing/jaeger/pkg/otelsemconv"
)

Expand Down Expand Up @@ -102,7 +102,7 @@ func TestResourceAttributesAdjuster_SpanWithConflictingLibraryAttributes(t *test
require.True(t, ok)
require.Equal(t, "Java", val.Str())

val, ok = resultSpanAttributes.Get(jotlp.WarningsAttribute)
val, ok = resultSpanAttributes.Get(jptrace.WarningsAttribute)
require.True(t, ok)
warnings := val.Slice()
require.Equal(t, 1, warnings.Len())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package jotlp
package jptrace

import (
"testing"
Expand Down
6 changes: 5 additions & 1 deletion internal/jotlp/warning.go → internal/jptrace/warning.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
// Copyright (c) 2024 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package jotlp
package jptrace

import (
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/ptrace"
)

const (
// WarningsAttribute is the name of the span attribute where we can
// 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"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2024 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package jotlp
package jptrace

import (
"testing"
Expand Down

0 comments on commit d916c00

Please sign in to comment.