open-telemetry / opentelemetry-collector-contrib

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

Otel exporter not working with Elasticsearch #34129

Open harshalschaudhari opened 3 months ago

harshalschaudhari commented 3 months ago

Component(s)

exporter/elasticsearch

What happened?

Description

The application generates traces that can be viewed in Jaeger. I attempted to configure the Otel collector to send these traces to Elasticsearch using various combinations within a Docker Compose setup, but encountered the following error:

"Error decoding 'exporters': Unknown type 'elasticsearch' for ID 'elasticsearch/trace' (valid values: [zipkin nop file opencensus prometheus prometheusremotewrite debug logging otlp otlphttp kafka])."

Steps to Reproduce

I have a Docker Compose application set up with Jaeger, Elasticsearch, and an OtelCollector. I've confirmed that all processes are functioning correctly except for the OtelCollector.

Below is the OtelCollector configuration I've used:

`receivers: otlp: protocols: grpc: http:

processors: batch:

exporters:
elasticsearch/trace: endpoints:

service: pipelines: traces: receivers: [otlp] processors: [batch] exporters: [elasticsearch/trace]`

Expected Result

Elasticsearch index shows the traces in respective index.

Actual Result

Otel Collector Container stopped due to error "Error decoding 'exporters': Unknown type 'elasticsearch' for ID 'elasticsearch/trace' (valid values: [zipkin nop file opencensus prometheus prometheusremotewrite debug logging otlp otlphttp kafka])."

Collector version

0.104.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

receivers:
  otlp:
    protocols:
      grpc:
      http:

processors:
  batch:

exporters:  
  elasticsearch/trace:
    endpoints:
      - "http://elasticsearch:9200/"  # Elasticsearch service URL
    trace_index: "otel-traces"   # Index for traces

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [elasticsearch/trace]

Log output

No response

Additional context

No response

github-actions[bot] commented 3 months ago

Pinging code owners:

crobert-1 commented 3 months ago

You need to reference the contrib docker image in your docker-compose.yaml file. Currently, it looks like it's referencing the core distribution, which only has a subset of exporters (and components in general). This will be the docker image to reference.

github-actions[bot] commented 1 month ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.