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

unexpected trailing / appended to endpoint configured via OTEL_EXPORTER_OTLP_TRACES_ENDPOINT #3269

Closed
codeboten opened this issue Sep 21, 2022 · 1 comment · Fixed by #3274
Assignees
Labels
bug Something isn't working priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect spec-noncompliant An existing feature incorrectly or incompletely implements the OTel spec. May or may not be a bug

Comments

@codeboten
Copy link

What happened?

Steps to Reproduce

Using the example code from opentelemetry.io, I tried configuring an endpoint to send data to and was receiving 404's from my backend. After digging into it, the data was being sent to https://endpoint/something/ instead of https://endpoint/something.

Expected Result

Traces sent to https://endpoint/something

Actual Result

Traces sent to https://endpoint/something/ resulting in a 404

Additional Details

Tracked the code that does the appending here:

if (!url.includes(path) && !url.endsWith('/')) {
url = url + '/';
}
return url;

Note that this problem does not occur if i configure the endpoint in the code instead.

OpenTelemetry Setup Code

const opentelemetry = require("@opentelemetry/sdk-node");
const { getNodeAutoInstrumentations } = require("@opentelemetry/auto-instrumentations-node");
const { diag, DiagConsoleLogger, DiagLogLevel } = require('@opentelemetry/api');
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
const {
  OTLPTraceExporter,
} = require("@opentelemetry/exporter-trace-otlp-http");

const sdk = new opentelemetry.NodeSDK({
  traceExporter: new OTLPTraceExporter(),
  instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start();

package.json

No response

Relevant log output

No response

@codeboten codeboten added bug Something isn't working triage labels Sep 21, 2022
@pichlermarc pichlermarc added priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect and removed triage labels Sep 23, 2022
@pichlermarc
Copy link
Member

Thank you for pointing this out. I'll pick this up ASAP. 🙂

@pichlermarc pichlermarc self-assigned this Sep 23, 2022
@pichlermarc pichlermarc added the spec-noncompliant An existing feature incorrectly or incompletely implements the OTel spec. May or may not be a bug label Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect spec-noncompliant An existing feature incorrectly or incompletely implements the OTel spec. May or may not be a bug
Projects
None yet
2 participants