Comments (13)
👍🏽 Thanks!
from common.
I spoke with @ywwg and I would be willing to help with this one over the holidays, could I get this one assigned to me please?
from common.
Notes from the chat:
the basic changes are:
- current code assumes there must be a metric name before "{". Now, it is ok if a line begins with "{"
- currently, terms inside {} must have an operator, like = or =~. Now, if there is a quoted term without an operator, that is the * metric name. There can only be one term without an operator.
- the left hand side of operators inside {} can be quoted
- for HELP and TYPE and UNIT lines, the metric name may be in quotes.
- best way to attack this is probably creating the test cases and then fixing the code so they all pass
from common.
In the other parsers, I changed them so they can just read the new format without a flag. It was not practical to create switching logic without duplicating all the parsers. Let's start by not using a flag.
I assume if the metric name is valid it should keep working as is.
If it has utf-8 characters it has to be quoted around in the metadata.
Yes that's correct.
The current parser supports escaping already, so it should be fine to use that escaping inside double quotes for the TYPE and HELP lines:
# HELP "my.\"noncompliant\".metric" help text
# TYPE "my.\"noncompliant\".metric" counter
from common.
I'll take this issue 👍
from common.
@jmichalek132 checking in, any progress on this?
from common.
@jmichalek132 checking in, any progress on this?
sorry unfortunately not I was sick over the holidays, but I'll take a stab at this over the weekend.
from common.
So finally looking into this today, first thing I am unclear on based on the proposal is what should be the behaviour with the metric name in the prometheus metadata.
I assume if the metric name is valid it should keep working as is.
If it has utf-8 characters it has to be quoted around in the metadata.
Is this assumption correct @ywwg ?
Examples:
This should be ok:
# HELP "my.noncompliant.metric" help text
# TYPE "my.noncompliant.metric" counter
{"my.noncompliant.metric", label="value"} 1
This is not ok due to:
Escape syntax if the metric has a quote: sum(rate({"my "quoted" metric", region="east"}[5m])) or use single quotes in PromQL (not available in the exposition format): sum(rate({'my "quoted" metric', region="east"}[5m])
# HELP 'my.noncompliant.metric' help text
# TYPE 'my.noncompliant.metric' counter
{'my.noncompliant.metric', label="value"} 1
This is not ok:
# HELP my.noncompliant.metric help text
# TYPE my.noncompliant.metric counter
{"my.noncompliant.metric", label="value"} 1
This is not ok either:
# HELP my.noncompliant.metric help text
# TYPE "my.noncompliant.metric" counter
{"my.noncompliant.metric", label="value"} 1
Also when implemeting all these changes, should I do it in a way that can turn on support for utf-8 with a flag, or just implement the changes directly.
from common.
Also when the metric name is surrounded by the double quote I assume we need to validate that if the metric name contains double qoute it's properly escaped right? Otherwise the parsing could break.
I.e. {"my "quoted\" metric", label="value"} 1
from common.
Checking in on this again, is there a PR attached?
from common.
Sorry for the delays I didn't have a chance to make much progress on this, if it's delays are an issue, please do re-assign it to someone else. Otherwise I should be able get time to work on it / publish draft next weekend.
from common.
Thanks for letting me know! yeah I think we need to move ahead on this more quickly so I'll be reassigning it. I appreciate your contribution regardless
from common.
from common.
Related Issues (20)
- Support environment variable for log level and format
- New release? HOT 3
- Implement changes needed to support UTF-8 metric and label names in Prometheus
- OAuth 2 client_secret should be optional
- LabelSet.String sorts incorrectly HOT 2
- Authorization credentials should be optional
- SigV4 panics on GET requests / requests with nil body
- web: Support jwt/bearer token auth
- Breaking change in 0.48.0 HOT 10
- Version bump in prometheus/common breaks client_golang build HOT 3
- Prometheus failing to reload Probe TLS cert and key from disk HOT 2
- Prevent incompatibility issues between common and dependent repositories HOT 5
- OpenMetrics: _total suffix repeated multiple times HOT 7
- "error encoding and sending metric family" on HTTP/2 HEAD request
- Can client.key be removed as its giving security blocker in security scan? HOT 1
- Support for: INFO type
- Support for configuring ciphersuites in tls_config
- `FmtText` was removed between v0.42.0 and v0.53.0 HOT 1
- Consolidate content type and content encoding functions in prometheus/common HOT 9
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 common.