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

make OTLPExporterError less cryptic by including the response body #5201

Closed
glenjamin opened this issue Nov 25, 2024 · 1 comment · Fixed by #5204
Closed

make OTLPExporterError less cryptic by including the response body #5201

glenjamin opened this issue Nov 25, 2024 · 1 comment · Fixed by #5204
Assignees
Labels
pkg:otlp-exporter-base triage:accepted This feature has been accepted type:feature A feature with no sub-issues to address

Comments

@glenjamin
Copy link

Is your feature request related to a problem? Please describe.

While configuring telemetry using the OTLP format, I received the following error:

Error in reporter OTLPExporterError: Bad Request
    at IncomingMessage.<anonymous> (.../node_modules/@opentelemetry/otlp-exporter-base/src/platform/node/http-transport-utils.ts:75:23)
    at IncomingMessage.emit (node:events:530:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  data: undefined,
  code: 400
}

This wasn't very helpful, but I opened up the node_modules source and included responseData.toString(), and then instead I got this output

Error in reporter OTLPExporterError: Bad Request
    at IncomingMessage.<anonymous> (/Users/glen/Development/Geckoboard/polecat/shakespeare/node_modules/@opentelemetry/otlp-exporter-base/src/platform/node/http-transport-utils.ts:75:23)
    at IncomingMessage.emit (node:events:530:35)
    at endReadableNT (node:internal/streams/readable:1696:12)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  data: '{"error":"invalid OTLP endpoint - should you be sending to /v1/traces?, see API docs https://docs.honeycomb.io/"}\n',
  code: 400
}

Describe the solution you'd like

I'd like the exporter error to include any available context about what the error might be - but especially the response body from the remote host

Describe alternatives you've considered

My alternative was enabling debug logging at various levels, but this wasn't especially helpful as everything is encrypted.

Additional context

n/a

@pichlermarc
Copy link
Member

Hi @glenjamin - thanks for reaching out. That's a great idea, let's do it 🙌
I opened #5204 to address this.

@pichlermarc pichlermarc added type:feature A feature with no sub-issues to address pkg:otlp-exporter-base and removed feature-request labels Nov 26, 2024
@pichlermarc pichlermarc self-assigned this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:otlp-exporter-base triage:accepted This feature has been accepted type:feature A feature with no sub-issues to address
Projects
None yet
2 participants