Skip to content

Commit

Permalink
Set OTel metrics telemetry level to "detailed". (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev authored May 8, 2024
1 parent f0283e0 commit bcb1d29
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ information.

## Debug metrics

* `processor_batch_batch_send_size_bytes` (histogram): Number of bytes in batch that was sent.
* `processor_batch_batch_send_size_ratio` (histogram): Number of units in the batch.
* `processor_batch_metadata_cardinality_ratio` (gauge): Number of distinct metadata value combinations being processed.
* `processor_batch_timeout_trigger_send_ratio_total` (counter): Number of times the batch was sent due to a timeout trigger.
Expand Down
2 changes: 2 additions & 0 deletions internal/component/otelcol/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/grafana/alloy/syntax"
"github.com/prometheus/client_golang/prometheus"
otelcomponent "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configtelemetry"
otelextension "go.opentelemetry.io/collector/extension"
sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus"
"go.opentelemetry.io/otel/sdk/metric"
Expand Down Expand Up @@ -140,6 +141,7 @@ func (a *Auth) Update(args component.Arguments) error {

TracerProvider: a.opts.Tracer,
MeterProvider: metric.NewMeterProvider(metric.WithReader(promExporter)),
MetricsLevel: configtelemetry.LevelDetailed,

ReportStatus: func(*otelcomponent.StatusEvent) {},
},
Expand Down
2 changes: 2 additions & 0 deletions internal/component/otelcol/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/grafana/alloy/internal/util/zapadapter"
"github.com/prometheus/client_golang/prometheus"
otelcomponent "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configtelemetry"
otelconnector "go.opentelemetry.io/collector/connector"
otelextension "go.opentelemetry.io/collector/extension"
sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus"
Expand Down Expand Up @@ -149,6 +150,7 @@ func (p *Connector) Update(args component.Arguments) error {

TracerProvider: p.opts.Tracer,
MeterProvider: metric.NewMeterProvider(metric.WithReader(promExporter)),
MetricsLevel: configtelemetry.LevelDetailed,

ReportStatus: func(*otelcomponent.StatusEvent) {},
},
Expand Down
2 changes: 2 additions & 0 deletions internal/component/otelcol/exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/grafana/alloy/internal/util/zapadapter"
"github.com/prometheus/client_golang/prometheus"
otelcomponent "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configtelemetry"
otelexporter "go.opentelemetry.io/collector/exporter"
otelextension "go.opentelemetry.io/collector/extension"
sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus"
Expand Down Expand Up @@ -173,6 +174,7 @@ func (e *Exporter) Update(args component.Arguments) error {

TracerProvider: e.opts.Tracer,
MeterProvider: metric.NewMeterProvider(metricOpts...),
MetricsLevel: configtelemetry.LevelDetailed,

ReportStatus: func(*otelcomponent.StatusEvent) {},
},
Expand Down
2 changes: 2 additions & 0 deletions internal/component/otelcol/extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/grafana/alloy/internal/util/zapadapter"
"github.com/prometheus/client_golang/prometheus"
otelcomponent "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configtelemetry"
otelextension "go.opentelemetry.io/collector/extension"
sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus"
"go.opentelemetry.io/otel/sdk/metric"
Expand Down Expand Up @@ -116,6 +117,7 @@ func (e *Extension) Update(args component.Arguments) error {

TracerProvider: e.opts.Tracer,
MeterProvider: metric.NewMeterProvider(metric.WithReader(promExporter)),
MetricsLevel: configtelemetry.LevelDetailed,

ReportStatus: func(*otelcomponent.StatusEvent) {},
},
Expand Down
2 changes: 2 additions & 0 deletions internal/component/otelcol/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/grafana/alloy/internal/util/zapadapter"
"github.com/prometheus/client_golang/prometheus"
otelcomponent "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configtelemetry"
otelextension "go.opentelemetry.io/collector/extension"
otelprocessor "go.opentelemetry.io/collector/processor"
sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus"
Expand Down Expand Up @@ -135,6 +136,7 @@ func (p *Processor) Update(args component.Arguments) error {

TracerProvider: p.opts.Tracer,
MeterProvider: metric.NewMeterProvider(metric.WithReader(promExporter)),
MetricsLevel: configtelemetry.LevelDetailed,

ReportStatus: func(*otelcomponent.StatusEvent) {},
},
Expand Down
2 changes: 2 additions & 0 deletions internal/component/otelcol/receiver/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/storage"
otelcomponent "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configtelemetry"
otelreceiver "go.opentelemetry.io/collector/receiver"
metricNoop "go.opentelemetry.io/otel/metric/noop"
traceNoop "go.opentelemetry.io/otel/trace/noop"
Expand Down Expand Up @@ -126,6 +127,7 @@ func (c *Component) Update(newConfig component.Arguments) error {
// TODO(tpaschalis): expose tracing and logging statistics.
TracerProvider: traceNoop.NewTracerProvider(),
MeterProvider: metricNoop.NewMeterProvider(),
MetricsLevel: configtelemetry.LevelDetailed,

ReportStatus: func(*otelcomponent.StatusEvent) {},
},
Expand Down
2 changes: 2 additions & 0 deletions internal/component/otelcol/receiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/grafana/alloy/internal/util/zapadapter"
"github.com/prometheus/client_golang/prometheus"
otelcomponent "go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configtelemetry"
"go.opentelemetry.io/collector/extension"
otelreceiver "go.opentelemetry.io/collector/receiver"
sdkprometheus "go.opentelemetry.io/otel/exporters/prometheus"
Expand Down Expand Up @@ -133,6 +134,7 @@ func (r *Receiver) Update(args component.Arguments) error {

TracerProvider: r.opts.Tracer,
MeterProvider: metric.NewMeterProvider(metricOpts...),
MetricsLevel: configtelemetry.LevelDetailed,

ReportStatus: func(*otelcomponent.StatusEvent) {},
},
Expand Down

0 comments on commit bcb1d29

Please sign in to comment.