Skip to content

Add a shared gateway tracing demo with Mongoose - #5

Merged
hossain-rayhan merged 4 commits into
documentdb:mainfrom
udsmicrosoft:users/urismiley/shared-telemetry-demo
Aug 12, 2026
Merged

Add a shared gateway tracing demo with Mongoose#5
hossain-rayhan merged 4 commits into
documentdb:mainfrom
udsmicrosoft:users/urismiley/shared-telemetry-demo

Conversation

@udsmicrosoft

@udsmicrosoft udsmicrosoft commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a reusable local stack with the published tracing-enabled DocumentDB image, OpenTelemetry Collector, and Jaeger
  • add optional Mongoose HTTP and client spans with W3C trace-context propagation into gateway requests
  • validate query filters and restrict updates to supported book fields
  • make custom host gateway ports work consistently across all playground readiness checks
  • provide scripts that start the demo and verify a connected application-to-gateway trace

Validation

  • pulled ghcr.io/documentdb/documentdb/documentdb-local:trace-4fbbfcb8 at manifest digest sha256:d02b04ad23c6474d0150c34e432e1d4cbcdf70a2b8c02ef86671bf925a02cd35
  • deployed a clean DocumentDB, OpenTelemetry Collector 0.157.0, and Jaeger 2.20.0 stack
  • verified the trace hierarchy GET /stats/genres -> mongoose.aggregate -> gateway.request -> gateway.process_request -> postgres.execute
  • passed all 16 Mongoose compatibility checks
  • verified invalid query and update payloads are rejected while supported updates succeed
  • passed CodeQL, shell syntax, Node syntax, Compose configuration, and diff whitespace checks

Copilot-Session: 85f151f9-f585-4bdf-9c2b-798f8a2651be
Copilot-Session: 85f151f9-f585-4bdf-9c2b-798f8a2651be
@udsmicrosoft
udsmicrosoft marked this pull request as ready for review August 7, 2026 19:46
Comment thread playgrounds/mongoose/app/server.js Fixed
Comment thread playgrounds/mongoose/app/server.js Fixed
Copilot-Session: 85f151f9-f585-4bdf-9c2b-798f8a2651be

build_container_uri() {
echo "mongodb://${DOCUMENTDB_USERNAME}:${DOCUMENTDB_PASSWORD}@localhost:${DOCUMENTDB_CONTAINER_PORT}/?tls=true&tlsAllowInvalidCertificates=true&directConnection=true"
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the core difference between this new and our old approach? Do we really need to modify all the lib.sh files?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code used the configurable host port for both app connections and readiness checks. Since the container always listens on 10260, custom host ports broke readiness checks. I think all four lib.sh files need the same fix.

Comment thread shared/telemetry/scripts/up.sh Outdated
Copilot-Session: fe7b5004-ec7a-481d-8522-df4c1dae36fe
@hossain-rayhan
hossain-rayhan merged commit 3b0e365 into documentdb:main Aug 12, 2026
2 checks passed
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.

3 participants