Comments (6)
Hi @LeoQuote! Thanks for bringing this up. You're absolutely right that it should be allowed. The fact that it isn't is an oversight on my part between commits 1eb1c9a and 2b3310d.
My intention was to treat instance
like any other optional grouping key label, rather than having special code to handle it. When I later added validation for the grouping keys, I reused our LabelSetValidator
without realising that we treat instance
as a reserved label for pull-based collection (which is correct).
I don't think #276 is the right fix, as we do want to treat it as a reserved label in all other contexts. I'm going to have a think about how to solve this. My initial thought is an extra parameter in the constructor of LabelSetValidator
to override the base list of reserved labels, but I'm going to think about whether there's a neater option before implementing that.
from client_ruby.
Okay, I've done some reading, and I'm less sure I'm right now.
It looks like the Go and Python clients don't reserve the instance
label at all. They also don't reserve job
, which surprised me. I'm starting to wonder if we should drop both of them from the reserved labels list.
I'd love to make pid
more situational too, as that only needs to be reserved if the metric is a gauge being stored in a DirectFileStore
, but we'd have to break an abstraction there and I think it would feel really clunky for users.
I'm going to chat with the Prometheus team and see what they think. I suspect the answer is going to bring us closer to the other clients.
For reference:
- The relevant code in the Python client checks that you don't use any invalid characters and you don't use a
__
prefix. - The relevant code in the Go client does the same thing, though by importing some common code.
from client_ruby.
I’m in favor of the implementation in go and python client , which is don’t explicitly reserve any label. It should be user who decide whether or not use those labels and these can be respected or not respected with “honor labels” field in scrape config https://prometheus.io/docs/prometheus/latest/configuration/configuration/
from client_ruby.
Totally agree.
I'm pretty confident we can stop reserving job
and instance
. pid
will be trickier, but I'm going to see what we can do. It might not all happen at once.
from client_ruby.
Note the default behaviour of Prometheus is to rename job
and instance
to exported_job
and exported_instance
.
honor_labels
changes this behaviour, but was intended for cases where they have the same meaning as the internally-generated labels.
# Setting honor_labels to "true" is useful for use cases such as federation and
# scraping the Pushgateway, where all labels specified in the target should be
# preserved.
from client_ruby.
@bboreham Cheers for the clarification. I've replied on the mailing list thread with my plan, and I'm going to do the easy first part now.
from client_ruby.
Related Issues (20)
- specifying ip-address and portnumber HOT 6
- CPU usage growing over time with DirectFileStore HOT 1
- better path handling HOT 14
- Update README.md with changes to pushgateway client
- Update CHANGELOG.md for 3.0.0 release HOT 1
- `generate_path` yields incorrect values for Sinatra+Rack::Build apps HOT 6
- Exporter port option doesn't work HOT 2
- Counter metric is reset when it has no labels HOT 8
- ERROR: Permission to prometheus/client_ruby.git denied HOT 2
- The rack example does not work because of `Rack::Lint::LintError` HOT 1
- Aaup HOT 1
- How to metrify ActiveRecord sql queries and Redis jobs (sidekiq/resque)? HOT 1
- Fix `Rack` deprecation warning
- Improving DirectFileStore for performance and scalability HOT 18
- Implement native histograms support HOT 4
- cannot load such file -- prometheus/middleware/collector (LoadError) HOT 2
- Job name for pushgateway can't be a symbol HOT 1
- UTF-8: Implement support in Ruby client library HOT 5
- How can I change how paths are labelled? 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_ruby.