achandel-01 opened a new pull request, #630:
URL: https://github.com/apache/atlas/pull/630

   …rics export.
   
   ## What changes were proposed in this pull request?
   Introduce an optional [OpenTelemetry Java 
agent](https://opentelemetry.io/docs/zero-code/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:<path-to>/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](https://github.com/user-attachments/files/27566022/metrics.txt) 
contains output metrics
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to