open-telemetry / opentelemetry-collector-contrib

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

Sentry Exporter - Issues are not associated with the correct environment #35649

Open HarryJRob opened 1 month ago

HarryJRob commented 1 month ago

Component(s)

exporter/sentry

What happened?

Description

Hi all, I am trying to connect a instance of Ory Kratos which produces telemetry in otel format to a self hosted sentry instance using a custom otel collector built using the otel collector builder v0.110.0.

The custom collector is using v0.110.0 of the sentryexporter.

Thank you for your time maintaining this code and any help you can provide!

Steps to Reproduce

  1. Run a collector using v0.110.0 of the sentryexporter

  2. Send a otel trace generated by Ory kratos to the collector. An example is given below

    curl -X "POST" http://localhost:4318/v1/traces -H "Content-Type: application/json" -d @trace.json -i

    trace.json trace.json

  3. Observe that the collector does not associate the issue in sentry with the correct environment Sentry transaction is associated with the correct environment: image image

Issues as part of the transaction are not associated with the correct environment: image

Expected Result

The issues in sentry are associated with the environment specified in the otel collector configuration

Actual Result

The issues in sentry are not associated with any environment

Collector version

v0.110.0

Environment information

Environment

OS: Alpine Linux Compiler(if manually compiled): go 1.23.2

OpenTelemetry Collector configuration

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

processors:
  batch:

exporters:
  debug:
    verbosity: detailed
  sentry:
    environment: "Development"
    dsn: <sentry-url>

extensions:
  health_check:
    endpoint: 0.0.0.0:13133
  pprof:
    endpoint: 0.0.0.0:55679
  zpages:
    endpoint: 0.0.0.0:1777

service:
  extensions: [health_check, pprof, zpages]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [sentry]

Log output

None

Additional context

This might be an issue with how Ory is using the otel protocol but unfortunately I'm not experienced enough with tracing to know whether this is the case.

From what I've understood from the sentryexporters source code perhaps this line should also include a mapping of the environment from the sentryexporter config?

github-actions[bot] commented 1 month ago

Pinging code owners: