Comments (3)
Thanks @nicu-da, I'm happy to make it configurable. Do you think 0
is a reasonable default?
from client_java.
Thank you for the quick response @fstab.
Checking the docs for close:
/**
* Stops this server by closing the listening socket and disallowing
* any new exchanges from being processed. The method will then block
* until all current exchange handlers have completed or else when
* approximately <i>delay</i> seconds have elapsed (whichever happens
* sooner). Then, all open TCP connections are closed, the background
* thread created by {@link #start()} exits, and the method returns.
* Once stopped, a {@code HttpServer} cannot be re-used.
*
* @param delay the maximum time in seconds to wait until exchanges have finished
* @throws IllegalArgumentException if delay is less than zero
*/
it sounds like using a non 0 value as a default would be saner, giving 1 second for any scrape to finish before shutting down the server. It shouldn't have an impact in most cases as even if there is a scrape ongoing, in most cases it should finish a lot quicker.
from client_java.
+1 to this request probably giving 1 sec is a saner default but let others make it 0 if they need it.
Also, we would like to have a way to pass a custom metric handler
In our use case, we want to ensure that there was at least one scrape before closing as we want to scrape tasks that can have a variable duration, and we also want to be sure that the last values are scraped.
In the old version (0.16) we could use a fake name filter to detect when it was scraped and then close the server (adding some extra delay) with the newer versions there is no way to do that so it will be nice if you could make the handler configurable (or implement an option that when close is called it waits for a last scrape until it does the server).
from client_java.
Related Issues (20)
- StatefulMetric.clear() is not implemented HOT 1
- Promethus Core Counter and Gauge Query HOT 2
- Metric `process_cpu_seconds_total` is in wrong order of magnitude HOT 1
- Added the ability to configured the HTTPServer socket timeout HOT 1
- PushGateway and JettyStatisticsCollector support in version 1 HOT 3
- Endpoint actuator/prometheus not working on macOS HOT 1
- Publish a BOM again
- Implement latest changes in the Prometheus Protobuf format
- Explicit Exception for Duplicate Labels during Scrape HOT 1
- Stress test failure in DropwizardExportsTest HOT 2
- Stress test failure in SlidingWindowTest HOT 1
- dropwizard5 MapperConfig doesn't rename the metric? HOT 4
- How to remove all metrics in the defaultRegistry HOT 5
- Failing while building simpleclient_httpserver version parent-0.15.0 using mvn clean install HOT 4
- log4j2 instrumentation support for 1.X?
- Flaky test - SlidingWindowTest
- Filter parameter causes HTTP Status 400 – Bad Request HOT 1
- info required for compatible version with openjdk21 HOT 2
- Counts in ClassicHistogramBuckets cannot be negative. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client_java.