Athenz Yahoo Server metrics interface implementation for Prometheus
mvn clean package
ls ./target/athenz_metrics_prometheus-*.jar
mvn clover:instrument clover:aggregate clover:clover clover:check
open ./target/site/clover/index.html
- add
athenz_metrics_prometheus-*.jar
in Athenz server's classpath - overwrite existing system property
# ZMS server athenz.zms.metric_factory_class=com.yahoo.athenz.common.metrics.impl.prometheus.PrometheusMetricFactory # ZTS server athenz.zts.metric_factory_class=com.yahoo.athenz.common.metrics.impl.prometheus.PrometheusMetricFactory
- add system property for
PrometheusMetric
# enable PrometheusMetric class athenz.metrics.prometheus.enable=true # export JVM metrics athenz.metrics.prometheus.jvm.enable=true # the Prometheus /metrics endpoint athenz.metrics.prometheus.http_server.enable=true athenz.metrics.prometheus.http_server.port=8181 # Prometheus metric prefix athenz.metrics.prometheus.namespace=athenz_zms # for dev. env. ONLY, record Athenz domain data as label athenz.metrics.prometheus.label.request_domain_name.enable=false athenz.metrics.prometheus.label.principal_domain_name.enable=false
- verify setup:
curl localhost:8181/metrics
- add job in your Prometheus server
scrape_configs: - job_name: 'athenz-server' scrape_interval: 10s honor_labels: true static_configs: - targets: ['athenz.server.domain:8181']