Skip to content

Commit

Permalink
Running make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
djluck committed Dec 7, 2024
1 parent 487860e commit 5e89a44
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion processor/tailsamplingprocessor/composite_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
package tailsamplingprocessor // import "github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor"

import (
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor/internal/telemetry"
"go.opentelemetry.io/collector/component"

"github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor/internal/telemetry"

"github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor/internal/sampling"
)

Expand Down
3 changes: 2 additions & 1 deletion processor/tailsamplingprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ package tailsamplingprocessor // import "github.com/open-telemetry/opentelemetry

import (
"context"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor/internal/telemetry"
"time"

"github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor/internal/telemetry"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ func TestCompositeEvaluatorSampled(t *testing.T) {
}

func TestCompositeEvaluatorSampled_RecordSubPolicy(t *testing.T) {

// Create 2 subpolicies. First results in 100% NotSampled, the second in 100% Sampled.
n1 := NewNumericAttributeFilter(componenttest.NewNopTelemetrySettings(), "tag", 0, 100, false)
n2 := NewAlwaysSample(componenttest.NewNopTelemetrySettings())
Expand Down Expand Up @@ -183,7 +182,6 @@ func TestCompositeEvaluatorInverseSampled_AlwaysSampled(t *testing.T) {
}

func TestCompositeEvaluatorInverseSampled_AlwaysSampled_RecordSubPolicy(t *testing.T) {

// The first policy does not match, the second matches through invert
n1 := NewStringAttributeFilter(componenttest.NewNopTelemetrySettings(), "tag", []string{"foo"}, false, 0, false)
n2 := NewStringAttributeFilter(componenttest.NewNopTelemetrySettings(), "tag", []string{"foo"}, false, 0, true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package sampling

import (
"testing"

"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/ptrace"
"testing"
)

func TestSetAttrOnScopeSpans_Empty(t *testing.T) {
Expand All @@ -17,7 +21,6 @@ func TestSetAttrOnScopeSpans_Empty(t *testing.T) {
}

func TestSetAttrOnScopeSpans_Many(t *testing.T) {

assertAttrExists := func(t *testing.T, attrs pcommon.Map, key string, value string) {
v, ok := attrs.Get(key)
assert.True(t, ok)
Expand Down
2 changes: 1 addition & 1 deletion processor/tailsamplingprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ type tailSamplingSpanProcessor struct {
nonSampledIDCache cache.Cache[bool]
deleteChan chan pcommon.TraceID
numTracesOnMap *atomic.Uint64
recordPolicy bool
recordPolicy bool
}

// spanAndScope a structure for holding information about span and its instrumentation scope.
Expand Down
3 changes: 2 additions & 1 deletion processor/tailsamplingprocessor/processor_decisions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ package tailsamplingprocessor

import (
"context"
"github.com/stretchr/testify/assert"
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer/consumertest"
Expand Down

0 comments on commit 5e89a44

Please sign in to comment.