Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export relation between experiment and container to metrics #4415

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kaaass
Copy link

@kaaass kaaass commented May 14, 2024

What problem does this PR solve?

RFC: chaos-mesh/rfcs#47

This PR implements the feature of exporting relation metrics in RFC. Relation metrics are the metrics that describe the relation between the Chaos experiment and the container. These metrics are exported by Chaos Controller Manager. The proposed metric name is: chaos_controller_manager_chaos_experiments_container_relation. It is exported with the following labels:

Label Name Description
namespace The namespace of the container.
kind The kind of the experiment.
phase The phase of the experiment. No longer export this because of confusion.
name The name of the experiment.
uid The UID of the experiment.
pod The pod name of the selected container.
container The container name of the selected container.

The relation metrics are exported for all Chaos experiments managed by Chaos Controller Manager if the phase of the experiment is not Finished or Deleting. This prevents exporting too many metrics by ignoring inactive experiments.

For each selected container in the experiment, Chaos Controller Manager exports a relation metric. The value of the metric is always fixed to 1 for the convenience of joining metrics.

What's changed and how it works?

Proposal: chaos-mesh/rfcs#47

This PR modifies Chaos Controller Manager by exporting new metrics to /metric endpoint. The relationship between the experiment and the selected container is extracted through the status records of Chaos Object.

Related changes

  • This change also requires further updates to the website (e.g. docs)
  • This change also requires further updates to the UI interface

Cherry-pick to release branches (optional)

This PR should be cherry-picked to the following release branches:

  • release-2.6
  • release-2.5

Checklist

CHANGELOG

Must include at least one of them.

  • I have updated the CHANGELOG.md
  • I have labeled this PR with "no-need-update-changelog"

Tests

Must include at least one of them.

  • Unit test
  • E2E test
  • Manual test

Side effects

  • Breaking backward compatibility

DCO

If you find the DCO check fails, please run commands like below (Depends on the actual situations. For example, if the failed commit isn't the most recent) to fix it:

git commit --amend --signoff
git push --force

@kaaass kaaass force-pushed the pr/controller-manager-metrics branch from 444b17c to 0c26f0a Compare May 14, 2024 11:23
Signed-off-by: KAAAsS <admin@kaaass.net>
Signed-off-by: KAAAsS <admin@kaaass.net>
Signed-off-by: KAAAsS <admin@kaaass.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants