Skip to content

Commit

Permalink
remove span created count
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Jan 30, 2025
1 parent 72a6aab commit 1541be9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
8 changes: 0 additions & 8 deletions sdk/trace/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ type TracerProvider struct {
spanLimits SpanLimits
resource *resource.Resource

spanCreatedCount metric.Int64Counter
spanEndedCount metric.Int64Counter
spanLiveCount metric.Int64UpDownCounter
sampledAttributes metric.MeasurementOption
Expand Down Expand Up @@ -156,13 +155,6 @@ func (p *TracerProvider) configureSelfObservability() {
p.sampledAttributes = metric.WithAttributes(componentNameAttr, attribute.String("otel.span.is_sampled", "true"))
p.notSampledAttributes = metric.WithAttributes(componentNameAttr, attribute.String("otel.span.is_sampled", "false"))
var err error
p.spanCreatedCount, err = meter.Int64Counter("otel.sdk.span.created_count",
metric.WithUnit("{span}"),
metric.WithDescription("The number of spans which have been created."),
)
if err != nil {
otel.Handle(err)
}
p.spanEndedCount, err = meter.Int64Counter("otel.sdk.span.ended_count",
metric.WithUnit("{span}"),
metric.WithDescription("The number of created spans for which the end operation was called."),
Expand Down
2 changes: 0 additions & 2 deletions sdk/trace/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,9 @@ func (tr *tracer) newSpan(ctx context.Context, name string, config *trace.SpanCo
if isSampled(samplingResult) {
scc.TraceFlags = psc.TraceFlags() | trace.FlagsSampled
tr.provider.spanLiveCount.Add(ctx, 1, tr.provider.sampledAttributes)
tr.provider.spanCreatedCount.Add(ctx, 1, tr.provider.sampledAttributes)
} else {
scc.TraceFlags = psc.TraceFlags() &^ trace.FlagsSampled
tr.provider.spanLiveCount.Add(ctx, 1, tr.provider.notSampledAttributes)
tr.provider.spanCreatedCount.Add(ctx, 1, tr.provider.notSampledAttributes)
}
sc := trace.NewSpanContext(scc)

Expand Down

0 comments on commit 1541be9

Please sign in to comment.