Prometheus instrumentation library for JVM applications

Overview

Prometheus JVM Client

It supports Java, Clojure, Scala, JRuby, and anything else that runs on the JVM.

Build Status

Table of Contents

Using

Assets

If you use Maven, you can simply reference the assets below. The latest version can be found on in the maven repository for io.prometheus.

<!-- The client -->
<dependency>
  <groupId>io.prometheus</groupId>
  <artifactId>simpleclient</artifactId>
  <version>0.10.0</version>
</dependency>
<!-- Hotspot JVM metrics-->
<dependency>
  <groupId>io.prometheus</groupId>
  <artifactId>simpleclient_hotspot</artifactId>
  <version>0.10.0</version>
</dependency>
<!-- Exposition HTTPServer-->
<dependency>
  <groupId>io.prometheus</groupId>
  <artifactId>simpleclient_httpserver</artifactId>
  <version>0.10.0</version>
</dependency>
<!-- Pushgateway exposition-->
<dependency>
  <groupId>io.prometheus</groupId>
  <artifactId>simpleclient_pushgateway</artifactId>
  <version>0.10.0</version>
</dependency>

Javadocs

There are canonical examples defined in the class definition Javadoc of the client packages.

Documentation can be found at the Java Client Github Project Page.

Instrumenting

Four types of metrics are offered: Counter, Gauge, Summary and Histogram. See the documentation on metric types and instrumentation best practices on how to use them.

Counter

Counters go up, and reset when the process restarts.

import io.prometheus.client.Counter;
class YourClass {
  static final Counter requests = Counter.build()
     .name("requests_total").help("Total requests.").register();

  void processRequest() {
    requests.inc();
    // Your code here.
  }
}

Gauge

Gauges can go up and down.

class YourClass {
  static final Gauge inprogressRequests = Gauge.build()
     .name("inprogress_requests").help("Inprogress requests.").register();

  void processRequest() {
    inprogressRequests.inc();
    // Your code here.
    inprogressRequests.dec();
  }
}

There are utilities for common use cases:

gauge.setToCurrentTime(); // Set to current unixtime.

As an advanced use case, a Gauge can also take its value from a callback by using the setChild() method. Keep in mind that the default inc(), dec() and set() methods on Gauge take care of thread safety, so when using this approach ensure the value you are reporting accounts for concurrency.

Summary

Summaries track the size and number of events.

class YourClass {
  static final Summary receivedBytes = Summary.build()
     .name("requests_size_bytes").help("Request size in bytes.").register();
  static final Summary requestLatency = Summary.build()
     .name("requests_latency_seconds").help("Request latency in seconds.").register();

  void processRequest(Request req) {
    Summary.Timer requestTimer = requestLatency.startTimer();
    try {
      // Your code here.
    } finally {
      receivedBytes.observe(req.size());
      requestTimer.observeDuration();
    }
  }
}

There are utilities for timing code and support for quantiles. Essentially quantiles aren't aggregatable and add some client overhead for the calculation.

class YourClass {
  static final Summary requestLatency = Summary.build()
    .quantile(0.5, 0.05)   // Add 50th percentile (= median) with 5% tolerated error
    .quantile(0.9, 0.01)   // Add 90th percentile with 1% tolerated error
    .name("requests_latency_seconds").help("Request latency in seconds.").register();

  void processRequest(Request req) {
    requestLatency.time(new Runnable() {
      public abstract void run() {
        // Your code here.
      }
    });


    // Or the Java 8 lambda equivalent
    requestLatency.time(() -> {
      // Your code here.
    });
  }
}

Histogram

Histograms track the size and number of events in buckets. This allows for aggregatable calculation of quantiles.

class YourClass {
  static final Histogram requestLatency = Histogram.build()
     .name("requests_latency_seconds").help("Request latency in seconds.").register();

  void processRequest(Request req) {
    Histogram.Timer requestTimer = requestLatency.startTimer();
    try {
      // Your code here.
    } finally {
      requestTimer.observeDuration();
    }
  }
}

The default buckets are intended to cover a typical web/rpc request from milliseconds to seconds. They can be overridden with the buckets() method on the Histogram.Builder.

There are utilities for timing code:

class YourClass {
  static final Histogram requestLatency = Histogram.build()
     .name("requests_latency_seconds").help("Request latency in seconds.").register();

  void processRequest(Request req) {
    requestLatency.time(new Runnable() {
      public abstract void run() {
        // Your code here.
      }
    });


    // Or the Java 8 lambda equivalent
    requestLatency.time(() -> {
      // Your code here.
    });
  }
}

Labels

All metrics can have labels, allowing grouping of related time series.

See the best practices on naming and labels.

Taking a counter as an example:

class YourClass {
  static final Counter requests = Counter.build()
     .name("my_library_requests_total").help("Total requests.")
     .labelNames("method").register();

  void processGetRequest() {
    requests.labels("get").inc();
    // Your code here.
  }
}

Registering Metrics

The best way to register a metric is via a static final class variable as is common with loggers.

static final Counter requests = Counter.build()
   .name("my_library_requests_total").help("Total requests.").labelNames("path").register();

Using the default registry with variables that are static is ideal since registering a metric with the same name is not allowed and the default registry is also itself static. You can think of registering a metric, more like registering a definition (as in the TYPE and HELP sections). The metric 'definition' internally holds the samples that are reported and pulled out by Prometheus. Here is an example of registering a metric that has no labels.

class YourClass {
  static final Gauge activeTransactions = Gauge.build()
     .name("my_library_transactions_active")
     .help("Active transactions.")
     .register();

  void processThatCalculates(String key) {
    activeTransactions.inc();
    try {
        // Perform work.
    } finally{
        activeTransactions.dec();
    }
  }
}

To create timeseries with labels, include labelNames() with the builder. The labels() method looks up or creates the corresponding labelled timeseries. You might also consider storing the labelled timeseries as an instance variable if it is appropriate. It is thread safe and can be used multiple times, which can help performance.

class YourClass {
  static final Counter calculationsCounter = Counter.build()
     .name("my_library_calculations_total").help("Total calls.")
     .labelNames("key").register();

  void processThatCalculates(String key) {
    calculationsCounter.labels(key).inc();
    // Run calculations.
  }
}

Included Collectors

The Java client includes collectors for garbage collection, memory pools, classloading, and thread counts. These can be added individually or just use the DefaultExports to conveniently register them.

DefaultExports.initialize();

Logging

There are logging collectors for log4j, log4j2 and logback.

To register the Logback collector can be added to the root level like so:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <include resource="org/springframework/boot/logging/logback/base.xml"/>

    <appender name="METRICS" class="io.prometheus.client.logback.InstrumentedAppender" />

    <root level="INFO">
        <appender-ref ref="METRICS" />
    </root>

</configuration>

To register the log4j collector at root level:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="METRICS" class="io.prometheus.client.log4j.InstrumentedAppender"/>
    <root>
        <priority value ="info" />
        <appender-ref ref="METRICS" />
    </root>
</log4j:configuration>

To register the log4j2 collector at root level:

<?xml version="1.0" encoding="UTF-8"?>
<Configuration packages="io.prometheus.client.log4j2">
    <Appenders>
        <Prometheus name="METRICS"/>
    </Appenders>
    <Loggers>
        <Root level="info">
            <AppenderRef ref="METRICS"/>
        </Root>
    </Loggers>
</Configuration>

Caches

To register the Guava cache collector, be certain to add recordStats() when building the cache and adding it to the registered collector.

CacheMetricsCollector cacheMetrics = new CacheMetricsCollector().register();

Cache<String, String> cache = CacheBuilder.newBuilder().recordStats().build();
cacheMetrics.addCache("myCacheLabel", cache);

The Caffeine equivalent is nearly identical. Again, be certain to call recordStats() when building the cache so that metrics are collected.

CacheMetricsCollector cacheMetrics = new CacheMetricsCollector().register();

Cache<String, String> cache = Caffeine.newBuilder().recordStats().build();
cacheMetrics.addCache("myCacheLabel", cache);

Hibernate

There is a collector for Hibernate which allows to collect metrics from one or more SessionFactory instances.

If you want to collect metrics from a single SessionFactory, you can register the collector like this:

new HibernateStatisticsCollector(sessionFactory, "myapp").register();

In some situations you may want to collect metrics from multiple factories. In this case just call add() on the collector for each of them.

new HibernateStatisticsCollector()
    .add(sessionFactory1, "myapp1")
    .add(sessionFactory2, "myapp2")
    .register();

If you are using Hibernate in a JPA environment and only have access to the EntityManager or EntityManagerFactory, you can use this code to access the underlying SessionFactory:

SessionFactory sessionFactory = entityManagerFactory.unwrap(SessionFactory.class);

respectively

SessionFactory sessionFactory = entityManager.unwrap(Session.class).getSessionFactory();

Jetty

There is a collector for recording various Jetty server metrics. You can do it by registering the collector like this:

// Configure StatisticsHandler.
StatisticsHandler stats = new StatisticsHandler();
stats.setHandler(server.getHandler());
server.setHandler(stats);
// Register collector.
new JettyStatisticsCollector(stats).register();

Also, you can collect QueuedThreadPool metrics. If there is a single QueuedThreadPool to keep track of, use the following:

new QueuedThreadPoolStatisticsCollector(queuedThreadPool, "myapp").register();

If you want to collect multiple QueuedThreadPool metrics, also you can achieve it like this:

new QueuedThreadPoolStatisticsCollector()
    .add(queuedThreadPool1, "myapp1")
    .add(queuedThreadPool2, "myapp2")
    .register();

Servlet Filter

There is a servlet filter available for measuring the duration taken by servlet requests. The metric-name init parameter is required, and is the name of the metric prometheus will expose for the timing metrics. Help text via the help init parameter is not required, although it is highly recommended. The number of buckets is overridable, and can be configured by passing a comma-separated string of doubles as the buckets init parameter. The granularity of path measuring is also configurable, via the path-components init parameter. By default, the servlet filter will record each path differently, but by setting an integer here, you can tell the filter to only record up to the Nth slashes. That is, all requests with greater than N "/" characters in the servlet URI path will be measured in the same bucket and you will lose that granularity.

The code below is an example of the XML configuration for the filter. You will need to place this (replace your own values) code in your webapp/WEB-INF/web.xml file.

<filter>
  <filter-name>prometheusFilter</filter-name>
  <filter-class>io.prometheus.client.filter.MetricsFilter</filter-class>
  <init-param>
    <param-name>metric-name</param-name>
    <param-value>webapp_metrics_filter</param-value>
  </init-param>
  <init-param>
    <param-name>help</param-name>
    <param-value>This is the help for your metrics filter</param-value>
  </init-param>
  <init-param>
    <param-name>buckets</param-name>
    <param-value>0.005,0.01,0.025,0.05,0.075,0.1,0.25,0.5,0.75,1,2.5,5,7.5,10</param-value>
  </init-param>
  <!-- Optionally override path components; anything less than 1 (1 is the default)
       means full granularity -->
  <init-param>
    <param-name>path-components</param-name>
    <param-value>1</param-value>
  </init-param>
</filter>

<!-- You will most likely want this to be the first filter in the chain
(therefore the first <filter-mapping> in the web.xml file), so that you can get
the most accurate measurement of latency. -->
<filter-mapping>
  <filter-name>prometheusFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

Additionally, you can instantiate your servlet filter directly in Java code. To do this, you just need to call the non-empty constructor. The first parameter, the metric name, is required. The second, help, is optional but highly recommended. The last two (path-components, and buckets) are optional and will default sensibly if omitted.

Spring AOP

There is a Spring AOP collector that allows you to annotate methods that you would like to instrument with a Summary, but without going through the process of manually instantiating and registering your metrics classes. To use the metrics annotations, simply add simpleclient_spring_web as a dependency, annotate a configuration class with @EnablePrometheusTiming, then annotate your Spring components as such:

@Controller
public class MyController {
  @RequestMapping("/")
  @PrometheusTimeMethod(name = "my_controller_path_duration_seconds", help = "Some helpful info here")
  public Object handleMain() {
    // Do something
  }
}

Exporting

There are several options for exporting metrics.

HTTP

Metrics are usually exposed over HTTP, to be read by the Prometheus server.

There are HTTPServer, Servlet, SpringBoot, and Vert.x integrations included in the client library. The simplest of these is the HTTPServer:

HTTPServer server = new HTTPServer(1234);

To add Prometheus exposition to an existing HTTP server using servlets, see the MetricsServlet. It also serves as a simple example of how to write a custom endpoint.

To expose the metrics used in your code, you would add the Prometheus servlet to your Jetty server:

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

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

All HTTP exposition integrations support restricting which time series to return using ?name[]= URL parameters. Due to implementation limitations, this may have false negatives.

Exporting to a Pushgateway

The Pushgateway allows ephemeral and batch jobs to expose their metrics to Prometheus.

void executeBatchJob() throws Exception {
  CollectorRegistry registry = new CollectorRegistry();
  Gauge duration = Gauge.build()
     .name("my_batch_job_duration_seconds").help("Duration of my batch job in seconds.").register(registry);
  Gauge.Timer durationTimer = duration.startTimer();
  try {
    // Your code here.

    // This is only added to the registry after success,
    // so that a previous success in the Pushgateway isn't overwritten on failure.
    Gauge lastSuccess = Gauge.build()
       .name("my_batch_job_last_success").help("Last time my batch job succeeded, in unixtime.").register(registry);
    lastSuccess.setToCurrentTime();
  } finally {
    durationTimer.setDuration();
    PushGateway pg = new PushGateway("127.0.0.1:9091");
    pg.pushAdd(registry, "my_batch_job");
  }
}

A separate registry is used, as the default registry may contain other metrics such as those from the Process Collector. See the Pushgateway documentation for more information.

with Basic Auth

PushGateway pushgateway = new PushGateway("127.0.0.1:9091");
pushgateway.setConnectionFactory(new BasicAuthHttpConnectionFactory("my_user", "my_password"));

with Custom Connection Preparation Logic

PushGateway pushgateway = new PushGateway("127.0.0.1:9091");
pushgateway.setConnectionFactory(new MyHttpConnectionFactory());

where

class MyHttpConnectionFactory implements HttpConnectionFactory {
    @Override
    public HttpURLConnection create(String url) throws IOException {
        HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
        // add any connection preparation logic you need
        return connection;
    }
}

Bridges

It is also possible to expose metrics to systems other than Prometheus. This allows you to take advantage of Prometheus instrumentation even if you are not quite ready to fully transition to Prometheus yet.

Graphite

Metrics are pushed over TCP in the Graphite plaintext format.

Graphite g = new Graphite("localhost", 2003);
// Push the default registry once.
g.push(CollectorRegistry.defaultRegistry);

// Push the default registry every 60 seconds.
Thread thread = g.start(CollectorRegistry.defaultRegistry, 60);
// Stop pushing.
thread.interrupt();
thread.join();

Custom Collectors

Sometimes it is not possible to directly instrument code, as it is not in your control. This requires you to proxy metrics from other systems.

To do so you need to create a custom collector (which will need to be registered as a normal metric), for example:

class YourCustomCollector extends Collector {
  public List<MetricFamilySamples> collect() {
    List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>();
    // With no labels.
    mfs.add(new GaugeMetricFamily("my_gauge", "help", 42));
    // With labels
    GaugeMetricFamily labeledGauge = new GaugeMetricFamily("my_other_gauge", "help", Arrays.asList("labelname"));
    labeledGauge.addMetric(Arrays.asList("foo"), 4);
    labeledGauge.addMetric(Arrays.asList("bar"), 5);
    mfs.add(labeledGauge);
    return mfs;
  }
}

// Registration
static final YourCustomCollector requests = new YourCustomCollector().register()

SummaryMetricFamily works similarly.

A collector may implement a describe method which returns metrics in the same format as collect (though you don't have to include the samples). This is used to predetermine the names of time series a CollectorRegistry exposes and thus to detect collisions and duplicate registrations.

Usually custom collectors do not have to implement describe. If describe is not implemented and the CollectorRegistry was created with auto_describe=True (which is the case for the default registry) then collect will be called at registration time instead of describe. If this could cause problems, either implement a proper describe, or if that's not practical have describe return an empty list.

DropwizardExports Collector

DropwizardExports collector is available to proxy metrics from Dropwizard.

// Dropwizard MetricRegistry
MetricRegistry metricRegistry = new MetricRegistry();
new DropwizardExports(metricRegistry).register();

By default Dropwizard metrics are translated to Prometheus sample sanitizing their names, i.e. replacing unsupported chars with _, for example:

Dropwizard metric name:
org.company.controller.save.status.400
Prometheus metric:
org_company_controller_save_status_400

It is also possible add custom labels and name to newly created Samples by using a CustomMappingSampleBuilder with custom MapperConfigs:

// Dropwizard MetricRegistry
MetricRegistry metricRegistry = new MetricRegistry();
MapperConfig config = new MapperConfig();
// The match field in MapperConfig is a simplified glob expression that only allows * wildcard.
config.setMatch("org.company.controller.*.status.*");
// The new Sample's template name.
config.setName("org.company.controller");
Map<String, String> labels = new HashMap<String,String>();
// ... more configs
// Labels to be extracted from the metric. Key=label name. Value=label template
labels.put("name", "${0}");
labels.put("status", "${1}");
config.setLabels(labels);

SampleBuilder sampleBuilder = new CustomMappingSampleBuilder(Arrays.asList(config));
new DropwizardExports(metricRegistry, sampleBuilder).register();

When a new metric comes to the collector, MapperConfigs are scanned to find the first one that matches the incoming metric name. The name set in the configuration will be used and labels will be extracted. Using the CustomMappingSampleBuilder in the previous example leads to the following result:

Dropwizard metric name
org.company.controller.save.status.400
Prometheus metric
org_company_controller{name="save",status="400"}

Template with placeholders can be used both as names and label values. Placeholders are in the ${n} format where n is the zero based index of the Dropwizard metric name wildcard group we want to extract.

Contact

The Prometheus Users Mailinglist is the best place to ask questions.

Details for those wishing to develop the library can be found on the wiki

Comments
  • HdrSummary based on Summary and HdrHistogram

    HdrSummary based on Summary and HdrHistogram

    Idea:

    We could implement HdrSummary based on Summary and HdrHistogram.

    Pros:

    • avoids suspending threads for highly concurrent workloads (get, insert)
    • reduces constant overhead (get, insert)

    Cons:

    • introduces busy waiting and retry-loop (rotate)
    • increases memory usage (maxAgeBuckets, numberOfSignificantValueDigits)
    • reduces accuracy / precision (High Dynamic Range)

    Neutral:

    • error is configured globally (numberOfSignificantValueDigits)
    • negative measurements are not supported

    See http://hdrhistogram.org and https://github.com/HdrHistogram/HdrHistogram for more info on HdrHistogram.

    Related to #481 , #482 , #483
    Resolves #480

    cc @t3hnar

    opened by ghost 42
  • Duplicate metrics when exposing prometheus metrics via spring boot

    Duplicate metrics when exposing prometheus metrics via spring boot

    I've got a number of duplicate prometheus metrics in my spring boot app (ex: normalized_servo_rest_totaltime:

    # HELP gauge_servo_response_assetmgmt_star_star gauge_servo_response_assetmgmt_star_star
    # TYPE gauge_servo_response_assetmgmt_star_star gauge
    gauge_servo_response_assetmgmt_star_star 16.0
    # HELP gauge_servo_response_star_star gauge_servo_response_star_star
    # TYPE gauge_servo_response_star_star gauge
    gauge_servo_response_star_star 13.0
    # HELP normalized_servo_rest_totaltime normalized_servo_rest_totaltime
    # TYPE normalized_servo_rest_totaltime gauge
    normalized_servo_rest_totaltime 0.0
    # HELP normalized_servo_rest_count normalized_servo_rest_count
    # TYPE normalized_servo_rest_count gauge
    normalized_servo_rest_count 0.0
    # HELP gauge_servo_rest_min gauge_servo_rest_min
    # TYPE gauge_servo_rest_min gauge
    gauge_servo_rest_min 0.0
    # HELP gauge_servo_rest_max gauge_servo_rest_max
    # TYPE gauge_servo_rest_max gauge
    gauge_servo_rest_max 0.0
    # HELP gauge_servo_response_error gauge_servo_response_error
    # TYPE gauge_servo_response_error gauge
    gauge_servo_response_error 10098.0
    # HELP gauge_servo_response_star_star_favicon_ico gauge_servo_response_star_star_favicon_ico
    # TYPE gauge_servo_response_star_star_favicon_ico gauge
    gauge_servo_response_star_star_favicon_ico 6.0
    # HELP gauge_servo_response_prometheus gauge_servo_response_prometheus
    # TYPE gauge_servo_response_prometheus gauge
    gauge_servo_response_prometheus 0.0
    # HELP gauge_servo_response_uaa_star_star gauge_servo_response_uaa_star_star
    # TYPE gauge_servo_response_uaa_star_star gauge
    gauge_servo_response_uaa_star_star 7.0
    # HELP normalized_servo_rest_totaltime normalized_servo_rest_totaltime
    # TYPE normalized_servo_rest_totaltime gauge
    normalized_servo_rest_totaltime 0.0
    # HELP normalized_servo_rest_count normalized_servo_rest_count
    # TYPE normalized_servo_rest_count gauge
    normalized_servo_rest_count 0.0
    # HELP gauge_servo_rest_min gauge_servo_rest_min
    # TYPE gauge_servo_rest_min gauge
    gauge_servo_rest_min 0.0
    # HELP gauge_servo_rest_max gauge_servo_rest_max
    # TYPE gauge_servo_rest_max gauge
    gauge_servo_rest_max 0.0
    

    In my spring boot metrics I don't see any duplicates

    "gauge.servo.response.assetmgmt.star-star": 16,
    "gauge.servo.response.star-star": 13,
    "normalized.servo.restclient.totaltime": 0,
    "normalized.servo.restclient.count": 0,
    "gauge.servo.restclient.min": 0,
    "gauge.servo.restclient.max": 0,
    "normalized.servo.rest.totaltime": 0,
    "normalized.servo.rest.count": 0,
    "gauge.servo.rest.min": 0,
    "gauge.servo.rest.max": 0,
    "gauge.servo.response.error": 10098,
    "gauge.servo.response.star-star.favicon.ico": 6,
    "gauge.servo.response.prometheus": 2,
    
    opened by ddewaele 34
  • Add MetricsFormatter to allow develops could collect metrics by their own way.

    Add MetricsFormatter to allow develops could collect metrics by their own way.

    Add MetricsFormatter to allow develops collect metrics by their own way. For more context, you can see https://github.com/prometheus/client_java/pull/782

    opened by tjiuming 31
  • Convert client_java to OpenMetrics

    Convert client_java to OpenMetrics

    This switches the core data model to OM, adds support for negotiating and exposing OpenMetrics format, adds units, created time, and adds new direct instrumentation for Info and Enum.

    This is done as gracefully as practical, but this will break users - in particular if a) they have counters lacking a _total suffix in which case the sample names will change or b) if they happen to be using UNTYPED which is now called UNKNOWN in which case they'll need up update their code.

    opened by brian-brazil 30
  • [Spring Boot] Collector registered multiple times

    [Spring Boot] Collector registered multiple times

    Hello

    In Spring Boot implementation there are some issues with registering of Collectors:

    • in tests I am using different @SpringBootTest configurations, some tests failed on multiple registering of the same collector
    • dev tools after recompiling does not started, again failed on multiple registration

    After some experiments, I have found the solution. The problem is that it is used CollectorRegistry.defaultRegistry. Using created bean, all works. Can you add support for injecting of CollectorRegistry as Bean? For example:

    	@Bean
    	public CollectorRegistry collectorRegistry() {
    		return new CollectorRegistry(true);
    	}
    
    opened by lupo112 26
  • Collector.register's signature doesn't make sense

    Collector.register's signature doesn't make sense

    Hi,

    the current signature of Collector.register is

    public <T extends Collector> T register(CollectorRegistry registry)
    

    This doesn't make sense, there is no correct implementation of such a signature. It is impossible to return something of type T for every subtype T of Collector, yet this is what the signature promises. Among others, this leads to dead code warnings when using this library with the Scala programming language.

    I can see two possible solutions to this problem: simplify the method's return type to Collector or void, or make T a type parameter of the Collector class itself like so:

    public abstract class Collector<T extends Collector> {
      …
      protected abstract T self(); // override in subclasses to return `this`
      public T register(CollectorRegistry registry) {
        registry.register(this);
        return self();
      }
      …
    }
    
    opened by mberndt123 22
  • Allow configuration of collector registry used

    Allow configuration of collector registry used

    Currently, the registry is hard-coded to the default registry. With this change, this would no longer be the case without changing the default behavior where no custom registry is registered.

    opened by raphw 22
  • Improve CKMSQuantiles and address memory leak

    Improve CKMSQuantiles and address memory leak

    CKMSQuantiles is copied from an implementation in 2012, where it states that a ‘HACK’ was done, admitting a space leak. This is observed by https://github.com/umbrant/QuantileEstimation/issues/2, but never addressed. This leak has been noticed several times in Prometheus context (#422, #550, #654). By correctly applying the algorithm from the paper we fix the leak.

    I have added unit-tests to show that the class's behaviour is correct. I have also added a benchmark in the benchmark module showing the difference with the old (moved to the benchmark module) and current implementation.

    According to my benchmarks, is in the new implementation a get of a quantile that has ‘seen’ 1 million elements 440 times faster. Inserting 1 million elements is 3.5 times faster.

    The amount of samples needed to keep its accuracy (within error bounds) is 80 times less than the previous implementation, and according to manual testing more or less constant, while the old implementation grows with the number of observed items (hence the space leak comment).

    New
    Q(0,50, 0,050) was 500461,000 (off by 0,000)
    Q(0,90, 0,010) was 895809,000 (off by 0,004)
    Q(0,95, 0,005) was 947982,000 (off by 0,002)
    Q(0,99, 0,001) was 989100,000 (off by 0,001)
    Time (ms): 282
    # of samples: 41
    
    Old
    Q(0,50, 0,050) was 500400,000 (off by 0,000)
    Q(0,90, 0,010) was 900874,000 (off by 0,001)
    Q(0,95, 0,005) was 950874,000 (off by 0,001)
    Q(0,99, 0,001) was 990974,000 (off by 0,001)
    Time (ms): 441
    # of samples: 3246
    

    While going through the CKMS paper and the Java implementation I have added remarks and snippets from the paper, to clarify why certain choices are made.

    edit: added benchmark results.

    Benchmark results

       Benchmark                                             (value)  Mode  Cnt    Score   Error  Units
       CKMSQuantileBenchmark.ckmsQuantileInsertBenchmark       10000  avgt    4    0,476 ± 0,011  ms/op
       CKMSQuantileBenchmark.ckmsQuantileInsertBenchmark      100000  avgt    4    4,794 ± 0,167  ms/op
       CKMSQuantileBenchmark.ckmsQuantileInsertBenchmark     1000000  avgt    4   49,373 ± 2,321  ms/op
       CKMSQuantileBenchmark.ckmsQuantileOldInsertBenchmark    10000  avgt    4    0,398 ± 0,023  ms/op
       CKMSQuantileBenchmark.ckmsQuantileOldInsertBenchmark   100000  avgt    4    6,265 ± 0,253  ms/op
       CKMSQuantileBenchmark.ckmsQuantileOldInsertBenchmark  1000000  avgt    4  184,418 ± 8,570  ms/op
     
    
       Benchmark                                       Mode  Cnt    Score    Error  Units
       CKMSQuantileBenchmark.ckmsQuantileGetBenchmark  avgt    8  292,048 ± 35,153  ns/op
       CKMSQuantileBenchmark.ckmsQuantileOldGetBenchmark  avgt    4  128559,874 ± 1801,818  ns/op
    
    opened by DieBauer 21
  • Add label and mapping support in dropwizard metric exporter

    Add label and mapping support in dropwizard metric exporter

    Introcude a metric mapper (higly inspired from jmx_exporter code) that allows to map dropwizard metrics to target metric and labels.

    This code will be re-used in jmx_exporter in a further review.

    opened by dopuskh3 21
  • Initial version of new java client for prometheus.

    Initial version of new java client for prometheus.

    This is based on the existing client, with the following changes:

    • No external dependencies in core client
    • Number of labels is fixed
    • Initilises to 0 when there's no labels
    • Convenience methods for no labels
    • Support for multiple registries
    • Only supports text output format

    This code is MVP, there's no validation of metric or label names, AtomicDouble might be better in Counter/Gauge and I'm sure there's a better way to architect all this class wise (the api is a bit text format specific for Summary for example).

    opened by brian-brazil 20
  • Spring Boot Client worked on Spring Boot 2.0.0.M3 but fails on 2.0.0.M4

    Spring Boot Client worked on Spring Boot 2.0.0.M3 but fails on 2.0.0.M4

    I just tried to upgrade my Spring Boot from 2.0.0.M3 to M4, but the Prometheus Client failed with a ClassNotFoundException. It worked fine on M3. Was that by coincidence or is it tested?

    Stacktrace: nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class io.prometheus.client.spring.boot.PrometheusEndpointConfiguration at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:620) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:300) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:166) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:271) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:94) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:693) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386) at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:138) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99) at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117) ... 62 common frames omitted Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class io.prometheus.client.spring.boot.PrometheusEndpointConfiguration at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:169) at org.springframework.context.annotation.ConfigurationClassParser.retrieveBeanMethodMetadata(ConfigurationClassParser.java:390) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:315) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.processImports(ConfigurationClassParser.java:610) ... 78 common frames omitted Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/actuate/endpoint/AbstractEndpoint at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:158) ... 82 common frames omitted Caused by: java.lang.ClassNotFoundException: org.springframework.boot.actuate.endpoint.AbstractEndpoint at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 98 common frames omitted

    opened by nickstolwijk 19
  • Add Java Flight Recorder based instrumentation as an alternative to MX Bean instrumentation.

    Add Java Flight Recorder based instrumentation as an alternative to MX Bean instrumentation.

    The simpleclient_hotspot library observes metrics about Java applications using Java's old MX bean architecture (JMX). Java versions 14+ offer a newer better way to observe these types of metrics about running Java applications: Java Flight Recorder (JFR) Event Streaming.

    The Prometheus Java library should continue offering the JMX-based simpleclient_hotspot for applications running older versions of Java, such as Java 11, but should add a newer alternative, simpleclient_jfr (or something similar) that is based on the newer architecture for applications running Java 17+. Ideally, make this new option JPMS friendly with a module-info.java so end-applications can use jlink packaging which requires dependency libraries to have module-info.java defined.

    opened by claytonwohl 1
  • Can we set PROMETHEUS_DISABLE_CREATED_SERIES as true using java API instead of environment variables.

    Can we set PROMETHEUS_DISABLE_CREATED_SERIES as true using java API instead of environment variables.

    If we have many pods, we can't change environment variables / yamls for the same to set this variable. Is there any java api to set this PROMETHEUS_DISABLE_CREATED_SERIES

    Reference

    Environment variable PROMETHEUS_DISABLE_CREATED_SERIES=true for disabling _created metrics

    https://github.com/prometheus/client_java/pull/791/files#diff-a3ff4db5a46bb0bba0d2bfa53335ab96214c125a51e1e3345a69f2f012f41a0d

    opened by muthuveerappan 1
  • Bump spring-web from 4.3.30.RELEASE to 6.0.0 in /simpleclient_spring_web

    Bump spring-web from 4.3.30.RELEASE to 6.0.0 in /simpleclient_spring_web

    Bumps spring-web from 4.3.30.RELEASE to 6.0.0.

    Release notes

    Sourced from spring-web's releases.

    v6.0.0

    See What's New in Spring Framework 6.x and Upgrading to Spring Framework 6.x for upgrade instructions and details of new features.

    :star: New Features

    • Avoid direct URL construction and URL equality checks #29486
    • Simplify creating RFC 7807 responses from functional endpoints #29462
    • Allow test classes to provide runtime hints via declarative mechanisms #29455

    :notebook_with_decorative_cover: Documentation

    • Align javadoc of DefaultParameterNameDiscoverer with its behavior #29494
    • Document AOT support in the TestContext framework #29482
    • Document Ahead of Time processing in the reference guide #29350

    :hammer: Dependency Upgrades

    • Upgrade to Reactor 2022.0.0 #29465

    :heart: Contributors

    Thank you to all the contributors who worked on this release:

    @​ophiuhus and @​wilkinsona

    v6.0.0-RC4

    :star: New Features

    • Introduce DataFieldMaxValueIncrementer for SQL Server sequences #29447
    • Introduce findAllAnnotationsOnBean variant on ListableBeanFactory #29446
    • Introduce support for Jakarta WebSocket 2.1 #29436
    • Allow @ControllerAdvice in WebFlux to handle exceptions before a handler is selected #22991

    :lady_beetle: Bug Fixes

    • Bean with unresolved generics do not use fallback algorithms with AOT #29454
    • TomcatRequestUpgradeStrategy is not compatible with Tomcat 10.1 #29434
    • Autowiring of a generic type produced by a factory bean fails after AOT processing #29385

    :notebook_with_decorative_cover: Documentation

    • Reference PDF containing full docs not available #28451

    :hammer: Dependency Upgrades

    • Revisit Servlet API baseline: Servlet 6.0 in the build, Servlet 5.0 compatibility at runtime #29435
    • Upgrade to Context Propagation 1.0.0 #29442
    • Upgrade to Jackson 2.14.0 #29351
    • Upgrade to Micrometer 1.10.0 #29441

    ... (truncated)

    Commits
    • 5a30a43 Release v6.0.0
    • 42856ba Add milestone repo for optional Netty 5 support
    • 9be6cea Polishing deprecated methods
    • 37b4391 Align javadoc of DefaultParameterNameDiscoverer with its behavior
    • 09a58a5 Polish
    • 10f4ad1 Assert fixed in DefaultErrorResponseBuilder
    • 9457ed3 Document AOT support in the TestContext framework
    • 074ec97 Fix section formatting in the testing chapter
    • 9ede4af Revert "Ignore HttpComponents Javadoc"
    • bfc1251 Merge branch '5.3.x'
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • [feature] Introduce metrics aggregation by labelNames

    [feature] Introduce metrics aggregation by labelNames

    Currently, in Prometheus client, we don't have metrics aggregations, the exposed metrics data is the origin data. For a example:

    Counter c = Counter.build("metrics_name", "help").labelNames("cluster", "namespace", "topic").create();
    c. labels("a1", "b1", "c1").inc();
    c. labels("a1", "b1", "c2").inc();
    c. labels("a1", "b2", "c3").inc();
    c. labels("a1", "b2", "c3").inc();
    

    the exposed metrics as below:

    metrics_name_total{cluster="a1", namespace="b1", topic="c1"} 1
    metrics_name_total{cluster="a1", namespace="b1", topic="c2"} 1
    metrics_name_total{cluster="a1", namespace="b2", topic="c3"} 1
    metrics_name_total{cluster="a1", namespace="b2", topic="c4"} 1
    

    But in some conditions, we want to expose the metrics in custom levels. Say, expose metrics data in cluster level as below:

    metrics_name_total{cluster="a1"} 4
    

    or in [cluster, namespace] level as below:

    metrics_name_total{cluster="a1", namespace="b1"} 2
    metrics_name_total{cluster="a1", namespace="b2"} 2
    

    If this request is feasible, it will greatly reduce the pressure on the Prometheus Server side. And also benefits to the Client side, because it can reduce the size of the response body.

    Implementation

    Aggregator

    We can introduce 2 aggregators, SUM and AVG. For COUNTER/GAUGE/HISTOGRAM, we can apply the SUM aggregator to them, for SUMMARY, we can apply AVG and SUM aggregators to it.

    Gauge:

    Gauge g = Gauge.build("metrics_name", "help").labelNames("cluster", "namespace", "topic").create();
    g. labels("a1", "b1", "c1").inc();
    g. labels("a1", "b1", "c2").inc();
    g. labels("a1", "b2", "c3").inc();
    g. labels("a1", "b2", "c3").inc();
    

    The origin data:

    metrics_name{cluster="a1", namespace="b1", topic="c1"} 1
    metrics_name{cluster="a1", namespace="b1", topic="c2"} 1
    metrics_name{cluster="a1", namespace="b2", topic="c3"} 1
    metrics_name{cluster="a1", namespace="b2", topic="c4"} 1
    

    Aggregate in cluster level:

    metrics_name{cluster="a1"} 4
    

    Aggregate in [cluster, namespace] level:

    metrics_name{cluster="a1", namespace="b1"} 2
    metrics_name{cluster="a1", namespace="b2"} 2
    

    Counter:

    Counter c = Counter.build("metrics_name", "help").labelNames("cluster", "namespace", "topic").create();
    c. labels("a1", "b1", "c1").inc();
    c. labels("a1", "b1", "c2").inc();
    c. labels("a1", "b2", "c3").inc();
    c. labels("a1", "b2", "c3").inc();
    

    The origin data:

    metrics_name_total{cluster="a1", namespace="b1", topic="c1"} 1
    metrics_name_total{cluster="a1", namespace="b1", topic="c2"} 1
    metrics_name_total{cluster="a1", namespace="b2", topic="c3"} 1
    metrics_name_total{cluster="a1", namespace="b2", topic="c4"} 1
    

    Aggregate in cluster level:

    metrics_name_total{cluster="a1"} 4
    

    Aggregate in [cluster, namespace] level:

    metrics_name_total{cluster="a1", namespace="b1"} 2
    metrics_name_total{cluster="a1", namespace="b2"} 2
    

    Histogram:

    Histogram h = Histogram.build("metrics_name", "help").buckets(100, 200, 500).create();
    h.labels("a1", "b1", "c1").observe(50);
    h.labels("a1", "b1", "c1").observe(150);
    h.labels("a1", "b1", "c1").observe(400);
    h.labels("a1", "b1", "c2").observe(50);
    h.labels("a1", "b1", "c2").observe(150);
    h.labels("a1", "b1", "c2").observe(400);
    h.labels("a1", "b2", "c3").observe(50);
    h.labels("a1", "b2", "c3").observe(150);
    h.labels("a1", "b2", "c3").observe(400);
    h.labels("a1", "b2", "c4").observe(50);
    h.labels("a1", "b2", "c4").observe(150);
    h.labels("a1", "b2", "c4").observe(400);
    

    The origin data:

    metrics_name_bucket{cluster="a1",namespace="b1",topic="c1",le="100.0",} 1.0
    metrics_name_bucket{cluster="a1",namespace="b1",topic="c1",le="200.0",} 2.0
    metrics_name_bucket{cluster="a1",namespace="b1",topic="c1",le="500.0",} 3.0
    metrics_name_bucket{cluster="a1",namespace="b1",topic="c1",le="+Inf",} 3.0
    metrics_name_count{cluster="a1",namespace="b1",topic="c1",} 3.0
    metrics_name_sum{cluster="a1",namespace="b1",topic="c1",} 600.0
    
    metrics_name_bucket{cluster="a1",namespace="b1",topic="c2",le="100.0",} 1.0
    metrics_name_bucket{cluster="a1",namespace="b1",topic="c2",le="200.0",} 2.0
    metrics_name_bucket{cluster="a1",namespace="b1",topic="c2",le="500.0",} 3.0
    metrics_name_bucket{cluster="a1",namespace="b1",topic="c2",le="+Inf",} 3.0
    metrics_name_count{cluster="a1",namespace="b1",topic="c2",} 3.0
    metrics_name_sum{cluster="a1",namespace="b1",topic="c2",} 600.0
    
    metrics_name_bucket{cluster="a1",namespace="b2",topic="c3",le="100.0",} 1.0
    metrics_name_bucket{cluster="a1",namespace="b2",topic="c3",le="200.0",} 2.0
    metrics_name_bucket{cluster="a1",namespace="b2",topic="c3",le="500.0",} 3.0
    metrics_name_bucket{cluster="a1",namespace="b2",topic="c3",le="+Inf",} 3.0
    metrics_name_count{cluster="a1",namespace="b2",topic="c3",} 3.0
    metrics_name_sum{cluster="a1",namespace="b2",topic="c3",} 600.0
    
    metrics_name_bucket{cluster="a1",namespace="b2",topic="c4",le="100.0",} 1.0
    metrics_name_bucket{cluster="a1",namespace="b2",topic="c4",le="200.0",} 2.0
    metrics_name_bucket{cluster="a1",namespace="b2",topic="c4",le="500.0",} 3.0
    metrics_name_bucket{cluster="a1",namespace="b2",topic="c4",le="+Inf",} 3.0
    metrics_name_count{cluster="a1",namespace="b2",topic="c4",} 3.0
    metrics_name_sum{cluster="a1",namespace="b2",topic="c4",} 600.0
    

    Aggregate in cluster level:

    metrics_name_bucket{cluster="a1",le="100.0",} 4.0
    metrics_name_bucket{cluster="a1",le="200.0",} 8.0
    metrics_name_bucket{cluster="a1",le="500.0",} 12.0
    metrics_name_bucket{cluster="a1",le="+Inf",} 12.0
    metrics_name_count{cluster="a1",} 12.0
    metrics_name_sum{cluster="a1",} 2400.0
    

    Aggregate in [cluster, namespace] level:

    metrics_name_bucket{cluster="a1",namespace="b2",le="100.0",} 2.0
    metrics_name_bucket{cluster="a1",namespace="b2",le="200.0",} 4.0
    metrics_name_bucket{cluster="a1",namespace="b2",le="500.0",} 6.0
    metrics_name_bucket{cluster="a1",namespace="b2",le="+Inf",} 6.0
    metrics_name_count{cluster="a1",namespace="b2",} 6.0
    metrics_name_sum{cluster="a1",namespace="b2",} 1200.0
    
    metrics_name_bucket{cluster="a1",namespace="b1",le="100.0",} 2.0
    metrics_name_bucket{cluster="a1",namespace="b1",le="200.0",} 4.0
    metrics_name_bucket{cluster="a1",namespace="b1",le="500.0",} 6.0
    metrics_name_bucket{cluster="a1",namespace="b1",le="+Inf",} 6.0
    metrics_name_count{cluster="a1",namespace="b1",} 6.0
    metrics_name_sum{cluster="a1",namespace="b1",} 1200.0
    

    Summary

    Unlike the above meters, SUMMARY is special. For metrics_name_count and metrics_name_sum, we have to use the SUM aggregator. But for the timeseries with quantile label, I think AVG aggregator is the best choice.

    • [x] I'm willing to submit the PR
    opened by tjiuming 0
  • Broken build (Source option 6 is no longer supported. Use 7 or later.)

    Broken build (Source option 6 is no longer supported. Use 7 or later.)

    When I just call ./mvnw verify in the repo the build ends with the following error:

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project simpleclient_tracer_common: Compilation failure: Compilation failure: 
    [ERROR] Source option 6 is no longer supported. Use 7 or later.
    [ERROR] Target option 6 is no longer supported. Use 7 or later.
    

    Full build log

    [INFO] Scanning for projects...
    [WARNING] 
    [WARNING] Some problems were encountered while building the effective model for io.prometheus:it_exemplars_otel_agent:jar:0.16.1-SNAPSHOT
    [WARNING] 'build.plugins.plugin.version' for org.springframework.boot:spring-boot-maven-plugin is missing. @ line 76, column 15
    [WARNING] 
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
    [WARNING] 
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
    [WARNING] 
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Build Order:
    [INFO] 
    [INFO] Prometheus Java Suite                                              [pom]
    [INFO] Prometheus Java Span Context Supplier - Parent                     [pom]
    [INFO] Prometheus Java Span Context Supplier - Common                  [bundle]
    [INFO] Prometheus Java Span Context Supplier - OpenTelemetry           [bundle]
    [INFO] Prometheus Java Span Context Supplier - OpenTelemetry Agent     [bundle]
    [INFO] Prometheus Java Simpleclient                                    [bundle]
    [INFO] Prometheus Java Simpleclient Common                             [bundle]
    [INFO] Prometheus Java Simpleclient Caffeine                           [bundle]
    [INFO] Prometheus Java Simpleclient Dropwizard                         [bundle]
    [INFO] Prometheus Java Simpleclient Graphite Bridge                    [bundle]
    [INFO] Prometheus Java Simpleclient Hibernate                          [bundle]
    [INFO] Prometheus Java Simpleclient guava                              [bundle]
    [INFO] Prometheus Java Simpleclient Servlet - Common                   [bundle]
    [INFO] Prometheus Java Simpleclient Servlet - Javax                    [bundle]
    [INFO] Prometheus Java Simpleclient Hotspot                            [bundle]
    [INFO] Prometheus Java Simpleclient Httpserver                         [bundle]
    [INFO] Prometheus Java Simpleclient log4j                              [bundle]
    [INFO] Prometheus Java Simpleclient log4j2                             [bundle]
    [INFO] Prometheus Java Simpleclient logback                            [bundle]
    [INFO] Prometheus Java Simpleclient Pushgateway                        [bundle]
    [INFO] Prometheus Java Simpleclient Servlet - Jakarta                  [bundle]
    [INFO] Prometheus Java Simpleclient Spring Metrics                     [bundle]
    [INFO] Prometheus Java Simpleclient Spring Boot Metric                 [bundle]
    [INFO] Prometheus Java Simpleclient Jetty                              [bundle]
    [INFO] Prometheus Java Simpleclient Jetty JDK 8                        [bundle]
    [INFO] Prometheus Java Simpleclient Vert.x 3                           [bundle]
    [INFO] Prometheus Java Simpleclient Vert.x 4                           [bundle]
    [INFO] Prometheus Java Simpleclient BOM                                   [pom]
    [INFO] Prometheus Java Client Benchmarks                                  [jar]
    [INFO] Prometheus Java Suit - Integration Tests                           [pom]
    [INFO] Integration Tests - Common Utilities                               [jar]
    [INFO] Integration Tests - Exemplars with OpenTelemetry                   [jar]
    [INFO] Integration Tests - Exemplars with the OpenTelemetry Agent         [jar]
    [INFO] Integration Tests - Java Versions                                  [jar]
    [INFO] Integration Tests - Servlet Jakarta Exporter web.xml               [war]
    [INFO] Integration Tests - Pushgateway                                    [jar]
    [INFO] Integration Tests - log4j2                                         [jar]
    [INFO] 
    [INFO] ------------------------< io.prometheus:parent >------------------------
    [INFO] Building Prometheus Java Suite 0.16.1-SNAPSHOT                    [1/37]
    [INFO] --------------------------------[ pom ]---------------------------------
    [INFO] 
    [INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-plugin-versions) @ parent ---
    [INFO] 
    [INFO] -----------------< io.prometheus:simpleclient_tracer >------------------
    [INFO] Building Prometheus Java Span Context Supplier - Parent 0.16.1-SNAPSHOT [2/37]
    [INFO] --------------------------------[ pom ]---------------------------------
    [INFO] 
    [INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-plugin-versions) @ simpleclient_tracer ---
    [INFO] 
    [INFO] --------------< io.prometheus:simpleclient_tracer_common >--------------
    [INFO] Building Prometheus Java Span Context Supplier - Common 0.16.1-SNAPSHOT [3/37]
    [INFO] -------------------------------[ bundle ]-------------------------------
    [INFO] 
    [INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-plugin-versions) @ simpleclient_tracer_common ---
    [INFO] 
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ simpleclient_tracer_common ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory /Users/hendrikebbers/git/prometheus_client_java/simpleclient_tracer/simpleclient_tracer_common/src/main/resources
    [INFO] 
    [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ simpleclient_tracer_common ---
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 1 source file to /Users/hendrikebbers/git/prometheus_client_java/simpleclient_tracer/simpleclient_tracer_common/target/classes
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR : 
    [INFO] -------------------------------------------------------------
    [ERROR] Source option 6 is no longer supported. Use 7 or later.
    [ERROR] Target option 6 is no longer supported. Use 7 or later.
    [INFO] 2 errors 
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] Reactor Summary for Prometheus Java Suite 0.16.1-SNAPSHOT:
    [INFO] 
    [INFO] Prometheus Java Suite .............................. SUCCESS [  0.636 s]
    [INFO] Prometheus Java Span Context Supplier - Parent ..... SUCCESS [  0.016 s]
    [INFO] Prometheus Java Span Context Supplier - Common ..... FAILURE [  0.798 s]
    [INFO] Prometheus Java Span Context Supplier - OpenTelemetry SKIPPED
    [INFO] Prometheus Java Span Context Supplier - OpenTelemetry Agent SKIPPED
    [INFO] Prometheus Java Simpleclient ....................... SKIPPED
    [INFO] Prometheus Java Simpleclient Common ................ SKIPPED
    [INFO] Prometheus Java Simpleclient Caffeine .............. SKIPPED
    [INFO] Prometheus Java Simpleclient Dropwizard ............ SKIPPED
    [INFO] Prometheus Java Simpleclient Graphite Bridge ....... SKIPPED
    [INFO] Prometheus Java Simpleclient Hibernate ............. SKIPPED
    [INFO] Prometheus Java Simpleclient guava ................. SKIPPED
    [INFO] Prometheus Java Simpleclient Servlet - Common ...... SKIPPED
    [INFO] Prometheus Java Simpleclient Servlet - Javax ....... SKIPPED
    [INFO] Prometheus Java Simpleclient Hotspot ............... SKIPPED
    [INFO] Prometheus Java Simpleclient Httpserver ............ SKIPPED
    [INFO] Prometheus Java Simpleclient log4j ................. SKIPPED
    [INFO] Prometheus Java Simpleclient log4j2 ................ SKIPPED
    [INFO] Prometheus Java Simpleclient logback ............... SKIPPED
    [INFO] Prometheus Java Simpleclient Pushgateway ........... SKIPPED
    [INFO] Prometheus Java Simpleclient Servlet - Jakarta ..... SKIPPED
    [INFO] Prometheus Java Simpleclient Spring Metrics ........ SKIPPED
    [INFO] Prometheus Java Simpleclient Spring Boot Metric .... SKIPPED
    [INFO] Prometheus Java Simpleclient Jetty ................. SKIPPED
    [INFO] Prometheus Java Simpleclient Jetty JDK 8 ........... SKIPPED
    [INFO] Prometheus Java Simpleclient Vert.x 3 .............. SKIPPED
    [INFO] Prometheus Java Simpleclient Vert.x 4 .............. SKIPPED
    [INFO] Prometheus Java Simpleclient BOM ................... SKIPPED
    [INFO] Prometheus Java Client Benchmarks .................. SKIPPED
    [INFO] Prometheus Java Suit - Integration Tests ........... SKIPPED
    [INFO] Integration Tests - Common Utilities ............... SKIPPED
    [INFO] Integration Tests - Exemplars with OpenTelemetry ... SKIPPED
    [INFO] Integration Tests - Exemplars with the OpenTelemetry Agent SKIPPED
    [INFO] Integration Tests - Java Versions .................. SKIPPED
    [INFO] Integration Tests - Servlet Jakarta Exporter web.xml SKIPPED
    [INFO] Integration Tests - Pushgateway .................... SKIPPED
    [INFO] Integration Tests - log4j2 ......................... SKIPPED
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  3.061 s
    [INFO] Finished at: 2022-12-07T18:06:50+01:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project simpleclient_tracer_common: Compilation failure: Compilation failure: 
    [ERROR] Source option 6 is no longer supported. Use 7 or later.
    [ERROR] Target option 6 is no longer supported. Use 7 or later.
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    [ERROR] 
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR]   mvn <args> -rf :simpleclient_tracer_common
    
    
    opened by hendrikebbers 3
  • fix(sec): upgrade org.springframework:spring-context to 5.3.19

    fix(sec): upgrade org.springframework:spring-context to 5.3.19

    What happened?

    There are 1 security vulnerabilities found in org.springframework:spring-context 4.3.30.RELEASE

    What did I do?

    Upgrade org.springframework:spring-context from 4.3.30.RELEASE to 5.3.19 for vulnerability fix

    What did you expect to happen?

    Ideally, no insecure libs should be used.

    The specification of the pull request

    PR Specification from OSCS

    opened by pen4 0
Releases(parent-0.16.0)
  • parent-0.16.0(Jun 15, 2022)

    [ENHANCEMENT] Environment variable PROMETHEUS_DISABLE_CREATED_SERIES=true for disabling _created metrics (#791). Thanks @mindw [ENHANCEMENT] Support for OpenTelemetry trace sampling: Only traces that are sampled will be used as exemplars (#766). Thanks @fscellos [ENHANCEMENT] Handle thread IDs <= 0. Apparently Apache Zookeeper generates negative thread IDs, which causes issues in jmx_exporter (#784). Thanks @dhoard [ENHANCEMENT] Mark opentelemtry-api as optional to make it an optional dependency in OSGi (#790). Thanks @adessaigne. [ENHANCEMENT] Move servlet adapters to an internal package to avoid duplicating classes when building OSGi bundles (#789). Thanks @adessaigne [ENHANCEMENT] Extend the API of the HTTPServer.Builder to allow custom ExecutorService instances (#756). Thanks @dhoard [ENHANCEMENT] Reduce the number of core threads in HTTPServer from 5 to 1. The HTTPServer will still start up to 5 threads on demand if there are parallel requests, but it will use only 1 thread as long as requests are sequential (#786). [ENHANCEMENT] Optimize metric name sanitization: Replace the regular expression with a hard-coded optimized algorithm to improve performance (#777). Thanks @fwbrasil [BUGFIX] Fix missing Dropwizard metrics in Vertx (#780). Thanks @yaronel. [BUGFIX] Fix incorrect buffer size in the Servlet exporter (#794). Thanks @GreenRover for finding the issue and @dhoard for the fix. [BUGFIX] Fix sample name filter for the JMX metric jvm_memory_bytes_committed (#768). Thanks @SvenssonWeb [ENHANCEMENT] Lots of dependency version bumps.

    Source code(tar.gz)
    Source code(zip)
  • parent-0.15.0(Feb 5, 2022)

    Major refactoring of Quantiles in Summary metrics. This will make them faster and use less memory. The new implementation also supports two corner cases that were not possible before: You can now use .quantile(0, 0) to track the minimum observed value and .quantile(1, 0) to track the maximum observed value. Thanks a lot @DieBauer! #755

    In addition to that the release includes:

    [ENHANCEMENT] Lots of dependency version bumps. [BUGFIX] Apply ServletConfig during Servlet initialization in simpleclient_servlet and simpleclient_servlet_jakarta #739 [BUGFIX] HTTPServer: Don't send a Content-Length header when Transfer-Encoding is chunked #738. Thanks @dhoard [BUGFIX] simpleclient_log4j set the log4j dependency scope as provided so that users don't accidentally pull the log4j version used in client_java. Note: This module is for monitoring log4j version 1, in simpleclient_log4j2 the dependency is already provided. [BUGFIX] simpleclient_dropwizard set the Dropwizard dependency scope as provided so that users don't accidentally pull the Dropwizard version used in client_java.

    Source code(tar.gz)
    Source code(zip)
  • parent-0.14.1(Dec 19, 2021)

  • parent-0.14.0(Dec 18, 2021)

    Yet another log4j version update in simpleclient_log4j2: This time to 2.16.0. Note that the log4j dependency in simpleclient_log4j2 has scope provided, i.e. simpleclient_log4j2 does not ship with log4j. simpleclient_log4j2 uses whatever log4j version the monitored application provides at runtime. Updating the log4j dependency in simpleclient_log4j2 helps getting rid of security scanner warnings (see #733), but in order to eliminate the log4j vulnerability you must make sure that the application you monitor ships with an up-to-date log4j version.

    Apart from the log4j update we have a new feature:

    [ENHANCEMENT] The HTTPServer can now be configured to use SSL (#695). Thanks @dhoard.

    Source code(tar.gz)
    Source code(zip)
  • parent-0.13.0(Dec 13, 2021)

    We updated log4j to 2.15.0, which fixes the log4shell vulnerability (CVE-2021-44228) (#726). Technically simpleclient_log4j2 is not directly affected by the vulnerability, because as long as you update log4j in your monitored application simpleclient_log4j2 will pick up the updated version. However, it makes sense to remove the vulnerable versions from the dependency tree, therefore the update.

    In addition to the log4j update in simpleclient_log4j2, this release contains the following enhancements and fixes:

    [ENHANCEMENT] Allow passing a custom registry to the logback InstrumentedAppender (#690). Thanks @MatthewDolan. [BUGFIX] Correct handling of HEAD requests (#688). Thanks @dhoard. [ENHANCEMENT] Lots of more integration tests and tests with different Java versions. [ENHANCEMENT] Make HTTPMetricHandler public so that users can use them in their own HttpServers (#722). Thanks @dhoard. [ENHANCEMENT] Make Base64 encoding in the HTTP authentication for the PushGateway work with all Java versions (#698). Thanks @dhoard.

    Source code(tar.gz)
    Source code(zip)
  • parent-0.12.0(Aug 29, 2021)

    This release has a (minor) breaking change in the simpleclient_hotspot module, fixing an incompatibility with OpenMetrics:

    The metric jvm_classes_loaded from the ClassLoadingExports was renamed to jvm_classes_currently_loaded #681. The reason is that there is another metric named jvm_classes_loaded_total, and in OpenMetrics this resulted in a name conflict because the base name jvm_classes_loaded was the same, see github.com/prometheus/jmx_exporter/issues/621.

    [ENHANCEMENT] add support for Jakarta Servlet, implemented in the new simpleclient_servlet_jakarta module #647. Thanks @mmadoo for the initial PR. [ENHANCEMENT] provide a way for filtering metrics by name / name prefix. This can be configured either in the HTTPServer, or in the Servlet exporter (both javax and Jakarta). For example, if some JMX metrics cause performance issues, this can be used for excluding these metrics #680. [ENHANCEMENT] for the Servlet filter (both javax and Jakarta): Add a parameter to strip the deployment path from the path label #639. Thanks @lapo-luchini ! [ENHANCEMENT] Add HTTP Authentication to the HTTPServer #682. Thanks @dhoard. [BUGFIX] Use <packaging>bundle</packaging> everywhere so that client_java works with OSGI again #678. Thanks @bigmarvin. [BUGFIX] use the correct name for the metric type gaugehistogram in OpenMetrics (previously this was wrongly named gauge_histogram)

    Source code(tar.gz)
    Source code(zip)
  • parent-0.11.0(May 30, 2021)

    [FEATURE] Exemplars: API for adding OpenMetrics Exemplars and out-of-the-box integration with OpenTelemetry tracing (#652). [ENHANCEMENT] Introduce TestContainers integration test, for example for testing different Java versions. This means you need Docker installed to run ./mvnw verify (#652). [ENHANCEMENT] HTTPServer: Set request/response timeouts (#643). [ENHANCEMENT] HTTPServer: Make HTTPMetricHandler public so that it can be used in a custom HTTPServer (#665). [ENHANCEMENT] New JVM memory metrics: jvm_memory_pool_collection_used_bytes, jvm_memory_pool_collection_committed_bytes, jvm_memory_pool_collection_max_bytes, jvm_memory_pool_collection_init_bytes, jvm_memory_objects_pending_finalization (#661, #660). [ENHANCEMENT] Version bumps (junit, jetty, maven plugins)

    Source code(tar.gz)
    Source code(zip)
  • parent-0.10.0(Jan 25, 2021)

    With this release the client_java simpleclient switches to the OpenMetrics data model and adds support for various new OpenMetrics-related features. This should be largely seamless, however any counters which lack a _total suffix on their sample will now have it added. If you'd prefer to make that change more gradually, you should change your metric names before upgrading to this version.

    [CHANGE] Switch data model to OpenMetrics. Primarily this means that _total if present is stripped from the metric name of counters, and _total is now always a suffix on the sample value. This means that all Counter samples now have a _total suffix (#615) [CHANGE] The io.prometheus.client.Collector.Type enum' value UNTYPED renamed to UNKNOWN (#615) [FEATURE] Add Info and Enumeration metric types for direct instrumentation (#615) [FEATURE] Counter, Summary, and Histogram metrics now expose a _created sample with when their child was created (#615) [FEATURE] Add support for units (#615) [FEATURE] Add gauge histograms, info, stateset for custom collectors (#615) [FEATURE] Support negotiating and exposing OpenMetrics for all HTTP server exposition (#615 ) [FEATURE] Add ability to filter metrics in DropwizardExports (#574) [ENHANCEMENT] Handle empty label values for the pushgateway (#553) [ENHANCEMENT] Add Bill of Materials (#561) [ENHANCEMENT] Count HTTP statuses returned for servlet filter (#560) [BUGFIX] Make sure GZIPOutputStream is always closed for httpserver (#598) [BUGFIX] Specify the charset of HTTPServer response for systems not using utf-8 by default (#564)

    Source code(tar.gz)
    Source code(zip)
  • parent-0.9.0(May 11, 2020)

    [CHANGE/ENHANCEMENT] Bump caffeine dependency to 2.7.0 to support AsyncCache (#549) [ENHANCEMENT] Added health check api to simpleclient_httpserver. (#534) [ENHANCEMENT] Remove dependency on sun.misc.Unsafe, allowing building on JDK11 (#547) [ENCHAGEMENT] Wrap PrintWriter with BufferedWriter, making servlet exposition about 2x faster (#540)

    Source code(tar.gz)
    Source code(zip)
  • parent-0.8.1(Jan 23, 2020)

    [BUGFIX] Don't throw NPE if .help() wasn't called (#458) [BUGFIX]Don't wrap a RuntimeException in another RuntimeException. (#488) [BUGFIX] Make pushgateway module compile on Java 11 (#522)

    Source code(tar.gz)
    Source code(zip)
  • parent-0.8.0(Oct 23, 2019)

  • parent-0.7.0(Sep 24, 2019)

    [CHANGE/BUGFIX] Don't sanitize away colons in metric names (#498) [ENHANCEMENT] Handle slashes in pgw grouping label values. (#491) [ENHANCEMENT] Allow a specific HttpServer to be specified, so HttpsServer could be used (#471) [ENHANCEMENT] Set thread names in HTTPServer (#456) [ENHANCEMENT] Allow DefaultExports to be registered with an arbitrary CollectorRegistry (#450) [ENHANCEMENT] Slightly decrease thread contention in summary (#481) [ENHANCEMENT] Use atomics instead of synchronized for Gauge.set (#482) [BUGFIX] Fixed one way to get a ConcurrentModificationException (#495) [BUGFIX] Dropwizard: Pass on labels when no custom mapping matched (#447)

    Source code(tar.gz)
    Source code(zip)
  • parent-0.6.0(Dec 5, 2018)

    [FEATURE] Allow mapping Dropwizard metrics with Prometheus labels (#435) [FEATURE] Add MemoryAllocationExports (#434) [ENHANCEMENT] Put response body in pushgateway exception (#423) [ENHANCEMENT] Add port public getter in HTTPServer (#414) [BUGFIX] Fix HTTP header content-length when using compression (#413) [BUGFIX] GZIPOutputStream wasn't closed, which may cause a native memory leak (#426) [BUGFIX] Fix thread state metrics not being exposed (#419)

    Source code(tar.gz)
    Source code(zip)
  • parent-0.5.0(Jul 30, 2018)

    [FEATURE] Extend JVM metrics with thread states [FEATURE] Added ability to add authentication logic into pushgateway request. [FEATURE/CHANGE] Added per-query metrics in HibernateStatisticsCollector, required moving hibernate dependency to 5.2.0

    Source code(tar.gz)
    Source code(zip)
  • parent-0.4.0(May 8, 2018)

    [FEATURE] Allow timing of Callables [BUGFIX] Handle null values gracefully in DropwizardExports [BUGFIX] fix spring_web aop no such method found exception

    Source code(tar.gz)
    Source code(zip)
  • parent-0.3.0(Feb 27, 2018)

  • parent-0.2.0(Jan 24, 2018)

    [FEATURE] Add initial JVM memory area metric [FEATURE] Add max thread pool size to jetty metrics [ENCHACEMENT] Slightly more efficient creating of new children [BUGFIX] Summary does not have a _bucket time series for the ?name[]= feature

    Source code(tar.gz)
    Source code(zip)
  • parent-0.1.0(Oct 19, 2017)

    [FEATURE] Support gzip compression for HTTPServer [FEATURE] Support running HTTPServer in daemon thread [BUGFIX] Shutdown threadpool on stop() for HTTPServer

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.26(Jul 31, 2017)

    [BUGFIX/ENHANCEMENT] Make standard exports work on Java 9 JVM, and work better on IBM JVMs [BUGFIX] Don't include duplicate JettyStatisticsCollector in simpleclient_jetty_jdk8

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.25(Jul 13, 2017)

  • parent-0.0.24(Jul 10, 2017)

    [FEATURE] Accept URL in Pushgateway constructor, allowing for more than host:port [FEATURE] Add QueuedThreadPool collector for Jetty [ENHANCEMENT] Fixed types of Jetty statistics [ENHANCEMENT] Removed checked exception from MetricsFilter constructor [BUGFIX] Make Spring boot exposition work for all Accept headers [BUGFIX] Make Spring boot exposition work without ?name[]= parameter

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.23(May 29, 2017)

    [FEATURE] /metrics can be filtered using ?name= url parameter [CHANGE] Change Timer#close to not throw IOException, simplifying usage [BUGFIX] Don't double initialise servlet MetricsFilter

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.22(May 18, 2017)

    [FEATURE] Add AOP annotation for Spring method timing [FEATURE] Add Spring servlet filter for timing requests [FEATURE] Add cache size metrics to guave and caffeine [BUGFIX] Make pushing to Pushgateway work currently when file encoding is not UTF-8 [BUGFIX] Correct content type handling for spring boot annotation

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.21(Feb 20, 2017)

    [FEATURE] Hibernate collector added [FEATURE] Log4j v2 collector added [FEATURE] Guava cache collector added [FEATURE] Caffeine cache collector added [FEATURE] JVM version information added to default exports [FEATURE] Allow setting name and help in build() [FEATURE] Convenience no-labels methods added for get() [BUGFIX] Ensure writer is closed in servlet handler [ENHANCEMENT] Performance improvements to exposition

    In addition, the README now contains extensive example usage.

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.20(Jan 25, 2017)

    [FEATURE] New time() method on Summary and Histogram allows for simpler timing of code blocks for those on Java 8 [FEATURE] Added thread deadlock metrics [FEATURE] How we get process CPU time is now compatible with the IBM JVM [FEATURE] GaugeMetricFamily&friends addMetirc calls can now be chained [FEATURE] SimpleTimer utility class for advanced timing use cases

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.19(Nov 25, 2016)

    [FEATURE] Timers are now closable, allowing use with try-with-resources in Java 7+ [FEATURE] GaugeMetricFamily, CounterMetricFamily and SummaryMetricFamily make writing custom collectors easier [FEATURE] CollectorRegistry now detects duplicate registrations via describe/Describable/autoDescribe behaviour [FEATURE] Class loading stats now included in default exports

    Source code(tar.gz)
    Source code(zip)
  • 0.0.18(Oct 27, 2016)

  • parent-0.0.17(Oct 2, 2016)

    This release fixes an issue where push and pushAdd to the pushgateway were the wrong way around. When upgrading you should switch around your code.

    [BUGFIX] Fix push and pushAdd to be the right way around [BUGFIX] Changed visibility of Summary.Child.Value back to public [BUGFIX] Make tests pass on non-English locales [IMPROVEMENT] Better help strings for dropwizard metrics

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.16(Aug 13, 2016)

    [FEATURE] Quantiles for Summary metric [BUGFIX] Remove _sum from dropwizard collector, as the dropwizard Histogram does not provide any way to get this data

    Source code(tar.gz)
    Source code(zip)
  • parent-0.0.15(Jul 15, 2016)

    [FEATURE] Added sprint-boot collector [FEATURE] Added Jetty exposition [FEATURE] Added Vert.x exposition [FEATURE] Allow access to summary and histogram child fields. [ENHANCEMENT] Variables marked final and private for performance and clarity [ENHANCEMENT] Various small doc improvements

    Source code(tar.gz)
    Source code(zip)
Owner
Prometheus
Prometheus
Get inside your JVM

nudge4j · nudge4j is a tiny piece of code to help great developers understand code better, debug less, have more fun. Overview With nudge4j you can: c

lorenzo puccetti 151 Nov 4, 2022
Distributed Tracing, Metrics and Context Propagation for application running on the JVM

Kamon Kamon is a set of tools for instrumenting applications running on the JVM. The best way to get started is to go to our official Get Started Page

Kamon Open Source Project 1.4k Dec 25, 2022
JavaMelody : monitoring of JavaEE applications

JavaMelody The goal of JavaMelody is to monitor Java or Java EE applications in QA and production environments. See the Project Home, Screenshots, Use

null 2.7k Dec 28, 2022
an open source solution to application performance monitoring for java server applications

Stagemonitor is a Java monitoring agent that tightly integrates with time series databases like Elasticsearch, Graphite and InfluxDB to analyze graphe

stagemonitor 1.7k Dec 30, 2022
inspectIT is the leading Open Source APM (Application Performance Management) tool for analyzing your Java (EE) applications.

?? inspectIT OpenCensus Edition has been released ?? The inspectIT OCE project provides an improved Java agent newly developed from scratch focusing o

inspectIT 531 Dec 13, 2022
Endpoint library for the failsafe framework

Failsafe Actuator Failsafe Actuator is a Java library that provides a simple monitoring interface for Spring Boot applications that use the Failsafe l

Zalando SE 52 Dec 5, 2022
Disables JNDI lookup globally using Java agent instrumentation, mitigation for Log4Shell attacks.

NoJNDI This is a simple proof of concept agent that disables JNDI lookups globally across the JVM. This is useful for mitigating the Log4Shell attack,

Will Sargent 9 Dec 29, 2021
Test memory leak for Netty otel instrumentation

Test memory leak for Netty otel instrumentation

Oleg Zasymenko 1 Jan 27, 2022
AREX auto-instrumentation for Java.

AREX An Open Source Testing Framework with Real World Data Introduction Installation Getting Started Contributing License Introduction As your applica

ArexTest 33 Jan 4, 2023
面向开发人员、声明式的 Metrics 采集与监控系统,可以对结构化与非结构化、有界数据与无界数据进行采集,通过对采集数据进行提取、过滤、逻辑运算等处理后将结果存储流行的监控系统或存储引擎中(如 Prometheus、Nightingale、Open-Falcon)从而搭建起完整的监控体系,同时也可以结合 grafana 完成数据的可视化

介绍 AnyMetrics - 面向开发人员、声明式的 Metrics 采集与监控系统,可以对结构化与非结构化、有界数据与无界数据进行采集,通过对采集数据进行提取、过滤、逻辑运算、聚合等处理后将结果存储流行的监控系统或存储引擎中(如 Prometheus、Nightingale、Open-Falco

lichao 6 Aug 16, 2021
The Prometheus monitoring system and time series database.

Prometheus Visit prometheus.io for the full documentation, examples and guides. Prometheus, a Cloud Native Computing Foundation project, is a systems

Prometheus 46.3k Jan 10, 2023
消息推送平台 - 所使用的技术栈包括:SpringBoot、SpringDataJPA、MySQL、Docker、docker-compose、Kafka、Redis、Apollo、prometheus、Grafana、GrayLog等等

项目介绍 austin项目核心功能:发送消息 项目出现意义:只要公司内有发送消息的需求,都应该要有类似austin的项目,对各类消息进行统一发送处理。这有利于对功能的收拢,以及提高业务需求开发的效率 系统项目架构 austin项目核心流程:austin-api接收到发送消息请求,直接将请求进MQ。a

Java3y 2.9k Dec 31, 2022
Practice and testing with Java 11, Prometheus, and Spring-boot with MicroService Architecture. Designed to run on Kubernetes in minikube.

This application was written by Andrew Aslakson Built to run on minikube using kubernetes General race tracking system? Secure with Firebase Authentic

null 1 Feb 5, 2022
Spring prometheus grafana

spring-prometheus-grafana For correct operation it is necessary to make some steps: 1- Run the command docker-compose up -d --build in the terminal: 2

Thalles Vieira 2 Jan 25, 2022
Beispielprojekt für Monitoring mit Prometheus und Grafana

Beispielprojekt für Monitoring mit Prometheus und Grafana Software git Für die Java Beispiel Java JDK in Version 17. Docker und docker-compose empfohl

trion 1 Jan 27, 2022
Docker Compose Spring,Resilience4j,Prometheus,Grafana

Docker Compose Spring,Resilience4j,Prometheus,Grafana ( Circuit Breaker pattern - Retry pattern - Ratelimiter pattern - Timelimiter pattern - Bulkhead pattern )

Hüseyin Tugay Yeşilyurt 3 Mar 27, 2022
Nrich is a Java library developed at CROZ whose purpose is to make development of applications on JVM a little easier.

nrich Nrich is a Java library developed at CROZ whose purpose is to make development of applications on JVM a little easier. It contains modules that

CROZ 44 Nov 12, 2022
Build highly concurrent, distributed, and resilient message-driven applications on the JVM

Akka We believe that writing correct concurrent & distributed, resilient and elastic applications is too hard. Most of the time it's because we are us

Akka Project 12.6k Jan 3, 2023
Vert.x is a tool-kit for building reactive applications on the JVM

Vert.x Core This is the repository for Vert.x core. Vert.x core contains fairly low-level functionality, including support for HTTP, TCP, file system

Eclipse Vert.x 13.3k Jan 8, 2023