Comments (5)
As long as a MeterRegistry is available I guess the process of exporting the metrics is delegated to micrometer ?, so no problem there.
Since a filter has access to both request and response, I constructed a simple metrics gateway filter which counts/clocks the requests and exports to Cloudwatch. I dont know if it is the way to go but this works well.
It would be nice to have a configurable metrics filter where different metrics could be added (along with tags/dimensions) mostly from the configuration file only.
One thing I'm struggling with though, is how to handle metrics for "Variable Subsitution" URLs, without duplicating all URLs definitions of the underlying services in the gateway ? I would like 1 metric for GET /users/{id}, not 1 for each user id received (/users/1, /users/2, etc).
from spring-cloud-gateway.
@mathieufortin01 url's are not a good thing to use since routes can be matched by anything in the request, such as headers, host, & parameters, not just path. The only thing I can think of that would be useful is the route id. This use case calls for descriptive route id's. /cc @jkschneider
from spring-cloud-gateway.
@mathieufortin01 mind sharing the filter you came up with?
from spring-cloud-gateway.
By default, we get normal webflux metrics.
For this route I get the following
spencer@:~% http ":8080/actuator/metrics/http.server.requests?tag=uri:/get"
HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Type: application/vnd.spring-boot.actuator.v2+json;charset=UTF-8
Expires: 0
Pragma: no-cache
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-XSS-Protection: 1 ; mode=block
transfer-encoding: chunked
{
"availableTags": [
{
"tag": "exception",
"values": [
"none"
]
},
{
"tag": "method",
"values": [
"GET"
]
},
{
"tag": "status",
"values": [
"200"
]
}
],
"measurements": [
{
"statistic": "COUNT",
"value": 2.0
},
{
"statistic": "TOTAL_TIME",
"value": 5.001693461
},
{
"statistic": "MAX",
"value": 4.94594301
}
],
"name": "http.server.requests"
}
If we want more specific metrics, we can address those in a future release.
from spring-cloud-gateway.
Closed via 972c371
from spring-cloud-gateway.
Related Issues (20)
- Broken error handling when using DefaultRestClient that respons with error status code HOT 1
- The gateway interface proxy to other microservices has slow response processing
- separating routes into individual yaml HOT 1
- The requester maliciously modifies Content-Length>body length
- How to call REST API using Spring Webclient in global post filter using Mono.fromRunnable()
- LocalResponseCache should be aware of `Accept` request header
- grpc insecure cannot work ,grpc-server generate error: io.grpc.netty.shaded.io.netty.handler.codec.http2.Http2Exception: Unexpected HTTP/1.x
- MVC ProxyExchange does not provide observability of URI template HOT 2
- IllegalReferenceCountException while reading the data from ByteBuf HOT 6
- Latency in gateway during peak time and lots of 500 PrematureCloseException in production
- RelayToken Filter using YAML config fails
- Ambiguity in section 19 of the documentation - Spring Cloud Gateway - Custom Route Predicate
- Broken documentation links HOT 1
- AddRequestParameter double encodes parameter value HOT 1
- tcp connection amount of websocket is increasing when a large cookie is existed HOT 2
- Unable to get 405 Method not supported status code, when requested method not found HOT 5
- Route CORS configuration does not work when properties are defined in Kebab case
- Error in identifying the right Route, when the path have little differences HOT 5
- Accidentally reporting an error when using the WebClient in webflux to make an asynchronous request
- RewritePath filter is not working in properties file for gateway mvc 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 spring-cloud-gateway.