prometheus / client_java Goto Github PK
View Code? Open in Web Editor NEWPrometheus instrumentation library for JVM applications
Home Page: http://prometheus.github.io/client_java/
License: Apache License 2.0
Prometheus instrumentation library for JVM applications
Home Page: http://prometheus.github.io/client_java/
License: Apache License 2.0
At some point, we want to deprecate the old client and at the same time get rid of JSON (which is deprecated and only supported by the old client).
The new simpleclient
is essentially missing two features:
Both are not strictly mandatory, but in use right now. We have to vet if an implementation makes sense.
If tags parameters include '/' ,It will response code 400. How to do? PushGateway.push(CollectoRegistry,jobname,map)
Hi,
I want to add a label to all the metrics exposed. Just like prometheus appends instance label to all the metrics of a client, I want to add it at the client level.
For example I want to add env=test to all the metrics. Is it possible? If its not possible, would you a accept a PR?
Thanks,
Goutham.
The Javadoc comment for DropwizardExports#fromCounter(String, Counter)
says "Export counter as prometheus counter" but the actual metric type being used is Gauge.
Either the Javadoc comment is wrong or the implementation is using the wrong Prometheus metric type.
https://github.com/prometheus/client_java/blob/master/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java#L272-L274 only reports the URL and the status code in case of an error pushing to pushgateway. However, the body does contain valuable information about the reason for the error. The error message should be reported, too.
I recently had the pleasure to instrument an old Java app and I found it hard to get started as the docs are missing examples.
The README has a large part on the maintenance of the library which isn't really helpful for most people that are just looking for a few simple copy-pastable snippets of code, the docs for the python library[1] is a lot better in this regard.
Hi,
I've downloaded the latest release and I am trying to deploy it. When I run mvn clean deploy
i get this download error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project parent: Failed to deploy artifacts: Could not transfer artifact io.prometheus:parent:pom:0.0.10 from/to ossrh (https://oss.sonatype.org/service/local/staging/deploy/maven2/): Failed to transfer file: https://oss.sonatype.org/service/local/staging/deploy/maven2/io/prometheus/parent/0.0.10/parent-0.0.10.pom. Return code is: 401, ReasonPhrase:Unauthorized. -> [Help 1]
What can I do here?
Thanks in advance!
Max
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,
The Spring Boot support could be improved in the following ways:
@EnablePrometheus
annotation, with parameters to enable/disable other configuration@ConditionalXXX
to override the auto-configuration classes, where users would need to customise thingsI think there may be more opportunities, but if there's an interest in doing this I'll provide a PR for review.
Make client as an OSGI Bundle to facilitate integration
It will be really upfull to integrate this client in a oOSGI bundle
Depending artifcats should be OSGI bundle too.
I hope it will possible.
For the moment I m making my proper Client
How should someone use dropwizard integration?
A small example in the README.md of the library would be very useful on how get started with simpleclient_dropwizard.
I know how to use maven and import prometheus components into my project.
But I don't know what's next and how to expose my metrics to prometheus?
Do you have a guide reference ?
Thanks.
Hi, I find that in java client , Summary support quantile, It can use targetQuantile method.
but in simple client ,Summary do not have a targetQuantile methodใ
Two questions:
1.Will you support targetQuantil later or will not support in simple client?
2.Is there any substitute way to use quantile now in simpleclient
Thank you
Since the original implementation of this was done in a hurry, I accidentally made the base type of metric values Float
. It should be Double
. This means I can drop my custom AtomicFloat
implementation and switch to Google Guava's https://code.google.com/p/guava-libraries/source/browse/guava/src/com/google/common/util/concurrent/AtomicDouble.java.
/CC: @juliusv
The Java library should support pushes to the Pushgateway.
I assume this to be a fairly easy change. (Corresponding change in the Go client library see prometheus/client_golang@c21d91c , relevant change is 30 LOC.) @matttproud @brian-brazil if you are working on client_java anyway, perhaps you can just sneak this change in somewhere? Otherwise, I'll look for somebody at Soundcloud to do it (possibly myself, but as said elsewhere, I have to come back to Java after 9 years absence - Maven was a hipster tool back then...).
Hi,
Currently, I'm using push model to submit metric from App to Prometheus.
I have concern that now client using synchronous http model which has impact to application latency.
Is that possible for java client to connect to Pushgateway via http async model?
So, there is will be less impact to application.
Thanks,
This is a problem you can encounter mostly Scala. Because Scala does type inference for parameters, if you do:
val myCounter = Counter.build().name("foo").register()
it will have type Nothing
That's because the type inference introduced in
ed184d8
cause it to infer the type from the assignment parameter, not from the type of Builder.
I'll send in a patch once I find some time to fix it.
This synchronized block introduces a blocking behavior when adding new observations:
It is the bottleneck for a load test that I'm working on. The Yourkit screenshot:
Is this usage correct?
private val cacheMetrics =
Summary.newBuilder
.namespace(Configuration.appName)
.name("cache_metrics")
.labelNames("type")
.documentation("STM cache hit/miss metrics.")
.purgeInterval(2, TimeUnit.MINUTES)
.build()
override def asyncCacheHit = {
monitor("hit")
super.asyncCacheHit
}
override def asyncCacheMiss = {
monitor("miss")
super.asyncCacheMiss
}
private def monitor(typ: String) =
cacheMetrics
.newPartial()
.labelPair("type", typ)
.apply().observe(1)
Thanks
I need to remove collector's children periodically because they are accumulated in collectors and can cause OutOfMemory error. I attempted to remove children like this:
CollectorRegistry.defaultRegistry.collectors().each {collector -> if(collector instanceof io.prometheus.client.SimpleCollector) { (collector as io.prometheus.client.SimpleCollector).clear() } }
but the method CollectorRegistry.defaultRegistry.collectors() is privat. Is there any way to remove collector's children?
If a registry containing metrics with duplicate names is pushed, a 500 is returned:
CollectorRegistry pushRegistry = new CollectorRegistry();
Gauge g1 = (Gauge) Gauge.build().name("g1").help("blah1").register(pushRegistry);
Gauge g2 = (Gauge) Gauge.build().name("g1").help("blah2").register(pushRegistry);
PushGateway pg = new PushGateway(address)
pg.push(pushRegistry, "job", "instance");
The error is not meaningful and I actually would expect that an error is thrown already when registering gauge g2.
This is related to Issue 14 in the prometheus/pushgateway repo.
I am looking to expose metrics from a set of spring-boot services to prometheus but I guess I am missing some steps to bring the two together. I have the following in my pom:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- The client -->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>0.0.18</version>
</dependency>
<!-- Hotspot JVM metrics-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>0.0.18</version>
</dependency>
<!-- Exposition servlet-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_servlet</artifactId>
<version>0.0.18</version>
</dependency>
<!-- Pushgateway exposition-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_pushgateway</artifactId>
<version>0.0.18</version>
</dependency>
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_spring_boot</artifactId>
<version>0.0.18</version>
</dependency>
and have added the annotation from the javadocs to my main class:
@EnablePrometheusEndpoint
public class Application {
public Application() {
}
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
If I run the application and navigate to any of the actuator endpoints I see metrics being reported back. The /prometheus endpoint is returning a 200 but has no additional content. Is tere something else I need to do in order to bridge to the metrics from actuator or even to get the basic hotspot metrics out?
Thanks in advance, Andrew
@grandbora and @fwbrasil reported that version 0.0.4 still resets summary counters, which was intended to be fixed following this discussion:
"I set up a counter and a histogram in the exact same places then executed the same count queries on them. While counter gave a stable count through out the time I observed, histogram lost its count data after a while and it showed that total number of requests went down. Which should not happen."
dropwizard JVM monitoring has support for "Breakdown of thread states, including deadlocks": http://metrics.dropwizard.io/3.1.0/manual/jvm/
else prometheus is on par with dropwizard metrics - I prefer using prometheus - if this gap could be closed it would be great.
I'm running java 7.045 and compiling 0.0.11-SNAPSHOT.
Also, If I skipTests, I deploy to jboss 7.1.1, but get no content back from the metrics servlet.
Running io.prometheus.client.exporter.PushGatewayTest
Tests run: 22, Failures: 0, Errors: 15, Skipped: 0, Time elapsed: 2.178 sec <<< FAILURE! - in io.prometheus.client.exporter.PushGatewayTest
testPush(io.prometheus.client.exporter.PushGatewayTest) Time elapsed: 0.058 sec <<< ERROR!
java.net.SocketException: Invalid argument
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:658)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at io.prometheus.client.exporter.PushGateway.doRequest(PushGateway.java:271)
at io.prometheus.client.exporter.PushGateway.push(PushGateway.java:73)
at io.prometheus.client.exporter.PushGatewayTest.testPush(PushGatewayTest.java:46)
testOldPushCollector(io.prometheus.client.exporter.PushGatewayTest) Time elapsed: 0.059 sec <<< ERROR!
java.net.SocketException: Invalid argument
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:658)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at io.prometheus.client.exporter.PushGateway.doRequest(PushGateway.java:271)
at io.prometheus.client.exporter.PushGateway.push(PushGateway.java:190)
at io.prometheus.client.exporter.PushGateway.push(PushGateway.java:204)
at io.prometheus.client.exporter.PushGatewayTest.testOldPushCollector(PushGatewayTest.java:220)
This doesn't work in Scala:
val httpRequests = Counter.build().name("requests_failures_total").help("Request failures.").register()
It generates the following runtime error:
Exception in thread "main" java.lang.ClassCastException: io.prometheus.client.Counter cannot be cast to scala.runtime.Nothing$
But this works:
val httpRequests : io.prometheus.client.Counter = Counter.build().name("requests_failures_total").help("Request failures.").register()
Any idea why? I'm using simpleclient 0.0.8 from Maven.
On a fast machine the request latency can end up being reported as 0.
Hello
I'm exporting Dropwizard metrics to Prometheus by using the following code, but I'm seeing some metrics are missing in Prometheus as below. Is it a known issue? Anyway to solve it?
Code:
CollectorRegistry collectorRegistry = new CollectorRegistry();
collectorRegistry.register(new DropwizardExports(environment.metrics()));
environment.admin()
.addServlet("prometheusMetrics", new MetricsServlet(collectorRegistry))
.addMapping("/metrics");
Dropwizard Metrics:
{
count: 0,
max: 0,
mean: 0,
min: 0,
p50: 0,
p75: 0,
p95: 0,
p98: 0,
p99: 0,
p999: 0,
stddev: 0,
m15_rate: 0,
m1_rate: 0,
m5_rate: 0,
mean_rate: 0,
duration_units: "seconds",
rate_units: "calls/second"
}
Prometheus Metrics:
{quantile="0.5",} 0.0
{quantile="0.75",} 0.0
{quantile="0.95",} 0.0
{quantile="0.98",} 0.0
{quantile="0.99",} 0.0
{quantile="0.999",} 0.0
count 0.0
Thanks
Hi, thanks for all the great work on this. It's been a little while since we've had a release, any chance we could cut a new release that includes some of the new clients? Please? ๐
If the JVM that runs the test is not having a default Locale that uses dots as delimiter in decimal values, such as the Swedish locale, the test will fail.
Hi
The following source files are without license headers:
./benchmark/src/main/java/io/prometheus/benchmark/CounterBenchmark.java
./benchmark/src/main/java/io/prometheus/benchmark/GaugeBenchmark.java
./benchmark/src/main/java/io/prometheus/benchmark/SummaryBenchmark.java
./simpleclient/src/main/java/io/prometheus/client/Collector.java
./simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java
./simpleclient/src/main/java/io/prometheus/client/Counter.java
./simpleclient/src/main/java/io/prometheus/client/Gauge.java
./simpleclient/src/main/java/io/prometheus/client/Histogram.java
./simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java
./simpleclient/src/main/java/io/prometheus/client/Summary.java
./simpleclient/src/test/java/io/prometheus/client/CollectorRegistryTest.java
./simpleclient/src/test/java/io/prometheus/client/CounterTest.java
./simpleclient/src/test/java/io/prometheus/client/GaugeTest.java
./simpleclient/src/test/java/io/prometheus/client/HistogramTest.java
./simpleclient/src/test/java/io/prometheus/client/SimpleCollectorTest.java
./simpleclient/src/test/java/io/prometheus/client/SummaryTest.java
./simpleclient_common/src/main/java/io/prometheus/client/exporter/common/TextFormat.java
./simpleclient_common/src/test/java/io/prometheus/client/exporter/common/TextFormatTest.java
./simpleclient_dropwizard/src/main/java/io/prometheus/client/dropwizard/DropwizardExports.java
./simpleclient_dropwizard/src/test/java/io/prometheus/client/dropwizard/DropwizardExportsTest.java
./simpleclient_graphite_bridge/src/main/java/io/prometheus/client/bridge/Graphite.java
./simpleclient_graphite_bridge/src/test/java/io/prometheus/client/bridge/GraphiteTest.java
./simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/DefaultExports.java
./simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/GarbageCollectorExports.java
./simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/MemoryPoolsExports.java
./simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/StandardExports.java
./simpleclient_hotspot/src/main/java/io/prometheus/client/hotspot/ThreadExports.java
./simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ExampleExporter.java
./simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/GarbageCollectorExportsTest.java
./simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/MemoryPoolsExportsTest.java
./simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/StandardExportsTest.java
./simpleclient_hotspot/src/test/java/io/prometheus/client/hotspot/ThreadExportsTest.java
./simpleclient_log4j/src/main/java/io/prometheus/client/log4j/InstrumentedAppender.java
./simpleclient_log4j/src/test/java/io/prometheus/client/log4j/InstrumentedAppenderTest.java
./simpleclient_logback/src/main/java/io/prometheus/client/logback/InstrumentedAppender.java
./simpleclient_logback/src/test/java/io/prometheus/client/logback/InstrumentedAppenderTest.java
./simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java
./simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/ExamplePushGateway.java
./simpleclient_pushgateway/src/test/java/io/prometheus/client/exporter/PushGatewayTest.java
./simpleclient_servlet/src/main/java/io/prometheus/client/exporter/MetricsServlet.java
./simpleclient_servlet/src/test/java/io/prometheus/client/exporter/ExampleExporter.java
Please, confirm the licensing of code and/or content/s, and add license headers
https://fedoraproject.org/wiki/Packaging:LicensingGuidelines?rd=Packaging/LicensingGuidelines#License_Clarification
Thanks in advance
Regards
Would help debugging...
spring boot has the default endpoint '/metrics',and i configure remote url like 'http://localhost:port/prometheus' ,the boot app can receive the request from prometheus, but prometheus can't find any data.what's wrong?it's the static_configs's default url can't change in configuration?
DefaultExports.initialize() will add register (among other) StandardExports.
StandardExports has two com.sun.management classes.
It will fail on a IBM JDK with:
[1/10/17 10:19:50:691 CET] 00000021 com.ibm.ws.webcontainer.webapp E SRVE0283E: Exception caught while initializing context: java.lang.ClassCastException: com.ibm.lang.management.UnixExtendedOperatingSystem incompatible with com.sun.management.OperatingSystemMXBean
at io.prometheus.client.hotspot.StandardExports.<init>(StandardExports.java:43)
at io.prometheus.client.hotspot.DefaultExports.initialize(DefaultExports.java:23)
I think it would be better to
@pcalcado reported this via mail:
I did find a very weird behaviour with the Prometheus Java client
where it only starts returning data after a while, for the very first
minutes of an app running it throws this exception:
java.lang.IllegalStateException: No samples present
26929147 2014-04-08_23:00:18.82132 at
com.matttproud.quantile.Estimator.query(Estimator.java:213)
~[quantile-0.0.1.jar:na]
26929147 2014-04-08_23:00:18.82133 at
io.prometheus.client.metrics.Summary$Child.query(Summary.java:383)
~[client-0.0.2.jar:na]
26929147 2014-04-08_23:00:18.82134 at
io.prometheus.client.metrics.Summary.annotateBuilder(Summary.java:166)
~[client-0.0.2.jar:na]
26929147 2014-04-08_23:00:18.82134 at
io.prometheus.client.metrics.Metric.dump(Metric.java:76)
~[client-0.0.2.jar:na]
26929147 2014-04-08_23:00:18.82135 at
io.prometheus.client.Prometheus.dumpProto(Prometheus.java:104)
~[client-0.0.2.jar:na]
26929147 2014-04-08_23:00:18.82137 at
io.prometheus.client.Prometheus.defaultDumpProto(Prometheus.java:182)
~[client-0.0.2.jar:na]
The built in timer is very convenient for recording measurement when you know the label before hand. However when you don't, like if responseStatusCode
is a label, and its value isn't known until the request is finishing up, then the user has to fall back to using observe
Too often I've seen users fall back to using millis
or using Guava's stopwatch (which also returns longs, encouraging millis)
It would be great to expose the Timer as a standalone timer I can read elapsed time after the fact so I can get a double that has the right units (meaning seconds).
A simpler approach that would also go along way would be to expose the nanos to seconds conversion as a static method (https://github.com/prometheus/client_java/blob/master/simpleclient/src/main/java/io/prometheus/client/Summary.java#L159)
Then an observation could be as simple as:
long startNanos = System.nanoTime();
//Do work
double durationSeconds = Summary.Timer.durationSeconds(startNanos);
//Record observation
I missed a simpleclient submodule that creates a Spring Boot Management Endpoint to expose the prometheus metrics.
The existing simpleclient_servlet module requires additional glue-code to accomplish this task.
Following #137 and #138, push
and pushAll
have been reversed.
We were using push
in the way that was working, but not according to the documentation, obviously. After upgrade (we should have checked the changelog...), we spent some time figuring out why some metrics were nullified, and then changed it to pushAll
.
However, any Prometheus java client user will have its Prometheus fail silently just by upgrading the library. It should be nice to rename and/or deprecate both methods instead in order to force developers to acknowledge this change. As it as been pointed out, those names are confusing.
Maybe only have one push
method with a mandatory param overrideWholeGroup
or fullGroup
?
jdk 1.8.0_45-b14
when running lient_java/examples/jvmstat Main.java
Exception in thread "main" java.lang.NullPointerException
at org.reflections.Reflections.scan(Reflections.java:220)
at org.reflections.Reflections.scan(Reflections.java:166)
at org.reflections.Reflections.(Reflections.java:94)
at io.prometheus.client.Prometheus.collectAnnotatedFields(Prometheus.java:190)
at io.prometheus.client.Prometheus.initialize(Prometheus.java:201)
at io.prometheus.client.Prometheus.defaultInitialize(Prometheus.java:274)
at io.prometheus.client.examples.guice.Server.configure(Server.java:47)
at io.prometheus.client.examples.guice.Main.run(Main.java:61)
at io.prometheus.client.examples.jvmstat.Main.main(Main.java:45)
This also happens when I use Prometheus.defaultInitialize();
io.prometheus.client.utility
servlet
0.0.10
Is it planned to support the 'optional timestamp' feature?
E.g. Get Prometheus to use explicitly the pushed timestamp instead of the scraping time.
More on this:
https://docs.google.com/document/d/1ZjyKiKxZV83VI9ZKAXRGKaUKK2BIWCT7oiGBKDBpjEY
Cheers,
Aron
Hi, can we have a release 0.0.7 with the new JVM metircs and the tab fixes for process memory reading, soonish? :)
Travis CI supports an old version of Maven and they recommend using Maven Wrapper to allow builds to control which version of Maven is installed and used for the build. This pattern is used in Gradle builds a lot (gradlew).
travis-ci/travis-ci#4872
https://github.com/takari/maven-wrapper
If the order of the labelNames passed in doesn't match what's in the sample, then the sample won't be found. We should handle this more gracefully.
Use prometheus client and generate histograms and push that data to graphite.
Skip prometheus server layer.
Hello! I have this error while bootstrapping of dependencies:
Retrieving io/prometheus/simpleclient/0.0.9/simpleclient-0.0.9.pom from central
Could not transfer artifact io.prometheus:simpleclient:pom:0.0.9 from/to central (https://repo1.maven.org/maven2/): Checksum validation failed, expected 6b5cd46506ce0d2f5d90b659d1134c4f8cca5bbd but is 6e5340c298b8dfc29b1c52c1c54deae77a46d69d
Reporting this because users placed a dash into a metric name, which was then not queriable via Prometheus (the query language cannot tell a dash/minus apart).
The client library should check that metric and label names are valid ones that can be queried through the query language later (and we should add the same check upon ingestion in Prometheus):
Metric names have to adhere to this regex:
[a-zA-Z_:]([a-zA-Z0-9_:])*
Similarly, label names need need to adhere to this one (basically, no colons allowed):
[a-zA-Z_]([a-zA-Z0-9_])*
There are currently no restrictions on label values.
It seems like the dependency is not necessary.
I use the simpleclient together with undertow core without servlets, so this is a mild inconvenience.
Right now I do something like this:
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${prometheus.version}</version>
<exclusions>
<exclusion>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_servlet</artifactId>
</exclusion>
</exclusions>
</dependency>
Hi,
I've found recently that Jboss server has run out of available file descriptors and all file descriptors were consumed by connections in CLOSE_WAIT state from JMX prometheus exporter to prometheus server.
I believe that only possible source of leaked descriptor in the following code: https://github.com/prometheus/client_java/blob/master/simpleclient_servlet/src/main/java/io/prometheus/client/exporter/MetricsServlet.java#L40
There print writer is not flushed / closed and left to GC / jetty if an exception happens.
Hi
During redeploy of our application we got a lot of errors regarding memory leak. (Tomcat 8 with Leak Listener enabed).
Example log:
SEVERE: The web application [ROOT] created a ThreadLocal with key of type [io.prometheus.client.Striped64.ThreadHashCode] (value [io.prometheus.client.Striped64$ThreadHashCode@7b13ffe9]) and a value of type [io.prometheus.client.Striped64.HashCode] (value [io.prometheus.client.Striped64$HashCode@184dd3c2]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
The plan is to replace JSON as the human readable format by the new simple&flat text format (v 0.0.4, see https://docs.google.com/document/d/1ZjyKiKxZV83VI9ZKAXRGKaUKK2BIWCT7oiGBKDBpjEY/edit?usp=sharing ), so that JSON support can be completely removed.
All 'rich' client libraries should therefore support the text format (even if they also support the protobuf format, which is preferred for machine-machine interaction).
This issue tracks the implementation for the Java client.
@matttproud I hope you have some cycles left to do this. If not, please unassign, and I'll see what can be done at Soundcloud.
Please check this problem - prometheus/pushgateway#68 - I don't have enough information to fix the problem.
I'm not java guru but it should be possible to read body in any case:
http://stackoverflow.com/questions/25011927/how-do-i-get-response-body-using-java-net-httpurlconnection-when-401-is-returne
http://stackoverflow.com/questions/613307/read-error-response-body-in-java
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.