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

Refactor podman #10421

Merged
merged 24 commits into from
Jul 8, 2022
Merged

Refactor podman #10421

merged 24 commits into from
Jul 8, 2022

Conversation

rogercoll
Copy link
Contributor

Description:

  • Changes Podman client to Libpod Client (variable naming)
  • Adds list and event Libpod API queries
  • Main logic changed: instead of scraping all container stats this approach maintains a map of running containers and fetches their stats one by one. This modification is to align the logic with the Docker's receiver, the solutions makes it very easily to add new features (e.g container filtering).
  • Adds container's image in the metrics as attribute.

Link to tracking Issue: #9013

Testing: Added for the corresponding functions.

Documentation: No change required

- list the running containers
- events
The container scraper spawns a go routine to listen for container events
and keep track of the running containers. Only containers in the local
map will be fetched, thus we can easily add inclusion/exclusion filters.
In addition, the containers map contain extra information like the
pod name.
@rogercoll rogercoll requested a review from a team as a code owner May 29, 2022 14:11
@rogercoll rogercoll requested a review from djaglowski May 29, 2022 14:11
@rogercoll rogercoll force-pushed the refactor_podman branch 2 times, most recently from 5c752da to a87118a Compare May 29, 2022 15:07
receiver/podmanreceiver/libpod_client.go Show resolved Hide resolved
receiver/podmanreceiver/podman.go Outdated Show resolved Hide resolved
receiver/podmanreceiver/podman.go Outdated Show resolved Hide resolved
receiver/podmanreceiver/podman.go Outdated Show resolved Hide resolved
receiver/podmanreceiver/libpod_client_test.go Show resolved Hide resolved
receiver/podmanreceiver/podman.go Outdated Show resolved Hide resolved
receiver/podmanreceiver/libpod_data.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog process changed. Could you revert your changes to CHANGELOG.md and follow the instructions on the contributing docs to add a changelog entry? You may need to create a tracking issue. Thanks!

Copy link
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. LGTM. Please rebase and update changelog entry as @mx-psi mentioned

receiver/podmanreceiver/go.mod Outdated Show resolved Hide resolved
@TylerHelmuth
Copy link
Member

@rogercoll I think we need 1 more make gotidy then we'll be good to go.

@TylerHelmuth TylerHelmuth added the ready to merge Code review completed; ready to merge by maintainers label Jul 8, 2022
@dmitryax dmitryax merged commit e149ae2 into open-telemetry:main Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants