Skip to content

ATLAS-5292: Add optional OpenTelemetry Java agent with Prometheus met…#630

Open
achandel-01 wants to merge 1 commit into
apache:masterfrom
achandel-01:ATLAS-5292
Open

ATLAS-5292: Add optional OpenTelemetry Java agent with Prometheus met…#630
achandel-01 wants to merge 1 commit into
apache:masterfrom
achandel-01:ATLAS-5292

Conversation

@achandel-01
Copy link
Copy Markdown
Contributor

…rics export.

What changes were proposed in this pull request?

Introduce an optional OpenTelemetry Java agent for the Atlas server, packaged with the web application and toggled via environment variables. When enabled, the agent exposes JVM and application metrics through the Prometheus exporter so operators can scrape metrics from Atlas.

  • Packaging: opentelemetry-javaagent.jar is included under the expanded webapp’s WEB-INF/lib (via the webapp build / Maven dependency) so the agent ships inside atlas.war / distro tarball.
  • Startup: atlas_start.py appends JVM arguments when ATLAS_OTEL_JAVAAGENT_ENABLED is truthy (true / 1 / yes / on):
    -javaagent:/WEB-INF/lib/opentelemetry-javaagent.jar
    -Dotel.metrics.exporter=prometheus
    -Dotel.exporter.prometheus.port and -Dotel.exporter.prometheus.host from env (with sensible defaults when unset).
  • Configuration surface: atlas_config.py registers the new variables in ENV_KEYS so values from atlas-env.sh / process environment are respected consistently with other Atlas env vars.
  • Docker / Compose: Image build args and runtime environment for ATLAS_OTEL_*; publish the Prometheus port on the Atlas service; ensure the process that runs atlas_start.py preserves container env (e.g. su --preserve-environment) so Docker -e settings apply after user switch.

env variables to pass before starting atlas docker set up :
ATLAS_OTEL_JAVAAGENT_ENABLED Master switch for attaching the agent.
ATLAS_OTEL_PROMETHEUS_PORT Prometheus exporter listen port (e.g. default 9464).
ATLAS_OTEL_PROMETHEUS_HOST Bind address (e.g. 0.0.0.0 in containers for host scraping).

example input :
export ATLAS_OTEL_JAVAAGENT_ENABLED=true
export ATLAS_OTEL_PROMETHEUS_PORT=19090
export ATLAS_OTEL_PROMETHEUS_HOST=0.0.0.0

with these inputs atlas docker container will expose port 19090 and metrics will be available on localhost:19090/metrics.

How was this patch tested?

Ran the local Docker stack with ATLAS_OTEL_JAVAAGENT_ENABLED=true, confirmed Atlas starts and /metrics on the configured port returns Prometheus text; with the flag off, Atlas still starts as before.
metrics.txt contains output metrics

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