Comments (4)
Oh Thanks.
-relabelConfig string
Optional path to a file with relabeling rules, which are applied to all the ingested metrics. The path can point either to local file or to http url. See https://docs.victoriametrics.com/#relabeling for details. The config is reloaded on SIGHUP signal
Somehow missed this, google keep sending me to
https://docs.victoriametrics.com/vmagent/#relabeling
instead of
https://docs.victoriametrics.com/#relabeling
And somehow my fault too for not realizing there are two relabeling docs.
Going to try it now.
from victoriametrics.
All working now, following the https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config spec since victoriametrics points me that the spec to follow. And the guidance of https://valyala.medium.com/how-to-use-relabeling-in-prometheus-and-victoriametrics-8b90fc22c4b2
For anyone intered for droping metrics for go_ and process_ for example just write this in the file pointed by -relabelConfig
- action: drop
source_labels: [__name__]
regex: "go_.+|process_.+"
Thanks to vylyala post, if someone whats to drop go_ and process_ metrics only if the have a specific label or labels remeber they are parsed as: label1;label2;etc
for regex.
The doc is all over the place but is nice to read and easy to find :)
quoting:
Then source_labels contains multiple labels, they are concatenated with ; char before matching the provided regex.
For example, the following relabeling rule would drop metric with {job="foo",instance="bar"} labels:
- action: drop
source_labels: [job, instance]
regex: "foo;bar"
from victoriametrics.
I haven't tried it myself but there are some documents related to it:
https://docs.victoriametrics.com/single-server-victoriametrics/#relabeling
Also, if you are looking at the source code and issues of vminsert
, you could find:
- people are using
-relabelConfig
flag invminsert
: #638 - For prometheus remote-write handler,
vminsert
will check if relabel config exists and do:
Please try it out and provide feedback here. I would be happy to test it myself if you encounter any unexpected issues while following the documentation.
from victoriametrics.
Just to add for anyone looking at this in the future.
Since RE2 regex doen't support negative lookahead for words we have to use the enhancements made for relabeling from https://docs.victoriametrics.com/vmagent/#relabeling-enhancements
(It's in the vmagent section but works perfectly from victoriametrics process single)
Example to drop all metrics that match a regex except for a particular job named victoriametrics:
# Drop all metrics that containt go_ OR process_ ONLY IF job != "victoriametrics"
- action: drop
if:
- '{job != "victoriametrics"}'
source_labels: [__name__]
regex:
- "go_.+"
- "process_.+"
# Now drop only go_ metrics (while keeping process_ intact) of the metrics from job victoriametrics
- action: drop
if:
- '{job = "victoriametrics"}'
source_labels: [__name__]
regex:
- "go_.+"
from victoriametrics.
Related Issues (20)
- How to add label ? HOT 4
- Alerting rule `RecordingRulesNoData`'s annotations use missing `recording` label HOT 1
- In the victoria-logs ui make the relative range control relative to the time when the query is run.
- victorialogs: optimize sort performance
- Vm auth: if the request does not fully cache the body to buf due to server connection disconnection, it will not be retried. HOT 1
- No data for several endpoints, including Active Targets HOT 2
- vmauth: a way to stop proxying Host header
- vmselect gets timeout when request /api/v1/label/.../values HOT 8
- The metric `process_resident_memory_bytes` was not calculated correctly HOT 1
- Global WITH templates in vmselect / vmsingle
- vmauth cannot start with empty configuration. HOT 1
- vmauth: default httpserver incorrectly exposed
- VMAlert oauth2 error HOT 1
- vmagent using k8s endpoint role for pod role jobs HOT 6
- kube-scheduler and kube-controller-manager scrape tls issue on victoria-metrics-k8s-stack HOT 3
- Add type parameter to prometheus metrics in vmagent HOT 2
- GetRowsDiff func takes a lot of time when vmagent pushes kube-state-metrics data HOT 3
- Using Query from the beginning of the day HOT 1
- Allow VMAlert to replay alerts till the current time HOT 2
- Different authorization for different targets, via relabel
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 victoriametrics.