/athenz-metric-prometheus

Athenz metric implementation for prometheus

Primary LanguageJava

Athenz metric for Prometheus

Athenz Yahoo Server metrics interface implementation for Prometheus

Build

mvn clean package
ls ./target/athenz_metrics_prometheus-*.jar

Test coverage

mvn clover:instrument clover:aggregate clover:clover clover:check
open ./target/site/clover/index.html

Integrate with Athenz

  1. add athenz_metrics_prometheus-*.jar in Athenz server's classpath
  2. 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
  3. 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
  4. verify setup: curl localhost:8181/metrics
  5. 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']