Skip to content

Commit

Permalink
check if the string ends with v1/metrics to account for potential pre…
Browse files Browse the repository at this point in the history
…fixes
  • Loading branch information
keturiosakys committed Sep 15, 2023
1 parent 2f60e7d commit 6cfbb45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/exporter-otlp-http/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function init({

const urlObj = new URL(url);

if (urlObj.pathname !== "/v1/metrics") {
if (!urlObj.pathname.endsWith("/v1/metrics")) {
amLogger.warn(
"The OTLP/HTTP endpoint path for metrics should be '/v1/metrics', your metrics data might not be submitted properly. See: https://opentelemetry.io/docs/specs/otel/protocol/exporter/#endpoint-urls-for-otlphttp",
);
Expand Down

0 comments on commit 6cfbb45

Please sign in to comment.