Git Product home page Git Product logo

geronimo-metrics's Introduction

Geronimo Microprofile Metrics Implementation

Artifact

<parent>
  <groupId>org.apache.geronimo</groupId>
  <artifactId>geronimo-metrics</artifactId>
  <version>${metrics.version}</version>
</parent>

Renaming Prometheus keys

Prometheus exporter can rename metrics keys providing a properties file in the classpath as resource META-INF/geronimo-metrics/prometheus-mapping.properties or using system properties (with the prefix geronimo.metrics.prometheus.mapping.).

The key is the metric key (with the registry type as prefix) and the value the replacement key:

base\:my_metric = app:metric
Tip
since it is a properties format the : must be escaped.

The specific key geronimo.metrics.filter.prefix can take a list (comma separated values) of metrics prefixes to filter (whitelist) exported metrics.

Controlling the metrics endpoints exposure

To activate the metrics endpoints you have to set the system property geronimo.metrics.jaxrs.activated to true or configure either a role or host supported for the endpoint.

The role validation will use the JAX-RS SecurityContext. It relies on the system property geronimo.metrics.jaxrs.acceptedRoles and it takes a comma separated list of roles. At least one must match to let the request pass, if none is set this validation is ignored. Note that a request without a principal will lead to a HTTP 401 whereas a request with a principal but not the right role will issue a HTTP 403.

The host validation will use the JAX-RS UriInfo#getRequestUri. It relies on the system property geronimo.metrics.jaxrs.acceptedHosts and it takes a comma separated list of roles. At least one must match to let the request pass, if none is set this validation is ignored. The <local> value is an alias for 127.x.y.z or 1::x IP or localhost.

Configuration example:

-Dgeronimo.metrics.jaxrs.acceptedRoles=ops \
-Dgeronimo.metrics.jaxrs.acceptedHosts=my.remote.host
Important
the default is geronimo.metrics.jaxrs.acceptedHosts=<local> but you can disable the endpoints using geronimo.metrics.jaxrs.activated=false.

Security

Important
default will allow all local calls, this means that if you are behind a proxy which does not propagate the request URI properly your /metrics endpoints will be public.

geronimo-metrics's People

Contributors

fpapon avatar rmannibucau avatar sebbasf avatar struberg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.