MCPcopy Index your code
hub / github.com/simstudioai/sim / normalizeOtlpTracesUrl

Function normalizeOtlpTracesUrl

apps/sim/instrumentation-node.ts:55–65  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

53// The HTTP exporter doesn't auto-suffix the signal path even though
54// the spec says the env var is a base URL.
55function normalizeOtlpTracesUrl(url: string): string {
56 if (!url) return url
57 try {
58 const u = new URL(url)
59 if (u.pathname.endsWith('/v1/traces')) return url
60 const base = url.replace(/\/$/, '')
61 return `${base}/v1/traces`
62 } catch {
63 return url
64 }
65}
66
67// Metrics counterpart to `normalizeOtlpTracesUrl`. Operates on the parsed
68// pathname (not a raw string suffix) so query strings and trailing slashes

Callers 1

initializeOpenTelemetryFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected