Skip to content

kk0n/athenz-metric-prometheus

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Athenz metric for Prometheus

Athenz Yahoo Server metrics interface implementation for Prometheus

Usage

Build

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

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']

Note

  1. The current implementation is based on specific athenz version. As the athenz dependency is using the provided scope, this class may throw error if non-compatible athenz JARs are included during runtime.

For developer

Test coverage

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

Performance test result

Design concerns

example main for integration test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%