Comments (4)
@sed-i The regular expression of the official docs is not something I would like to allow since this permits a "0s" time interval (apart from being rather verbose). If you can not find pressing reason why such durations should be allowed then I am inclined to close this ticket.
from prometheus-k8s-operator.
In the prometheus source for the client side I see both the long form and the short form being used
- https://github.com/prometheus/prometheus/blob/5a754bc043b8e8c2d57cf906386734a73761e2a2/web/ui/react-app/src/utils/index.ts#L53
- https://github.com/prometheus/prometheus/blob/5a754bc043b8e8c2d57cf906386734a73761e2a2/web/ui/static/js/prom_console.js#L166
Didn't dive into go code.
from prometheus-k8s-operator.
In the prometheus source for the client side I see both the long form and the short form being used
That is a good observation. Though both their forms allow null values like "0s" and I am not aware of any reason why we would want to allow that. Hence I placed the restriction that leading digit must be non-zero. In any case we can always reopen this issue in the future if it crops up.
from prometheus-k8s-operator.
The duration must be greater than 0, which is actually sort-of at adds with the actual regex. Except that prometheus overtly checks for a return value of 0 (ok from the parser) and re-raises an error.
For the actual config, though, this is tricky. Which is actually checked from prometheus/common, so 0
is ok, (the type is declared here, and the SetValue()
call here will call back out to Set
in prometheus/common, which checks model.ParseDuration
, which does allow zeros).
And even negative values... for some reason, the importance of either is actually verified later.
All of that is a long way of saying "the code paths were walked, 0
is ok, 5d1w
is not", so despite the verbosity and allowing zero, the "long" regexp is the correct one.
from prometheus-k8s-operator.
Related Issues (20)
- Add `params` to scrape job configuration
- Inconsistent scrape interval in Prometheus and Grafana breaks graphs with `$__rate_interval`
- hardcoded scape_interval=1m is causing more issues than solving problems HOT 4
- The charm size got 10x bigger due to cygrpc.cpython-38-x86_64-linux-gnu.so with debug symbols HOT 2
- Non-functional deployment with latest/edge - /cos-prometheus-0: 404 Not Found HOT 3
- After removing the relation with scrape-inteval-config old alert rules are still in Prometheus HOT 5
- Alert rules from different sources can overwrite each other HOT 13
- Broken scrape jobs can get past our checks HOT 1
- Stuck on BlockedStatus even after `maximum_retention_size` config option changed to valid
- Out of order sample from remote write HOT 3
- [MetricsEndpointAggregator] Group name should be rendered using unit name, not app name HOT 2
- Topology labels are overridden in MetricsEndpointProvider HOT 1
- "certificates-relation-changed" hook failed during deployment HOT 4
- Set external URL as a Grafana Data Source HOT 4
- cannot stop service: promtail service does not exist HOT 1
- Internal url is rendered as the "source" in alerts HOT 2
- Charm reports permission denied when setting relation data HOT 2
- Remove the check `if alert_rules_as_dict` in `MetricsEndpointProvider`
- chore: update libraries to new major versions
- `prometheus_scrape` relation should block charm for cross-model relations 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 prometheus-k8s-operator.