Comments (12)
Hi!
May I ask if you've tried:
# current config (I'm not sure if there is a formatting issue of GitHub markdown?)
- if: '{name!~"kafka_consumergroup_lag_sum"}'
# have you tried this one?
- if: '{__name__!~"kafka_consumergroup_lag_sum"}'
Please paste your config within a code block so that it could be formatted correctly and potentially easier to solve.
Also I saw some test case in this repo which might be helpful:
VictoriaMetrics/lib/promrelabel/relabel_test.go
Line 1075 in 83216e9
- action: drop
if: '{__name__!~"smth"}'
And you could debug the relabel config by the debug
button. See: https://docs.victoriametrics.com/vmagent/#relabel-debug (Metric-level debugging)
from victoriametrics.
I tried the configuration myself and the relabel result should be like:
You can debug on other metrics to see if they are dropped (but somehow preserved in real-world usage). and see if vm maintainers have other suggestion for ya ^_^
from victoriametrics.
@jiekun, other metrics is filtering like on second image
from victoriametrics.
@jiekun , shure. "name" was sintax error. Im using:
- if: '{__name__!~"kafka_consumergroup_lag_sum"}'
This one doesnt help:
- action: drop
if: '{__name__!~"kafka_consumergroup_lag_sum"}'
from victoriametrics.
Okie, could you check the debugging page for this metric to see how the relabel config work and paste some screenshots here
from victoriametrics.
@jiekun , thats it?
from victoriametrics.
cmiiw, you intend to drop metrics whose __name__
is not equal to kafka_consumergroup_lag_sum
. But the kafka_consumergroup_lag_sum
is dropped and other metrics are preserved?
from victoriametrics.
@jiekun, no. Metrics up to kafka_consumergroup_lag_sum
realy drop as expected, but metrics after it are also preserved (it is not expected). Expect to preserved only one metric with name kafka_consumergroup_lag_sum
.
from victoriametrics.
Looks strange.
Could you try a simple example for it:
metric_relabel_configs:
- source_labels: [__name__]
action: keep
regex: '^kafka_consumergroup_lag_sum$'
from victoriametrics.
@f41gh7, it works! Thanks a lot!
from victoriametrics.
It looks like everything works as intended when using the following if
condition with action: drop
in relabeling rules:
- if: '{__name__!~"kafka_consumergroup_lag_sum"}'
action: drop
- It drops all the metrics with names other than
kafka_consumergroup_lag_sum
. See this example - It keeps
kafka_consumergroup_lag_sum
metrics. See this example.
@zentkhv , probably, you hit some bug in old version of vmagent. I suggest upgrading vmagent to the latest available release in order to rule out this possibility. The latest release contains all the bugfixes from all the previous releases.
from victoriametrics.
@valyala, Thanks for the option. There was also the idea that this is connected with the old version, but so far there is no possibility to update.
p.s. Yes, the problem was not reproduced in metric-relabel-debug.
from victoriametrics.
Related Issues (20)
- Global WITH templates in vmselect / vmsingle
- vmauth cannot start with empty configuration. HOT 1
- vmauth: default httpserver incorrectly exposed
- VMAlert oauth2 error HOT 2
- vmagent using k8s endpoint role for pod role jobs HOT 7
- 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
- IndexDB data consuming more space after pod restarts HOT 3
- Indexdb add scroll mode when vmstorage -retentionPeriod parameter set very long time
- vmalert-tool: process won't exit when no rule is defined under group HOT 2
- Duplicate metrics in a scrape break Prometheus scraping HOT 1
- Victorialogs can't parse syslog timestamps HOT 4
- victorialogs vmui: unresponsive after query execution HOT 1
- Random inconsistent results in query operations from the same instance and exporter HOT 5
- vmalert: replay exit with status 0 when generated samples are not successfully pushed HOT 2
- How to optimize the cross AZ traffic cost of vmagent in AWS eks clusters HOT 5
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.