Conversation
…3247) * Add OTEL resource overrides and request span logs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * add a comment * support env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT * Use OTEL envDetector for resource attributes Replaces the custom OTEL_RESOURCE_ATTRIBUTES parser with @opentelemetry/resources' envDetector, which is spec-compliant (handles percent-decoding, length checks, OTEL_SERVICE_NAME merging). Injects service.version into OTEL_RESOURCE_ATTRIBUTES at startup so NEXT_PUBLIC_VERSION flows through the SDK rather than being applied by custom override code. The override SpanProcessor remains because Sentry hardcodes service.name to "node" — see getsentry/sentry-javascript#20502. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Include app version in structured request logs Logs and traces often live in different stores; inline version is more durable than relying on log shipper labels (which can drop during rolling deploys or label collisions). Read NEXT_PUBLIC_VERSION once at module load. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Set NEXT_PUBLIC_VERSION in jest shared setup So tests that depend on the value behave consistently across machines and CI rather than inheriting whatever happens to be in the shell. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Decouple request logging from OTEL via diagnostics_channel Move per-request structured logging off the OTEL span pipeline so that log emission is independent of OTEL_TRACES_SAMPLER_ARG. This lets the logs serve as ground truth for OTEL trace coverage — a null traceId in the log now means "OTEL never created a span for this request" rather than "the sampler dropped it." Subscribes to Node's built-in http.server.request.start / http.server.response.finish diagnostics channels (Experimental in Node 24/25, but the same surface Sentry/OTEL/Datadog use internally). traceId/spanId are read best-effort from the active OTEL context. Enabled by default; set NEXT_SERVER_REQUEST_LOGGING=false to disable. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Guard request-logger subscription against double-evaluation Defensive flag on globalThis prevents stacked subscriptions if the instrumentation hook is ever re-evaluated (dev reloads, worker restarts). In normal operation the module body runs once per process, but the guard is cheap insurance against doubled log lines. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * reword comment * Filter Next-internal paths from request logs and split out query Skip /_next/*, /__nextjs_*, and /favicon.ico in the structured request log. These never get OTEL traces (Sentry's HttpInstrumentation already filters them) so they're noise for the OTEL-coverage diagnostic, and in prod they mostly hit the CDN. RSC fetches go to real route paths (e.g. /courses?_rsc=...) and remain logged. Also split the URL into separate route and query fields. The route groups cleanly while the query stays available for filtering RSC vs non-RSC requests via the _rsc parameter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#3254) * Add externalLinkProps utility; open external CTA links in new tab only External drawer CTA links now get target="_blank" and the external link icon only when the URL origin differs from NEXT_PUBLIC_ORIGIN. Internal links stay in the same tab with no icon. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * use invariant instead of non-null assertion * fix overload * add a test for extraProps in externalLinkProps --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
renovate[bot]
Chris Chudzicki