-
-
Notifications
You must be signed in to change notification settings - Fork 433
judge: enhance tracing configuration #1112
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
Open
renbaoshuo
wants to merge
1
commit into
hydro-dev:master
Choose a base branch
from
renbaoshuo:feat/judge/tracing-improvments-251230
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
OpenTelemetry OTLP trace exporter proto endpoint URL format /v1/traces💡 Result:
Short answer:
Examples:
References:
[1] OpenTelemetry Protocol Exporter (OTLP/HTTP endpoint behavior).
[2] OTLP specification: default HTTP path /v1/traces (ExportTraceServiceRequest).
🌐 Web query:
@opentelemetry/exporter-trace-otlp-proto JavaScript endpoint configuration💡 Result:
Short answer — you can set the endpoint either in the exporter constructor (collectorOptions.url) or with OTEL environment variables.
How:
In code (HTTP/proto exporter): pass url in the config when creating OTLPTraceExporter:
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-proto');
const exporter = new OTLPTraceExporter({ url: 'http://collector:4318/v1/traces', headers: { /* optional */ } });
(constructor accepts an OTLPExporterNodeConfigBase). [1]
With env vars (preferred for deployment): set OTEL_EXPORTER_OTLP_ENDPOINT for a base URL or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT for a signal-specific URL. When using OTEL_EXPORTER_OTLP_ENDPOINT with HTTP, the SDK will append /v1/traces for traces; per-signal vars are used as-is. Defaults are http://localhost:4318 (HTTP) and http://localhost:4317 (gRPC). [2][3]
Notes:
Sources:
[1] OTLPTraceExporter constructor docs.
[2] OpenTelemetry SDK OTLP exporter configuration (env vars & defaults).
[3] OpenTelemetry Protocol Exporter spec (per-signal URL rules).
🌐 Web query:
OTLPTraceExporterProto vs OTLPTraceExporterHttp JavaScript @opentelemetry endpoint path behavior💡 Result:
Short answer — behavior differs on whether the exporter will append the signal path (/v1/traces) for you:
@opentelemetry/exporter-trace-otlp-http (OTLPTraceExporterHttp)
@opentelemetry/exporter-trace-otlp-proto (OTLPTraceExporterProto)
Practical rule:
If you want, tell me the exact code or env var you’re using and I’ll confirm the correct url to set.
Citations:
🌐 Web query:
OTLPTraceExporterProto JavaScript automatically append v1 traces path endpoint💡 Result:
Yes — the OTLP trace HTTP exporters in OpenTelemetry JS will append the /v1/traces path automatically when you set the generic OTEL_EXPORTER_OTLP_ENDPOINT (or when you omit url and use the default). If you want to supply a full per-signal endpoint you must include the path yourself (OTEL_EXPORTER_OTLP_TRACES_ENDPOINT or url option). [1][2]
Examples:
Sources:
[1] OpenTelemetry JS OTLP Trace exporter docs (env var per-signal behavior).
[2] OpenTelemetry docs / exporter examples showing default url and automatic /v1/traces behavior.
🏁 Script executed:
Repository: hydro-dev/Hydro
Length of output: 1081
Proto exporter must include
/v1/tracespath like the HTTP exporter.The
OTLPTraceExporterProtouses the same OTLP/HTTP endpoint path asOTLPTraceExporterHttp, but the current code passes the endpoint directly without ensuring the/v1/tracespath is appended. If a user provides a base endpoint likehttp://localhost:4318, the proto exporter will send requests to the wrong path and fail to export traces.Suggested fix:
} else if (exporter === 'proto') { traceExporter = new OTLPTraceExporterProto({ - url: endpoint, + url: endpoint.includes('/v1/traces') ? endpoint : `${endpoint}/v1/traces`, });📝 Committable suggestion
🤖 Prompt for AI Agents