Skip to content

Partial label matching in selects #38

Description

@weeco

Unfortunately, it currently only returns data points with an exact match of the label combination, which means, let's say you run storage.Select("consumergroup_topic_lag", []tstorage.Label{"consumer_group": "foo"}) then:

  • consumergroup_topic_lag {"consumer_group": "foo"} will be returned
  • consumergroup_topic_lag {} will not be returned
  • consumergroup_topic_lag {"consumer_group": "foo", "another_label": "bar"} will not be returned

I think it would be beneficial if we had the option to query for metrics using partial labels. Example:

storage.Select("consumergroup_topic_lag", []tstorage.Label{"consumer_group": "foo"})

Returns all metrics where a label with key consumer_group equals to foo , regardless what other labels are set as long as the queried matches exist in the target:

consumergroup_topic_lag {"consumer_group": "foo", "topic": "bla"} 1000
consumergroup_topic_lag {"consumer_group": "foo", "topic": "bar"} 2000
consumergroup_topic_lag {"consumer_group": "foo", "topic": "basket"} 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions