Skip to content

Commit

Permalink
fix: fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamir David authored and Tamir David committed Jun 26, 2024
1 parent 547451d commit 6d587ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion collector/processors/odigossamplingprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This processor samples traces based on the following supported rules:
"service": "frontend"
```
- threshold: The maximum allowable trace duration in milliseconds. Traces with a duration less than this value will be deleted.
- endpoint: The specific HTTP route to match for sampling. Only traces with this route will be considered.
- endpoint: The specific HTTP route prefix to match for sampling. Only traces with routes starting with this prefix will be considered. For example, configuring /buy will also match /buy/product.
- service: The name of the service for which the rule applies. Only traces from this service will be considered.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/ptrace"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
)

type TraceLatencyRule struct {
Expand Down Expand Up @@ -38,7 +39,7 @@ func (tlr *TraceLatencyRule) DropTrace(td ptrace.Traces) bool {

// Check if the service matches
for r := 0; r < resources.Len(); r++ {
serviceAttr, _ := resources.At(r).Resource().Attributes().Get("service.name")
serviceAttr, _ := resources.At(r).Resource().Attributes().Get(string(semconv.ServiceNameKey))
if serviceAttr.AsString() == tlr.Service {
serviceFound = true
}
Expand Down
3 changes: 1 addition & 2 deletions collector/processors/odigossamplingprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package odigossamplingprocessor

import (
"context"
"fmt"

"github.com/open-telemetry/opentelemetry-collector-contrib/odigos/processor/odigossamplingprocessor/internal/sampling"
"go.opentelemetry.io/collector/pdata/ptrace"
Expand All @@ -25,7 +24,7 @@ func (sp *samplingProcessor) processTraces(ctx context.Context, td ptrace.Traces
return td, nil
}
default:
fmt.Printf("Unknown rule details type for rule %s\n", rule.Name)
sp.logger.Error("Unknown rule details type", zap.String("rule", rule.Name))
}
}
return td, nil
Expand Down

0 comments on commit 6d587ce

Please sign in to comment.