Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with opentelemetry endpoint that contains a path #1249

Open
Darkle opened this issue Feb 24, 2024 · 2 comments
Open

Issue with opentelemetry endpoint that contains a path #1249

Darkle opened this issue Feb 24, 2024 · 2 comments

Comments

@Darkle
Copy link

Darkle commented Feb 24, 2024

Hi, I am trying to set up imgproxy to send opentelemetry data to Seq. I have Seq running on localhost on port 5341, and the Seq docs say the opentelemetry http ingestion path is /ingest/otlp/v1/logs.

When I set IMGPROXY_OPEN_TELEMETRY_ENDPOINT=localhost:5341/ingest/otlp/ when running imgproxy, i get the following error message:

FATAL   [2024-02-24T03:17:43Z] Can't connect to OpenTelemetry collector: parse "http://localhost:5341%2Fingest%2Fotlp%2Fv1%2Flogs/v1/metrics": invalid port ":5341%2Fingest%2Fotlp%2Fv1%2Flogs" after host 

It looks like imgproxy is trying to url-encode the path, which makes things break.

Here is the full docker command that I am using: docker run --name imgproxy -d --restart unless-stopped -v /foo/images:/images -e IMGPROXY_LOCAL_FILESYSTEM_ROOT="/images" -e IMGPROXY_OPEN_TELEMETRY_ENDPOINT=localhost:5341/ingest/otlp/v1/logs -e IMGPROXY_OPEN_TELEMETRY_PROTOCOL=http -e IMGPROXY_OPEN_TELEMETRY_ENABLE_METRICS=true -p 3006:8080 darthsim/imgproxy:v3.22.0

@DarthSim
Copy link
Member

Hey @Darkle!

The IMGPROXY_OPEN_TELEMETRY_ENDPOINT format is host:port. I guess, we need to revise the OTel configuration to add support for custom endpoint paths

@DarthSim
Copy link
Member

I revised the OpenTelemetry config in the latest build to use standard env vars when possible (have been going to do so for a long time): https://docs.imgproxy.net/latest/monitoring/open_telemetry.

Take note that imgproxy doesn't support sending logs to OpenTelemetry.

However, if you want to send request traces to Seq, you can use the latest build and set the following env vars:

  • IMGPROXY_OPEN_TELEMETRY_ENABLE=1
  • OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
  • OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:5341/ingest/otlp" (/v1/traces will be added automatically)

Seq doesn't support collecting OTel metrics, so IMGPROXY_OPEN_TELEMETRY_ENABLE_METRICS will not work with it.

I'm not sure if the X-Seq-ApiKey header is mandatory for Seq, but if it is, set OTEL_EXPORTER_OTLP_HEADERS="X-Seq-ApiKey=your_api_key"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants