Comments (1)
Digging through the source code, I have discovered that metrics with labels are treated different from metrics without labels.
Metrics without labels each have 1 counter and are initialized to 0 and always report. This is the behavior I requested above.
Metrics with labels have a vector of counters-- one for each unique label combination. Each time a log line matches the metric expression the label expression is processed and the metric vector is queried to see if there is already a counter for that label combination. If not, one is created and initialized to 0. Then the counter for the label combination is incremented by the value derived from the log line (or +1 if no value expression is declared for the counter metric). This vector of counters is sane and makes sense; how can you know all possible future combinations of labels and initialize those to 0 and report immediately? You can't and thus no metric is reported until a log line matches and the labels are derived from that log line. Fine.
I had a default configuration for grok_exporter which included the log file path as a label to all of our metrics. This caused them all to have the "labeled metric" behavior. Since my metrics do not derived their label from the matching log line, I expected the behavior of metrics without labels because my labels never change. But it still has a label and is dynamically generated (from the log path being tailed which had a matching metric expression). Fine. I don't expect grok_exporter to consider if the label expression will ever report different values. I mean, it actually could report different values if we had more than one input path and that expression matched from 2 different input paths. Anyway, all is good. I have removed the unnecessary label.
Case closed. My apologies for not initially understanding.
Thanks for the great tool!
from grok_exporter.
Related Issues (20)
- Feature Request: Option to specify ciphers or minimum TLS version HOT 2
- fail_on_missing_logfile for missing directories HOT 3
- Feature Request : Config option to expose metrics as a .prom file
- Issue reading Multiple files:
- how to match regex upper case/lower case insensitively
- Is grok able to watch only the latest log in dir?
- how to use regex group match and use matched group name label? HOT 1
- Can the latest version cover multi-line pattern match?
- if string exists HOT 7
- Use Gauge metric to find DB connectivity status HOT 1
- Exclude char HOT 2
- Does it support Elastic Search Open Distro HOT 1
- Configure for AWS ALB/CLB Logs or Cloudfront
- grok timestamp diffrent
- grok fails on insufficient permissions when fail_on_missing_logfile is false
- mutiple depth doc support HOT 1
- How can I use FuncMap to help transform data from the log, inside a template?
- match fails after encountering binary text within file
- Update or let someone else maintain this repo HOT 2
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 grok_exporter.