Skip to content

Commit

Permalink
[chore] migrate kafkareceiver away from opencensus (#33662)
Browse files Browse the repository at this point in the history
Use mdatagen generated metrics instead. Fixes #30733

---------

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten authored Jun 21, 2024
1 parent 88f8680 commit 326c7e8
Show file tree
Hide file tree
Showing 14 changed files with 837 additions and 497 deletions.
71 changes: 71 additions & 0 deletions receiver/kafkareceiver/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[comment]: <> (Code generated by mdatagen. DO NOT EDIT.)

# kafka

## Internal Telemetry

The following telemetry is emitted by this component.

### kafka_receiver_current_offset

Current message offset

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

### kafka_receiver_messages

Number of received messages

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

### kafka_receiver_offset_lag

Current offset lag

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

### kafka_receiver_partition_close

Number of finished partitions

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

### kafka_receiver_partition_start

Number of started partitions

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

### kafka_receiver_unmarshal_failed_log_records

Number of log records failed to be unmarshaled

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

### kafka_receiver_unmarshal_failed_metric_points

Number of metric points failed to be unmarshaled

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

### kafka_receiver_unmarshal_failed_spans

Number of spans failed to be unmarshaled

| Unit | Metric Type | Value Type | Monotonic |
| ---- | ----------- | ---------- | --------- |
| 1 | Sum | Int | true |
3 changes: 0 additions & 3 deletions receiver/kafkareceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"strings"
"time"

"go.opencensus.io/stats/view"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/receiver"
Expand Down Expand Up @@ -75,8 +74,6 @@ func withLogsUnmarshalers(logsUnmarshalers ...LogsUnmarshaler) FactoryOption {

// NewFactory creates Kafka receiver factory.
func NewFactory(options ...FactoryOption) receiver.Factory {
_ = view.Register(metricViews()...)

f := &kafkaReceiverFactory{
tracesUnmarshalers: map[string]TracesUnmarshaler{},
metricsUnmarshalers: map[string]MetricsUnmarshaler{},
Expand Down
76 changes: 76 additions & 0 deletions receiver/kafkareceiver/generated_component_telemetry_test.go

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

2 changes: 1 addition & 1 deletion receiver/kafkareceiver/generated_package_test.go

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

7 changes: 3 additions & 4 deletions receiver/kafkareceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/zipkin v0.103.0
github.com/openzipkin/zipkin-go v0.4.3
github.com/stretchr/testify v1.9.0
go.opencensus.io v0.24.0
go.opentelemetry.io/collector/component v0.103.0
go.opentelemetry.io/collector/config/configtelemetry v0.103.0
go.opentelemetry.io/collector/config/configtls v0.103.0
go.opentelemetry.io/collector/confmap v0.103.0
go.opentelemetry.io/collector/consumer v0.103.0
go.opentelemetry.io/collector/pdata v1.10.0
go.opentelemetry.io/collector/pdata/testdata v0.103.0
go.opentelemetry.io/collector/receiver v0.103.0
go.opentelemetry.io/collector/semconv v0.103.0
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 Down Expand Up @@ -80,14 +82,11 @@ require (
go.opentelemetry.io/collector v0.103.0 // indirect
go.opentelemetry.io/collector/config/configopaque v1.10.0 // indirect
go.opentelemetry.io/collector/config/configretry v0.103.0 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.103.0 // indirect
go.opentelemetry.io/collector/exporter v0.103.0 // indirect
go.opentelemetry.io/collector/extension v0.103.0 // indirect
go.opentelemetry.io/collector/featuregate v1.10.0 // 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/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
Expand Down
Loading

0 comments on commit 326c7e8

Please sign in to comment.