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

Podman receiver: Replace official Podman bindings with custom REST client to monitor podman #5244

Closed
owais opened this issue Sep 15, 2021 · 0 comments · Fixed by #5430
Closed
Assignees

Comments

@owais
Copy link
Contributor

owais commented Sep 15, 2021

Is your feature request related to a problem? Please describe.
Podman receiver uses the official Podman library to interact with Podman daemon and extract metrics from it. The library is quite heavy and pulls in a lot of dependencies that the podman receiver does not really need. It depends on things like btrfs, gpgme, devicemapper, etc which make it inconvenient to build the collector on Linux and much harder (impossible?) to build it on other platforms. Luckily, we can use some build tags to exclude most of these dependencies as done here.

This does allow the collector to be built without pulling in those dependencies but it still causes some inconvenience.

  • The collector build system needs to have special knowledge about build tags required by a specific component (podman receiver). We don't have a mechanism to auto-discover such component requirements today. We should arguably add it regardless as other components may require it in future but still, not having such requirements in the first place would be better/simpler.
  • Makes it very hard for distros derived from this repository to build binaries and discover the problem/solution. Ex: Avoid usage of github.com/mtrmac/gpgme #5241

Describe the solution you'd like
Remove libpodman and replace it with a custom REST API client that does only as much as the receiver requires. It should still support all communication and auth mechanisms that the official library supports e.g, ssh.

Additional context
Podman has been requested to split their Go API bindings out of the core repo which should alleviate some of these problems but looks like it is not a priority at the moment. containers/podman#6866

This would also solve issues like this: #5414

@owais owais changed the title Podman receiver: Replace libpodman with custom REST client to monitor podman Podman receiver: Replace official Podman bindings with custom REST client to monitor podman Sep 15, 2021
@owais owais self-assigned this Sep 24, 2021
bogdandrutu pushed a commit that referenced this issue Sep 27, 2021
podmanreceiver uses the official Go podman bindings but the bindings
pull in all of the podman codebase and it's dependencies. We are
essentially embedding podman into the collector. This causes a number of
problems both at compile and run time.

This commit ditches the podman library and uses net/http to consume the
podman v3 REST API instead.

Fixes #5244
Fixes #5414
Fixes #5241
Fixes #5245
hex1848 pushed a commit to hex1848/opentelemetry-collector-contrib that referenced this issue Jun 2, 2022
…not only ComponentID (open-telemetry#5244)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
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 a pull request may close this issue.

1 participant