Comments (4)
We can solve that with a new directive that would avoid the request/response to be processed by the HttpMetricsHandler
. however, the connection associated to this request would still be counted.
Would that be OK ?
from akka-http-metrics.
Also,
Metrics are still being collected with unlabelled path
You need to use pathLabeled("metrics")
to avoid the unlabelled
issue
from akka-http-metrics.
I've tried to create an ignoreMetrics
directive but this does not work well with the current design:
Before anything happens in the user code, the request is recorded in the registry. At the time the request encounters the directive, some data was already collected.
For your problem, you could expose the metrics in another server (Prometheus will need to scrap from another port):
val prometheus = CollectorRegistry.defaultRegistry
val registry = PrometheusRegistry(prometheus)
val routes = handleExceptions(appExceptionHandler) {
pathPrefixLabeled("prefix1") {
pathPrefixLabeled("prefix1_1") {
???
} ~ pathPrefixLabeled("prefix1_2") {
???
}
}
}
val futureBinding =
Http()
.newMeteredServerAt("0.0.0.0", 9000, registry)
.bindFlow(routes)
val futureMetricsBinding =
Http()
.newServerAt("0.0.0.0", 9001)
.bind(metrics(registry)(PrometheusMarshallers.marshaller))
from akka-http-metrics.
Closing the issue since not active.
from akka-http-metrics.
Related Issues (20)
- Error in stage [fr.davit.akka.http.metrics.core.MeterStage$$anon$1-MeterStage]: No value present HOT 10
- Create grafana dashboard HOT 1
- Extension methods from HttpMetrics break Http().newServerAt HOT 5
- Add a method bindFlow(handler: Flow[I,O,Mat]) to HttpMetricsServerBuilder HOT 2
- Getting error when using bindFlow : `.Error in stage [fr.davit.akka.http.metrics.core.MeterStage$$anon$1-MeterStage]: No value present HOT 2
- akka grpc
- 5xx and 4xx responses go to unlabelled when handled with AKKA `ExecutionDirectives.handleExceptions`
- Request/response headers as metric dimensions HOT 2
- Add directive to provide custom dimensions HOT 7
- Status and method labels are swapped in Prometheus metrics
- 1.7.0 not found in repos HOT 2
- bug: prometheus label issues in 1.7.0 HOT 8
- Support for Apache Pekko HOT 4
- StatusGroup / Path for requests? HOT 2
- No akka_http_responses_size_bytes_bucket for streamed endpoints
- Bug 1.4.0: java.lang.IllegalArgumentException: requirement failed: Responses with this status code must have an empty entity HOT 5
- Unable to get started with akk-http-metrics for scala Akka HTTP and prometheus. HOT 17
- Problem with big requests (>~100kb) HOT 9
- Instantiate HttpMetricsNames the same way as HttpMetricsSettings 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 akka-http-metrics.