pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.2k stars 490 forks source link

[BR]initialize status metric to zero #5637

Closed wxiaomou closed 1 month ago

wxiaomou commented 2 months ago

What problem does this PR solve?

Currently when the federated manager restart we lost the metrics, and the new status metric will start with value 1. In our dashboard we are measuring success/fail backups by increase() function, current implementation will cause we lost the back up status when federated manager restarts.

This PR set the status counter to 0 before it emit the first metric.

What is changed and how does it work?

Code changes

Tests

Side effects

Related changes

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.

BornChanger commented 1 month ago

/cc @WangLe1321

ti-chi-bot[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BornChanger, WangLe1321

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/pingcap/tidb-operator/blob/master/OWNERS)~~ [BornChanger,WangLe1321] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ti-chi-bot[bot] commented 1 month ago

[LGTM Timeline notifier]

Timeline:

BornChanger commented 1 month ago

/cherry-pick release-1.5

ti-chi-bot commented 1 month ago

@BornChanger: new pull request created to branch release-1.5: #5648.

In response to [this](https://github.com/pingcap/tidb-operator/pull/5637#issuecomment-2112416123): >/cherry-pick release-1.5 Instructions for interacting with me using PR comments are available [here](https://prow.tidb.net/command-help). If you have questions or suggestions related to my behavior, please file an issue against the [ti-community-infra/tichi](https://github.com/ti-community-infra/tichi/issues/new?title=Prow%20issue:) repository.