fluent-plugin-docker-stats 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2190acce2c335545f820f349e2d54821554e6ee9c0adc3a89f41c49515176f70
4
- data.tar.gz: 82bea8766f3244fcfc455e0a21c468f575633eaf1b1f4eed5b8739e9be37c2c4
3
+ metadata.gz: a5fa9b7e2c63c4859222c64c6869ed3709badbe664a5f788a32e1a85ca87cf4d
4
+ data.tar.gz: d27ba6c3efeda20bf9830eccb25d129b55c4507305802bf1b227cfe43d8fd1ad
5
5
  SHA512:
6
- metadata.gz: b386ed72c8160e716b6c2b5579be825993555488045469099d17d2c4bb052db2736b81e7523922b3dbac32c1858f0fc8ac43f43dae4355736d16c86f63c7b5d5
7
- data.tar.gz: 90b739fe4c659014cb4eb68d8d8b7cc65ea30c9afa73ddaa03149eb7583eef2174f0658f20d2a8c23045b182217f43bea621e2ca5e7284d0f732e951e1cf8c7a
6
+ metadata.gz: 308cd40d18597cd0fb998056883fb6f94e4f7c1c82d832ac2699cc531af442743f3945b9bc5151e4d16bcf6bef9f175d85202f74d1cf8826a07ce77cbdeb9262
7
+ data.tar.gz: eaaee00e626a505146de51bcb3eff4654c1beb17f1ac6e6a15c6e3fbab27ac7c953fd0bacae408bf7373935beced251b4b09b02bfeaec07ac48ede940803d95d
data/.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
data/Dockerfile ADDED
@@ -0,0 +1,28 @@
1
+ # Use an official Fluentd base image
2
+ FROM fluent/fluentd:v1.16.2-1.1
3
+
4
+ # Use root account to run Fluentd
5
+ USER root
6
+
7
+ RUN apk update && apk add --no-cache ca-certificates ruby ruby-irb ruby-etc ruby-webrick tini && \
8
+ apk add --no-cache --virtual .build-deps build-base linux-headers ruby-dev gnupg && \
9
+ echo 'gem: --no-document' >> /etc/gemrc && gem install oj -v 3.16.1 && gem install json -v 2.6.3 && \
10
+ gem install rexml -v 3.2.6 && gem install async -v 1.31.0 && gem install async-http -v 0.60.2 && \
11
+ gem install uri -v 0.12.2 && gem install fluentd -v 1.16.2 && gem install bigdecimal -v 1.4.4 && \
12
+ apk del .build-deps && rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/
13
+
14
+ RUN apk add --update ruby build-base
15
+ RUN gem install fluentd
16
+ RUN gem install docker-api
17
+
18
+ # Create a directory for Fluentd logs
19
+ RUN mkdir -p /fluentd/log
20
+ RUN mkdir -p /fluentd/etc
21
+ RUN mkdir -p /fluentd/plugins
22
+ RUN chown -R fluent /fluentd
23
+ RUN chgrp -R fluent /fluentd
24
+
25
+ USER fluent
26
+
27
+ # Specify the Fluentd configuration file
28
+ CMD ["fluentd", "-c", "/fluentd/etc/fluent.conf"]
data/conf/fluent.conf ADDED
@@ -0,0 +1,9 @@
1
+ <source>
2
+ @type docker_stats
3
+ stats_interval 60s
4
+ tag docker.stats
5
+ </source>
6
+
7
+ <match docker.stats>
8
+ @type stdout
9
+ </match>
@@ -0,0 +1,14 @@
1
+ version: '3'
2
+
3
+ services:
4
+ fluentd:
5
+ container_name: fluentd
6
+ build:
7
+ context: .
8
+ dockerfile: Dockerfile
9
+ volumes:
10
+ - ./conf:/fluentd/etc
11
+ - ./lib/fluent/plugin:/fluentd/plugins
12
+ environment:
13
+ - FLUENTD_CONF=fluent.conf
14
+ - DOCKER_HOST=tcp://host.docker.internal:2375
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-docker-stats"
7
- spec.version = "1.0.0"
7
+ spec.version = "1.0.1"
8
8
  spec.authors = ["James Ma"]
9
9
  spec.email = ["jamesmawm@gmail.com"]
10
10
  spec.summary = %q{Fluentd plugin to collect Docker container stats}
@@ -44,7 +44,6 @@ module Fluent::Plugin
44
44
  end
45
45
 
46
46
  def emit_container_stats(container_id)
47
- puts "emit_container_stats: #{container_id}"
48
47
  container = Docker::Container.get(container_id)
49
48
 
50
49
  record = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-docker-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Ma
@@ -115,10 +115,13 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".idea/.gitignore"
118
119
  - CHANGELOG
120
+ - Dockerfile
119
121
  - Gemfile
120
122
  - README.md
121
- - Rakefile
123
+ - conf/fluent.conf
124
+ - docker-compose.yml
122
125
  - fluent-plugin-docker-stats.gemspec
123
126
  - lib/fluent/plugin/in_docker_stats.rb
124
127
  homepage: https://github.com/jamesmawm/fluent-plugin-docker-stats
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
3
-
4
- Rake::TestTask.new(:test) do |test|
5
- test.libs << "test" << "lib"
6
- test.pattern = 'test/test_*.rb'
7
- test.verbose = true
8
- end
9
-
10
- task :default => :test