Add OpenTelemetry/OTLP support for Site24x7 observability - #4
Draft
jasper-paul-0621 wants to merge 1 commit into
Draft
Add OpenTelemetry/OTLP support for Site24x7 observability#4jasper-paul-0621 wants to merge 1 commit into
jasper-paul-0621 wants to merge 1 commit into
Conversation
Wire OTel SDK / auto-instrumentation into all six ZylkerKart services (.NET, Node.js, Python, Go, Java x2). Activated by S247_OTEL_ENABLED=true and exports traces + metrics over OTLP/HTTP to a configurable Site24x7 endpoint, with the license key sent as the Api-Key header. - docker-compose.yml: per-service entrypoint branch installs the matching OTel agent/SDK at runtime and exports OTEL_EXPORTER_OTLP_* env vars; OTel takes precedence over the proprietary APM agents to avoid dual-agent collisions. - auth-service (.NET): OpenTelemetry NuGet packages + tracer/meter provider configured in Program.cs, gated on S247_OTEL_ENABLED. - order-service (Node.js): tracing.js bootstrap registered via --require, with auto-instrumentations + OTLP HTTP exporters. - payment-service (Python): opentelemetry-distro + instrumentations bootstrapped via opentelemetry-instrument. - search-service (Go): observability/otel.go initialises the global TracerProvider; otelgin middleware wraps Gin. - product-service / storefront (Java): OpenTelemetry javaagent JAR downloaded and attached via -javaagent. - k8s/site24x7-otel-secret.yaml: new Kubernetes Secret holding the license key plus a sibling ConfigMap with endpoint/protocol settings. - baremetal/config/*.env.example: documented OTel env block (regional endpoints, OTLP headers) for systemd deployments.
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.
Summary
This PR adds comprehensive OpenTelemetry (OTel) integration across the ZylkerKart microservices platform, enabling trace and metric export to Site24x7 via the OTLP/HTTP protocol. The implementation is mutually exclusive with the existing proprietary APM agents and can be toggled via the
S247_OTEL_ENABLEDenvironment variable.Key Changes
Docker Compose & Orchestration
docker-compose.ymlwith OTel configuration documentation and environment variables for all servicesotel_java_product,otel_java_storefront) to persist downloaded Java agents across restartsk8s/site24x7-otel-secret.yaml) for credential and endpoint managementService-Specific Implementations
Go (Search Service)
services/search-service/observability/otel.gopackage that initializes the OTel SDK with OTLP/HTTP exporterservices/search-service/main.goto callInitTracer()and wire OTel middleware into the Gin routergo.modwith OTel dependencies (SDK, OTLP exporter, Gin instrumentation).NET (Auth Service)
services/auth-service/Program.csto conditionally register OpenTelemetry services whenS247_OTEL_ENABLED=trueAuthService.csprojwith OTel NuGet packagesNode.js (Order Service)
services/order-service/src/tracing.jsmodule that bootstraps the OTel Node SDK with auto-instrumentationservices/order-service/package.jsonwith OTel dependencies (SDK, OTLP exporters, auto-instrumentations)Python (Payment Service)
services/payment-service/requirements.txtwith OTel packages (distro, OTLP exporter, FastAPI/MySQL/HTTP/logging instrumentations)Configuration & Documentation
baremetal/config/*.env.example) with OTel configuration sectionsS247_OTEL_ENABLEDandS247_APM_ENABLEDwith precedence rulesImplementation Details
Api-Keyheader viaOTEL_EXPORTER_OTLP_HEADERSenvironment variablehttps://otel.site24x7.com:443)S247_OTEL_ENABLED != "true", ensuring zero overhead when disabledhttps://claude.ai/code/session_01CHr9J4wu3XbMHzJfkLSGJt