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 container metrics in Chaos Daemon for CRI-O and Docker runtime #4422

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

kaaass
Copy link

@kaaass kaaass commented May 21, 2024

Please Note: This PR requires PR #4416 to be merged. Please do not merge it now. I will do a rebase after previous PR get merged.

What problem does this PR solve?

RFC: chaos-mesh/rfcs#47

This PR implements the feature of exporting statistical metrics in RFC. Statistical metrics are the metrics that describe the statistical information of the container. These metrics are exported by Chaos Daemon. The previous PR #4416 implemented this feature for containerd, and this PR further provides implementations for Docker and CRI-O.

What's changed and how it works?

Proposal: chaos-mesh/rfcs#47

This PR modifies Chaos Daemon.

To export statistical metrics, Chaos Daemon will retrieve statistical information about the container from the CRI interface. Previous PR had introduced the interface ContainerRuntimeInfoClient and method StatsByContainerID for this. This PR implements these for CRI-O and Docker backend.

Unlike CRI-O, the Docker backend's runtime socket (e.g., /var/run/docker.sock) is not compatible with CRI API. Kubernetes uses cri-dockerd as an adapter to solve this. Therefore, the Docker backend also needs to obtain the socket path of cri-dockerd. This PR introduces the command line parameter —cri-socket-path to read this path, and adds the related Helm Charts configuration chaosDaemon.criSocketPath.

In addition, since the Docker backend currently does not require CRI Socket for other functions. Therefore, if it cannot connect to the CRI Socket during initialization, Chaos Daemon can still start normally, but will not export any container metrics.

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

Signed-off-by: KAAAsS <admin@kaaass.net>
Signed-off-by: KAAAsS <admin@kaaass.net>
…tartup

Signed-off-by: KAAAsS <admin@kaaass.net>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant