Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[processor/tailsampling] Move from OpenCensus to OTel API #33426

Merged
merged 4 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .chloggen/jpkroehling_migrate-metrics-for-tailsampling.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'enhancement'

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: processor/tailsampling

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Migrates internal telemetry to OpenTelemetry SDK via mdatagen

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [31581]

subtext: The metric names and their properties, such as bucket boundaries for histograms, were kept like before, to keep backwards compatibility.
95 changes: 95 additions & 0 deletions processor/tailsamplingprocessor/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)

# tail_sampling

## Internal Telemetry

The following telemetry is emitted by this component.

### processor_tail_sampling_count_spans_sampled

Count of spans that were sampled or not per sampling policy

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {spans} | Sum | Int | true |

### processor_tail_sampling_count_traces_sampled

Count of traces that were sampled or not per sampling policy

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {traces} | Sum | Int | true |

### processor_tail_sampling_global_count_traces_sampled

Global count of traces that were sampled or not by at least one policy

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {traces} | Sum | Int | true |

### processor_tail_sampling_new_trace_id_received

Counts the arrival of new traces

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {traces} | Sum | Int | true |

### processor_tail_sampling_sampling_decision_latency

Latency (in microseconds) of a given sampling policy

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| µs | Histogram | Int |

### processor_tail_sampling_sampling_decision_timer_latency

Latency (in microseconds) of each run of the sampling decision timer

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| µs | Histogram | Int |

### processor_tail_sampling_sampling_late_span_age

Time (in seconds) from the sampling decision was taken and the arrival of a late span

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| s | Histogram | Int |

### processor_tail_sampling_sampling_policy_evaluation_error

Count of sampling policy evaluation errors

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {errors} | Sum | Int | true |

### processor_tail_sampling_sampling_trace_dropped_too_early

Count of traces that needed to be dropped before the configured wait time

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {traces} | Sum | Int | true |

### processor_tail_sampling_sampling_trace_removal_age

Time (in seconds) from arrival of a new trace until its removal from memory

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| s | Histogram | Int |

### processor_tail_sampling_sampling_traces_on_memory

Tracks the number of traces current on memory

| Unit | Metric Type | Value Type |
| ---- | ----------- | ---------- |
| {traces} | Gauge | Int |

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions processor/tailsamplingprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.102.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl v0.102.0
github.com/stretchr/testify v1.9.0
go.opencensus.io v0.24.0
go.opentelemetry.io/collector/component v0.102.2-0.20240606174409-6888f8f7a45f
go.opentelemetry.io/collector/config/configtelemetry v0.102.2-0.20240606174409-6888f8f7a45f
go.opentelemetry.io/collector/confmap v0.102.2-0.20240606174409-6888f8f7a45f
go.opentelemetry.io/collector/consumer v0.102.2-0.20240606174409-6888f8f7a45f
go.opentelemetry.io/collector/featuregate v1.9.1-0.20240606174409-6888f8f7a45f
go.opentelemetry.io/collector/pdata v1.9.1-0.20240606174409-6888f8f7a45f
go.opentelemetry.io/collector/processor v0.102.2-0.20240606174409-6888f8f7a45f
go.opentelemetry.io/otel v1.27.0
go.opentelemetry.io/otel/metric v1.27.0
go.opentelemetry.io/otel/sdk/metric v1.27.0
go.opentelemetry.io/otel/trace v1.27.0
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.27.0
Expand All @@ -28,7 +29,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/gobwas/glob v0.2.3 // indirect
Expand All @@ -49,12 +50,9 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.54.0 // indirect
github.com/prometheus/procfs v0.15.0 // indirect
go.opentelemetry.io/collector v0.102.2-0.20240606174409-6888f8f7a45f // indirect
go.opentelemetry.io/collector/pdata/testdata v0.102.2-0.20240606174409-6888f8f7a45f // indirect
go.opentelemetry.io/otel v1.27.0 // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.49.0 // indirect
go.opentelemetry.io/otel/sdk v1.27.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.27.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/net v0.25.0 // indirect
Expand Down
Loading
Loading