Giter Club home page Giter Club logo

Comments (12)

jiekun avatar jiekun commented on June 25, 2024 2

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:

- 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.

jiekun avatar jiekun commented on June 25, 2024 1

I tried the configuration myself and the relabel result should be like:

image
image

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.

zentkhv avatar zentkhv commented on June 25, 2024 1

@jiekun, other metrics is filtering like on second image

from victoriametrics.

zentkhv avatar zentkhv commented on June 25, 2024

@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.

jiekun avatar jiekun commented on June 25, 2024

Okie, could you check the debugging page for this metric to see how the relabel config work and paste some screenshots here

from victoriametrics.

zentkhv avatar zentkhv commented on June 25, 2024

vm
@jiekun , thats it?

from victoriametrics.

jiekun avatar jiekun commented on June 25, 2024

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.

zentkhv avatar zentkhv commented on June 25, 2024

@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.

f41gh7 avatar f41gh7 commented on June 25, 2024

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.

zentkhv avatar zentkhv commented on June 25, 2024

@f41gh7, it works! Thanks a lot!

from victoriametrics.

valyala avatar valyala commented on June 25, 2024

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
  1. It drops all the metrics with names other than kafka_consumergroup_lag_sum. See this example
  2. 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.

zentkhv avatar zentkhv commented on June 25, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.