Skip to content

Cleaner OTEL Implementation - #354

Merged
Strehk merged 3 commits into
otel-checkfrom
observability-jaeger-opentelemetry-fix
Jan 19, 2026
Merged

Cleaner OTEL Implementation#354
Strehk merged 3 commits into
otel-checkfrom
observability-jaeger-opentelemetry-fix

Conversation

@Strehk

@Strehk Strehk commented Jan 18, 2026

Copy link
Copy Markdown
Member

Summary

  • Initialize and fix OpenTelemetry tracing so spans are correctly parented and exported.
  • Add Jaeger service and persistent volume to dev.docker-compose.yml; make observability stack composable via Docker profiles.
  • Provide convenient docker-compose scripts in package.json for core, listmonk, observability and full setups.

What changed

  • Register W3C propagator and propagate the active OpenTelemetry context in the GraphQL tracer to ensure correct parent-child relationships for spans (fixes Jaeger showing single-line spans).
  • Initialize the tracer as early as possible (import tracer before other modules) so HttpInstrumentation can patch HTTP modules correctly.
  • Make the tracer environment-aware by using the SvelteKit build-time "building" flag to control span exporting.
  • Add Jaeger service and persistent volume to development docker-compose and assign composable profiles to services for optional observability.
  • Update package.json with docker-compose convenience scripts for different setups (core, listmonk, observability, full).

Notes

  • Observability stack can now be enabled separately via Docker profiles or using the new package.json scripts.

This is part 2 of 2 in a stack made with GitButler:

Register W3C propagator and propagate active OpenTelemetry context in GraphQL tracer so spans are correctly parented (fixes Jaeger showing single-line spans). Add Jaeger service and persistent volume to dev.docker-compose.yml and assign composable profiles to services so observability stack can be enabled separately. Update package.json to provide convenient docker-compose scripts for core, listmonk, observability and full setups.
Ensure the OpenTelemetry tracer is initialized before any other imports to allow HttpInstrumentation to patch HTTP modules correctly. Add an import of the tracer in hooks.server so tracing starts first, and import the SvelteKit build-time "building" flag into tracer to enable environment-aware behavior when exporting spans.
@coderabbitai

coderabbitai Bot commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Strehk
Strehk requested a review from m1212e January 18, 2026 22:43
Update tracer setup to register a single span processor instead of
always adding the fallback first and then conditionally adding the
active processor. Now the provider adds only the active processor
(OTLP or console fallback), avoiding duplicate processors and ensuring
a single, intended processor handles spans. This simplifies logic and
prevents potential double-processing of spans.
@Strehk
Strehk merged commit 6b0a6e9 into otel-check Jan 19, 2026
2 checks passed
@Strehk
Strehk deleted the observability-jaeger-opentelemetry-fix branch January 19, 2026 15:23
@Strehk
Strehk restored the observability-jaeger-opentelemetry-fix branch January 19, 2026 15:24
Strehk added a commit that referenced this pull request Jan 19, 2026
@Strehk
Strehk deleted the observability-jaeger-opentelemetry-fix branch January 19, 2026 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants