Skip to content

Target Allocator relabel filter incorrectly drops targets based on seeded labels #5246

Description

@swiatekm

Component(s)

No response

What happened?

Description

When keeping or dropping labels based on seeded labels, target allocator may do the wrong thing. For example:

scrape_configs:
  # keep on `job`: Prometheus keeps (job is seeded), allocator drops -> silent loss.
  - job_name: gap-keep-on-job
    static_configs:
      - targets: ['10.20.0.1:9100']
    relabel_configs:
      - {source_labels: [job], regex: 'gap-keep-on-job', action: keep}

Same is true for other seeded labels like __scheme__.

Steps to Reproduce

See: #5244.

Expected Result

Target Allocator's keep/drop behavior should be consistent with Prometheus.

Actual Result

The target mentioned above is dropped by target allocator but kept by prometheus.

Kubernetes Version

all supported

Operator version

main

Collector version

v0.153.0

Environment information

Log output

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

Labels

area:target-allocatorIssues for target-allocatorbugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions