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(inputs.docker): Support swarm jobs #16292

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Conversation

zomfg
Copy link
Contributor

@zomfg zomfg commented Dec 10, 2024

Summary

Gather info about swarm jobs like for normal swarm services and don't flood logs with errors about "unsupported replica mode"

relevant test configs

telegraf.conf

[[outputs.file]]
  files = ["stdout"]

[[inputs.docker]]
  endpoint = "unix:///var/run/docker.sock"
  gather_services = true

compose.yml

services:
  long:
    image: alpine
    command: sleep 20
    deploy:
      mode: global-job

  short:
    image: hello-world
    deploy:
      mode: replicated-job
      replicas: 1

  daemon:
    image: jmalloc/echo-server
    deploy:
      mode: replicated
      replicas: 1

output sample

docker_swarm,host=testst.int,service_id=mp50lo68vqgkory4e26ts8f9d,service_mode=global_job,service_name=jobs_long tasks_running=0i 1733841760000000000
docker_swarm,host=testst.int,service_id=rfmqydhe8cluzl9hayyrhw5ga,service_mode=replicated_job,service_name=jobs_short tasks_running=0i,max_concurrent=1i,total_completions=1i 1733841760000000000
docker_swarm,host=testst.int,service_id=wb11cftte0u6cc4bn1l96dnxr,service_mode=replicated,service_name=jobs_daemon tasks_running=1i,tasks_desired=1i 1733841760000000000

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #16291

@telegraf-tiger telegraf-tiger bot added area/docker feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Dec 10, 2024
@srebhan
Copy link
Member

srebhan commented Dec 11, 2024

@zomfg could you please rebase this PR on latest master to get CircleCI going?

@srebhan srebhan self-assigned this Dec 11, 2024
@zomfg zomfg force-pushed the master branch 2 times, most recently from e26ace2 to 23aef88 Compare December 11, 2024 22:50
@telegraf-tiger
Copy link
Contributor

Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thank you @zomfg! I really think this mode iffery should be a switch statement but it feels wrong to put that burden on you. ;-) If you feel the motivation to change this in a separate PR your help is welcome!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Dec 13, 2024
@srebhan srebhan assigned DStrand1 and unassigned srebhan Dec 13, 2024
@DStrand1 DStrand1 merged commit c0b3dd4 into influxdata:master Dec 16, 2024
27 checks passed
@github-actions github-actions bot added this to the v1.34.0 milestone Dec 16, 2024
justinwwhuang pushed a commit to justinwwhuang/telegraf_fork that referenced this pull request Dec 19, 2024
izekr pushed a commit to izekr/telegraf that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docker feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[inputs.docker] Support swarm jobs
3 participants