Comments (11)
Until now I'd just assumed that these paths were intended to be (effectively) /metrics/${app-name}
and /metrics/${vendor_name}
without really thinking of the implications of that kind of thing!
We could maybe consider a similar path to this kind of thing like /metric/application/${context-root}
given that the context root must be unique in any server and is a bit more friendly than a GUID. WDYT?
from microprofile-metrics.
Prepending the context-root is better than prepending a GUID. In the call we were discussing that, most of the time, there will just be one app per jvm -- which is why we thought making this a configurable option could make sense.
Given it's a context-root rather than a GUID, it might actually be tolerable to always prepend that -- to avoid people having to remember to reconfigure something when they add a second app to the server that might use some of the same libraries. Let's discuss on gitter...
from microprofile-metrics.
Just a note that I'd prefer we do not modify the metric name in that case.
We can add labels to distinguish between applications.
This allow a correct aggregation of metrics that is not possible if the metric name is different depending on its application.
Typical example is the http-count
for each server deployed in my application (or applications).
I want to be able to aggregate the HTTP metrics either for a single servlet, an application or all my servlets doing either:
http-count
(all servlets)http-count[deployment=a.war]
(all servlets in thea.war
application)http-count[deployment=a.war, servlet=foo.MyServlet]
(only thefoo.MyServlet
in thea.war
application)
It should be up to the MP Metric application to add the correct tags/labels to distinguish the metrics but this does not require to change the actual name of the metric.
(This also goes for the base
, vendor
and application
scope that could go in a scope
label instead of being prepended to the metric names...)
from microprofile-metrics.
Based on discussion in gitter, we'll aim to prepend the context root for all application-scoped metrics.
from microprofile-metrics.
as an example, if the URL was http://localhost:8080/someApp/somepath?... the metrics for that app would be preceded by someApp.
in the metric name. In the case where the context root is just /
we don't prepend anything.
from microprofile-metrics.
from microprofile-metrics.
@donbourne Why is this removed from 1.2 milestone? Since 1.2 isn't scheduled for MP 1.4 there should be enough time to find a solution for this and get it to 1.2.
Actually the PR #108 is already raised and the comments on it from @pilhuhn and me provide a non-breaking and simple solution.
from microprofile-metrics.
I'm pushing for this as FT spec is hitting the same issue when multiple apps are deployed, as it defines metrics based on the application code and hence scoped to an application: https://github.com/eclipse/microprofile-fault-tolerance/pull/257/files
from microprofile-metrics.
@jmesnil I'm very much in agreement with what you're saying about not requiring metric names to change to differentiate instances of a metric in different apps (or different servlets, per your example). I would have just given a +1 to the thumbs up, but don't want to confuse everyone as there's a parallel discussion going on about what the best place is to set the application label (app responsibility, server responsibility, or server-impl dependent?).
from microprofile-metrics.
I think this is partially resolved by #362 - there is a recommendation to append a tag containing the deployment name to metrics owned by that deployment. This doesn't completely solve name collisions, because when metrics are distinguished by a tag only, they need to have the same metadata, so clashing metrics from different deployments would have to agree on some common metadata.
Is there anything more that we want to do here or can we close it?
from microprofile-metrics.
I think #362 covers it. anyone can feel free to reopen with comments if they disagree.
from microprofile-metrics.
Related Issues (20)
- [Potential] Re-instate @RegistryType and MetricRegistry.Type, but as deprecated instead. HOT 1
- Update to use MicroProfile Parent 3.0
- `@RegistryScope` should be a qualifier HOT 3
- Consider clarifying what period of time the JAX-RS metrics measure and assumptions about timeliness of metrics updates
- Outdated dependency versions HOT 12
- Open Liberty 22.0.0.13-beta: MicroProfile Metrics 5.0 Compatible Certification Request
- ensure MP Starter works with MP Metrics 5 HOT 1
- Address the redundancy of units for the Timer metric HOT 1
- The `@Timed` annotation defaults to SECONDS when it should be NANOSECONDS.
- Errors in MicroProfile 6.0 javadoc generation HOT 4
- requirement to have consistent tag sets causes problems for multi-app app server implementations
- Clarify naming convention when `@Metric` applies to a parameter
- Clarify: Which annotations can be used on private methods? HOT 1
- Add JPMS module-info.java
- Create spec for MP Metrics 5.1 HOT 1
- Consider changing TCK tests so they do not interfere with each other or rely on ordering
- Update to use the mp-parent 3.2
- Fix optional Base Metrics TCK test where `gc.time` is checked as a counter when it should be gauge. HOT 1
- Open Liberty 22.0.0.10-beta: MicroProfile Metrics 5.1 Compatible Certification Request
- build error when doclint checks are enabled
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 microprofile-metrics.