Skip to content

Add OpenTelemetry/OTLP support for Site24x7 observability - #4

Draft
jasper-paul-0621 wants to merge 1 commit into
mainfrom
claude/evaluate-microservices-architecture-RJWOh
Draft

Add OpenTelemetry/OTLP support for Site24x7 observability#4
jasper-paul-0621 wants to merge 1 commit into
mainfrom
claude/evaluate-microservices-architecture-RJWOh

Conversation

@jasper-paul-0621

Copy link
Copy Markdown
Collaborator

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_ENABLED environment variable.

Key Changes

Docker Compose & Orchestration

  • Updated docker-compose.yml with OTel configuration documentation and environment variables for all services
  • Added OTel entrypoint logic for Java services (Product, Storefront) with automatic OpenTelemetry Java agent download and configuration
  • Added OTel entrypoint logic for Node.js (Order Service) with npm package installation and tracing module loading
  • Added OTel entrypoint logic for Python (Payment Service) with pip package installation and opentelemetry-instrument wrapper
  • Added OTel environment variables for .NET (Auth Service) with SDK-based configuration
  • Added OTel environment variables for Go (Search Service) with SDK-based configuration
  • Created Docker volumes (otel_java_product, otel_java_storefront) to persist downloaded Java agents across restarts
  • Added Kubernetes Secret and ConfigMap manifests (k8s/site24x7-otel-secret.yaml) for credential and endpoint management

Service-Specific Implementations

Go (Search Service)

  • New services/search-service/observability/otel.go package that initializes the OTel SDK with OTLP/HTTP exporter
  • Updated services/search-service/main.go to call InitTracer() and wire OTel middleware into the Gin router
  • Updated go.mod with OTel dependencies (SDK, OTLP exporter, Gin instrumentation)

.NET (Auth Service)

  • Updated services/auth-service/Program.cs to conditionally register OpenTelemetry services when S247_OTEL_ENABLED=true
  • Configured tracing (AspNetCore, HttpClient, EntityFrameworkCore) and metrics (AspNetCore, HttpClient, Runtime) instrumentation
  • Updated AuthService.csproj with OTel NuGet packages

Node.js (Order Service)

  • New services/order-service/src/tracing.js module that bootstraps the OTel Node SDK with auto-instrumentation
  • Updated services/order-service/package.json with OTel dependencies (SDK, OTLP exporters, auto-instrumentations)

Python (Payment Service)

  • Updated services/payment-service/requirements.txt with OTel packages (distro, OTLP exporter, FastAPI/MySQL/HTTP/logging instrumentations)

Configuration & Documentation

  • Updated all baremetal environment example files (baremetal/config/*.env.example) with OTel configuration sections
  • Documented regional OTLP endpoints (US, EU, India, China, Australia) across all configuration files
  • Clarified mutual exclusivity between S247_OTEL_ENABLED and S247_APM_ENABLED with precedence rules

Implementation Details

  • License key is passed as the OTLP Api-Key header via OTEL_EXPORTER_OTLP_HEADERS environment variable
  • All services export to the same configurable OTLP endpoint (default: https://otel.site24x7.com:443)
  • Resource attributes include service name, version (1.0.0), and deployment environment (demo/baremetal)
  • When both OTel and APM are enabled, OTel takes precedence to avoid agent collisions (e.g., dual Java agents)
  • OTel initialization is a no-op when S247_OTEL_ENABLED != "true", ensuring zero overhead when disabled

https://claude.ai/code/session_01CHr9J4wu3XbMHzJfkLSGJt

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.
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