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

* error decoding 'exporters': unknown type: "datadog" for id: "datadog" (valid values: [file kafka prometheus prometheusremotewrite logging otlp otlphttp debug opencensus zipkin]) #30791

Closed zendesk-shweta closed 8 months ago

zendesk-shweta commented 8 months ago

Component(s)

No response

Describe the issue you're reporting

I am using this binary otelcol-contrib_0.93.0_darwin_amd64.tar.gz to create docker image of otel collector. Image is built and pushe dto ECR successfully , however it gives this error " * error decoding 'exporters': unknown type: "datadog" for id: "datadog" (valid values: [file kafka prometheus prometheusremotewrite logging otlp otlphttp debug opencensus zipkin])" when i tried to add datadog as exporter in config file. Below is my datadog file , not sure what i am missing on :

extensions: memory_ballast: size_mib: 128 zpages: endpoint: localhost:55679

receivers: otlp: protocols: grpc: endpoint: localhost:4317 http: endpoint: localhost:4318

processors: batch: memory_limiter:

75% of maximum memory up to 2G

limit_mib: 256
# 25% of limit up to 2G
spike_limit_mib: 200
check_interval: 5s

exporters: debug: verbosity: detailed datadog: api: key: " "

service: pipelines: traces: receivers: [otlp] processors: [memory_limiter, batch] exporters: [debug, datadog] metrics: receivers: [otlp] processors: [memory_limiter, batch] exporters: [debug, datadog] logs: receivers: [otlp] processors: [memory_limiter, batch] exporters: [debug, datadog]

extensions: [memory_ballast, zpages]

crobert-1 commented 8 months ago

Hello @zendesk-shweta, it looks like when creating your docker image only a subset of exporters are being included in the image. Can you share how you're creating your docker image from the downloaded tar file?

Is there a reason why you're creating your own instead of using the published image?

zendesk-shweta commented 8 months ago

This is my docker file. We need to do some customisation so we are trying to build image from binary. Kindly suggest what is missing in my docker file while creating the image. #################### FROM ubuntu:22.04

WORKDIR /app RUN apt update && apt install curl tar \ && curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.91.0/otelcol_0.91.0_linux_amd64.tar.gz \ && tar -xvf otelcol_0.91.0_linux_amd64.tar.gz \ && rm otelcol_0.91.0_linux_amd64.tar.gz

COPY ./otelcol .

RUN chmod a+x ./otelcol COPY ./config.yaml . ENTRYPOINT ["/app/otelcol", "--config", "/app/config.yaml"]

CMD ["./otelcol", "--config", "config.yaml"]

crobert-1 commented 8 months ago

Thanks for sharing your dockerfile! It looks like the problem is this:

curl --proto '=https' --tlsv1.2 -fOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.91.0/otelcol_0.91.0_linux_amd64.tar.gz
&& tar -xvf otelcol_0.91.0_linux_amd64.tar.gz
&& rm otelcol_0.91.0_linux_amd64.tar.gz

This is actually downloading the core distribution of the OpenTelemetry Collector, rather than contrib. If you update this link to https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.91.0/otelcol-contrib_0.91.0_linux_amd64.tar.gz, and update your following commands to match the different file name, the exporter should be available. 👍