Skip to content

When an Ingress resource is deleted, its corresponding metrics remain in Prometheus and are not cleaned up automatically. #13894

@tengxunchao

Description

@tengxunchao

Environment:
Kubernetes version: 1.24.17
nginx-ingress version: v1.12.1

Problem
When an Ingress resource is deleted, its corresponding metrics remain in Prometheus and are not cleaned up automatically. These stale metrics only disappear after restarting the nginx-ingress controller.

Question
Is there a way to ensure that these metrics are no longer exposed to Prometheus without restarting nginx-ingress?
Are there any configuration options in nginx-ingress to optimize this behavior?
Or, is there a better recommended approach for handling stale Ingress metrics?

Image

The Ingress corresponding to sit-prometest22.sss.cn in the picture has already been deleted, but Prometheus is still scraping metrics related to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.needs-priorityneeds-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions