GithubHelp home page GithubHelp logo

jamesmawm / fluent-plugin-docker-stats Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kiyoto/fluent-plugin-docker-metrics

0.0 1.0 0.0 27 KB

Fluentd plugin to collect Docker stats

Ruby 100.00%

fluent-plugin-docker-stats's Introduction

Fluentd Docker Stats Input Plugin

This is a Fluentd plugin to collect Docker stats periodically. Tested with Fluentd v1.16.2-1.1 and docker-api 1.34.2.

How it works

The script connects to the Docker host using the docker-api SDK and periodically queries container statistics. It provides insights into the resource usage, health, and other relevant information of the running Docker containers.

Installing

Make sure you have a Ruby environment. Then initialize this repo:

gem install bundle

Then:

bundle install

Alternatively, if you wish to just use the gem in a script, you can run:

gem install fluent-plugin-docker-stats

Example config

<source>
  @type docker_stats
  stats_interval 60s
  tag docker.stats
</source>

Parameters

  • stats_interval: how often to poll Docker containers for stats. The default is every minute.
  • tag: The tag for the input source. The default value is "docker
  • container_ids: A list of container IDs for reading stats. The default value is empty, which will fetch stats for all containers.

Example output

2023-12-15 09:49:12.530109174 +0000 docker.stats: {"container_id":"e59768d2f1cc8448cc1e609324cdddf70e8e26557bfe307a0887d11ec2132af3","container_name":"mysql","created_time":"2023-07-26T01:39:21.286462238Z","status":"running","is_runn
ing":true,"is_restarting":false,"is_paused":false,"is_oom_killed":false,"started_time":"2023-12-15T00:56:28.701735927Z","finished_time":"2023-12-15T00:56:24.669503934Z","mem_usage":264130560,"mem_limit":33356099584,"mem_max_usage":266227712,"cpu_system_usage":346646650000000,"cpu_total_usage":16206423900,"cpu_percent":0.004675199918995323,"networks":[{"network_name":"eth0","rx":2110,"tx":0}]}

fluent-plugin-docker-stats's People

Contributors

kiyoto avatar funkymonkeymonk avatar jamesmawm avatar cosmo0920 avatar rody avatar yuri-odagiri avatar hi-king avatar nathanpower avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.