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/deltatocumulative]: mdatagen telemetry #33981

Merged
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
14 changes: 2 additions & 12 deletions processor/deltatocumulativeprocessor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,5 @@ There is no further configuration required. All delta samples are converted to c

## Troubleshooting

The following metrics are recorded when [telemetry is
enabled](https://opentelemetry.io/docs/collector/configuration/#telemetry):

| Name | Description | Unit |
|------------------------------------------|---------------------------------------------------------------------------------------|---------------|
| `deltatocumulative.streams.tracked` | Number of streams currently tracked by the aggregation state | `{stream}` |
| `deltatocumulative.streams.limit` | Upper limit of tracked streams | `{stream}` |
| `deltatocumulative.streams.evicted` | Number of streams removed from tracking to ingest newer streams | `{stream}` |
| `deltatocumulative.streams.max_stale` | Duration without new samples after which streams are dropped | `second` |
| `deltatocumulative.datapoints.processed` | Total number of datapoints processed, whether successful or not | `{datapoint}` |
| `deltatocumulative.datapoints.dropped` | Faulty datapoints that were dropped due to the reason given in the `reason` attribute | `{datapoint}` |
| `deltatocumulative.gaps.length` | Total length of all gaps in the streams, which occur e.g. due to lost in transit | `second` |
When [Telemetry is
enabled](https://opentelemetry.io/docs/collector/configuration/#telemetry), this component exports [several metrics](./documentation.md).
63 changes: 63 additions & 0 deletions processor/deltatocumulativeprocessor/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)

# deltatocumulative

## Internal Telemetry

The following telemetry is emitted by this component.

### otelcol_deltatocumulative.datapoints.dropped

number of datapoints dropped due to given 'reason'

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

### otelcol_deltatocumulative.datapoints.processed

number of datapoints processed

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

### otelcol_deltatocumulative.gaps.length

total duration where data was expected but not received

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| s | Sum | Int | true |

### otelcol_deltatocumulative.streams.evicted

number of streams evicted

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

### otelcol_deltatocumulative.streams.limit

upper limit of tracked streams

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

### otelcol_deltatocumulative.streams.max_stale

duration after which streams inactive streams are dropped

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

### otelcol_deltatocumulative.streams.tracked

number of streams tracked

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| {dps} | Sum | Int | false |
8 changes: 6 additions & 2 deletions processor/deltatocumulativeprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ func createMetricsProcessor(_ context.Context, set processor.Settings, cfg compo
return nil, fmt.Errorf("configuration parsing error")
}

meter := metadata.Meter(set.TelemetrySettings)
return newProcessor(pcfg, set.Logger, meter, next), nil
telb, err := metadata.NewTelemetryBuilder(set.TelemetrySettings)
if err != nil {
return nil, err
}

return newProcessor(pcfg, set.Logger, telb, next), nil
}

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

5 changes: 2 additions & 3 deletions processor/deltatocumulativeprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest v0.105.0
github.com/stretchr/testify v1.9.0
go.opentelemetry.io/collector/component v0.105.1-0.20240717163034-43ed6184f9fe
go.opentelemetry.io/collector/config/configtelemetry v0.105.1-0.20240717163034-43ed6184f9fe
go.opentelemetry.io/collector/confmap v0.105.1-0.20240717163034-43ed6184f9fe
go.opentelemetry.io/collector/consumer v0.105.1-0.20240717163034-43ed6184f9fe
go.opentelemetry.io/collector/pdata v1.12.1-0.20240716231837-5753a58f712b
go.opentelemetry.io/collector/processor v0.105.1-0.20240717163034-43ed6184f9fe
go.opentelemetry.io/otel v1.28.0
go.opentelemetry.io/otel/metric v1.28.0
go.opentelemetry.io/otel/sdk/metric v1.28.0
go.opentelemetry.io/otel/trace v1.28.0
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.27.0
Expand Down Expand Up @@ -43,15 +45,12 @@ require (
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
go.opentelemetry.io/collector v0.105.1-0.20240717163034-43ed6184f9fe // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.105.1-0.20240717163034-43ed6184f9fe // indirect
go.opentelemetry.io/collector/featuregate v1.12.1-0.20240716231837-5753a58f712b // indirect
go.opentelemetry.io/collector/internal/globalgates v0.105.1-0.20240717163034-43ed6184f9fe // indirect
go.opentelemetry.io/collector/pdata/pprofile v0.105.1-0.20240717163034-43ed6184f9fe // indirect
go.opentelemetry.io/collector/pdata/testdata v0.105.1-0.20240717163034-43ed6184f9fe // indirect
go.opentelemetry.io/otel/exporters/prometheus v0.50.0 // indirect
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions processor/deltatocumulativeprocessor/go.sum

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.

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

Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import (
"testing"

"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/otel/metric/noop"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics/identity"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/data"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/delta"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/streams"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/telemetry"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor/internal/testdata/random"
Expand Down Expand Up @@ -112,10 +114,13 @@ func TestFaults(t *testing.T) {
},
}

telb, err := metadata.NewTelemetryBuilder(component.TelemetrySettings{MeterProvider: noop.NewMeterProvider()})
require.NoError(t, err)

for _, c := range cases {
t.Run(c.Name, func(t *testing.T) {
id, dp := sum.Stream()
tel := telemetry.New(noop.Meter{})
tel := telemetry.New(telb)

dps := c.Map
if dps == nil {
Expand Down
Loading