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(cgroups.plugin): resolve nomad containers name (docker driver only) #13481

Merged
merged 3 commits into from
Aug 3, 2022

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Aug 3, 2022

Summary

Fixes: #12419
Closes: #13475

This PR adds containers name resolution for Nomad tasks. Name: "NAMESPACE-JOBNAME-TASKNAME-SHORTALLOCID".

Note It works only when using the Docker driver.


Before this PR:

  • use docker ps ... if docker command is available (Netdata running on the host).
  • use ContainerInspect endpoint if docker command is not available (Netdata running inside a Docker container).

This PR changes:

  • use docker inspect ... if docker command is available. This is equivalent to the ContainerInspect endpoint (but we can apply additional formatting).
Test Plan
  • start several Docker containers and Nomad containers.
  • check their names on the dashboard.

Tested both scenarios: Netdata is running in a Docker container/Netdata installed on the host.

1st one is nomad, 2nd one is docker.

Screenshot 2022-08-03 at 17 00 27

Additional Information
For users: How does this change affect me?

@github-actions github-actions bot added area/collectors Everything related to data collection collectors/cgroups labels Aug 3, 2022
@ilyam8 ilyam8 marked this pull request as ready for review August 3, 2022 13:45
@ilyam8 ilyam8 requested a review from vlvkobal as a code owner August 3, 2022 13:45
@ilyam8
Copy link
Member Author

ilyam8 commented Aug 3, 2022

NAMESPACE-JOBNAME-TASKNAME-SHORTALLOCID

@xkisu, hey 👋 Is this name ok? What do you think?

@ilyam8 ilyam8 changed the title feat(cgroups.plugin): resolve nomad container names (docker driver only) feat(cgroups.plugin): resolve nomad containers name (docker driver only) Aug 3, 2022
@thiagoftsm thiagoftsm requested a review from cakrit August 3, 2022 18:06
@ilyam8 ilyam8 merged commit 363352a into netdata:master Aug 3, 2022
@ilyam8 ilyam8 deleted the feat_docker_nomad_name_resolution branch August 3, 2022 21:23
@xkisu
Copy link
Contributor

xkisu commented Aug 4, 2022

NAMESPACE-JOBNAME-TASKNAME-SHORTALLOCID

@xkisu, hey 👋 Is this name ok? What do you think?

Sorry, I missed this! Yeah that's perfect, I've been using that format on my fork for a couple of weeks and it's got just enough information to be useful to Nomad admins and not be too long 👍

@ilyam8
Copy link
Member Author

ilyam8 commented Aug 4, 2022

Big thanks for helping us, @xkisu! As it turned out it was easy to implement, but somehow I missed that Nomad exports env vars when was doing the initial investigation.

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Aug 12, 2022
https://build.opensuse.org/request/show/994622
by user mia + dimstar_suse
- Drop netdata-smartd-log-path.patch
- Update to 1.36.0 (go.d.plugin 0.35.0)
Collectors
  * New
    + Add PgBouncer collector (go.d/pgbouncer)
      gh#netdata/netdata#748
    + Add WireGuard collector (go.d/wireguard)
      gh#netdata/netdata#744
    + Add PostgresSQL collector (go.d/postgres)
      gh#netdata/netdata#718
    + Add Chrony collector (go.d/chrony)
      gh#netdata/netdata#678
    + Add Kubernetes State collector (go.d/k8s_state)
      gh#netdata/netdata#673
  * Improvements
    + Add WireGuard description and icon to dashboard info
      gh#netdata/netdata#13483
    + Resolve nomad containers name (cgroups.plugin)
      gh#netdata/netdata#13481
    + Update postgres dashboard info
      gh#netdata/netdata#13474
    + Improve Chrony dashboard info
      gh#netdata/netdata#133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection collectors/cgroups
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Problem naming containers when using Hashicorp Nomad
5 participants