...
Launch the Dashboard with Java Agent Enabled: The application is started with the OpenTelemetry Java agent, which uses the OTLP exporter configured. This setup will allow the application to send telemetry data (traces in this example) to the OpenTelemetry Collector for further processing.
Collect and Process Telemetry Data: The OpenTelemetry Collector will be set up to receive telemetry data from the application via OTLP protocols (HTTP on port
4318
and gRPC on port4317
). It will process the incoming data using a batch processor that ensures the efficient handling of metrics.Export Metrics: The processed metrics will then exposed for Prometheus to scrape at the endpoint
0.0.0.0:8889
. This integration will allows real-time monitoring and visualisation of the dashboard’s performance.Export Traces: xxThe OpenTelemetry Collector will forward the traces to Zipkin, a distributed tracing system. Zipkin will visualise these traces, helping track the flow of requests across the dashboard and identify any performance bottlenecks or failures.
First we need to define the configuration file for OpenTelemetry Collector. Example:
...
Latest version of the dashboard with environment variables defined that will enable Java Agent and will have endpoint and service name specified
External db
OpenTelemetry Collector
Prometheus for scraping metrics
Zipkin for tracing
docker-compose.yml
Code Block |
---|
services: dashboard: image: ${LATEST_DASHBOARD_IMAGE} ports: - 8226:8226 environment: PI_DB_HOST: database PI_DB_PASSWORD: password PI_DB_USERNAME: root PI_DB_SCHEMA_NAME: dashboard PI_DB_PORT: 3306 PI_EXTERNAL_DB: "true" PI_LICENCE: ${LICENCE_KEY} PI_TOMCAT_MONITORING_ENABLE_JAVA_AGENT: "true" PI_TOMCAT_MONITORING_OTLP_EXPORTER_ENDPOINT: "http://otel-collector:4318" PI_TOMCAT_MONITORING_OTLP_EXPORTER_PROTOCOL: "http/protobuf" PI_TOMCAT_MONITORING_SERVICE_NAME: "pi-dashboard" PI_TOMCAT_PORT: 8226 healthcheck: test: [ "CMD", "/bin/bash", "/var/panintelligence/tomcat_healthcheck.sh" ] interval: 10s start_period: 60s retries: 3 database: image: mariadb:10.9.4 environment: MARIADB_DATABASE: dashboard MARIADB_ROOT_PASSWORD: password LANG: C.UTF-8 command: --lower_case_table_names=1 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci restart: always ports: - "3306:3306" otel-collector: image: otel/opentelemetry-collector container_name: otel-collector command: [ "--config=/etc/config.yml" ] volumes: - /path_to_config_files/config.yml:/etc/config.yml # Mounts the local collector configuration file into the container at the specified path ports: - "4317:4317" # OTLP gRPC protocol for receiving telemetry data - "4318:4318" # MOTLP HTTP protocol for receiving telemetry data - "8889:8889" # Maps port 8889 for Prometheus scraping metrics from the collector prometheus: image: prom/prometheus:latest container_name: prometheus ports: - "9090:9090" # Maps port 9090 for accessing the Prometheus web interface volumes: - /path_to_prometheus_config/prometheus.yml:/etc/prometheus/prometheus.yml # Mounts the local Prometheus configuration file into the container zipkin: image: openzipkin/zipkin:2.23 container_name: zipkin ports: - "9411:9411" |
...