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

nolequen/prometheus-protobuf-servlet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Protobuf exposition format support for Prometheus client

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages