open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.02k stars 2.33k forks source link

unknown type: "bearertokenauth" #31540

Closed jinjiaw closed 7 months ago

jinjiaw commented 7 months ago

Component(s)

extension/bearertokenauth

What happened?

Description

Hi folks,

I am using otel/opentelemetry-collector:0.95.0 and following https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/bearertokenauthextension to use bearertokenauth as the authenticator for otlp/withauth exporter. However, following error are emitted from opentelemetry-collector container log. I am not sure why i only got four valid extensions - [zpages memory_ballast health_check pprof]. Suppose everything (including my desired bearertokenauth) defined in https://github.com/open-telemetry/opentelemetry-collector-releases/blob/v0.95.0/distributions/otelcol-contrib/manifest.yaml should be on the valid values list?

* error decoding 'extensions': unknown type: "bearertokenauth" for id: "bearertokenauth" (valid values: [zpages memory_ballast health_check pprof])
2024/03/04 06:49:41 collector server run finished with error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:

Steps to Reproduce

Expected Result

config with bearertokenauth extension should be allowed.

Actual Result

opentelemetry-collector kept restarting with above mentioned error.

Collector version

0.95.0

Environment information

Environment

OS: Ubuntu 22.04 Compiler(if manually compiled): N/A

OpenTelemetry Collector configuration

---
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: otel-collector:4317
      http:
        endpoint: otel-collector:4318
        cors:
          allowed_origins: ["*"]
          allowed_headers: ["*"]

exporters:
  prometheus:
    endpoint: "0.0.0.0:8889"
    const_labels:
      label1: value1

  logging:

  otlp/withauth:
    endpoint: https://<grpc-endpoint>:443
    auth:
      authenticator: bearertokenauth

processors:
  batch:

extensions:
  bearertokenauth:
    token: "<api-token>"
  health_check:
  pprof:
    endpoint: :1888
  zpages:
    endpoint: :55679

service:
  extensions: [bearertokenauth, pprof, zpages, health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging, otlp/withauth]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [logging, prometheus]

Log output

* error decoding 'extensions': unknown type: "bearertokenauth" for id: "bearertokenauth" (valid values: [zpages memory_ballast health_check pprof])
2024/03/04 06:49:37 collector server run finished with error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:

* error decoding 'extensions': unknown type: "bearertokenauth" for id: "bearertokenauth" (valid values: [zpages memory_ballast health_check pprof])
Error: failed to get config: cannot unmarshal the configuration: 1 error(s) decoding:

Additional context

No response

github-actions[bot] commented 7 months ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

jpkrohling commented 7 months ago
  • error decoding 'extensions': unknown type: "bearertokenauth" for id: "bearertokenauth" (valid values: [zpages memory_ballast health_check pprof])

You have to use the contrib distribution, or build your own distribution using ocb.