Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Latest commit

 

History

History
45 lines (33 loc) · 2.01 KB

README.md

File metadata and controls

45 lines (33 loc) · 2.01 KB

DEPRECATED

The project is no longer supported due to Prometheus no longer supports the Protobuf exposition format.

No Maintenance Intended Build Status Maven Central Codecov Codebeat

Protobuf exposition format support for Prometheus client.

Usage

You can find latest release on Maven Central.

  • Maven:
<dependency>
  <groupId>su.nlq</groupId>
  <artifactId>prometheus-protobuf-servlet</artifactId>
  <version>0.6.0</version>
</dependency>
  • Gradle:
compile group: 'su.nlq', name: 'prometheus-protobuf-servlet', version: '0.6.0'

The simple way to expose the metrics used in your code using Protobuf format is to add ProtobufMetricsServlet to your HTTP server. For example, you may do it with Jetty server:

final Server server = new Server(8080);
final ServletContextHandler context = new ServletContextHandler();
context.setContextPath("/");
server.setHandler(context);

context.addServlet(new ServletHolder(new ProtobufMetricsServlet()), "/metrics");

It also supports time series restriction using ?name[]= URL parameter.

Furthermore it is possible to use ProtobufFormatter directly and expose the result in any other way.