fluent-plugin-k8s-metrics-agg 1.1.0 → 1.1.5
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 +4 -4
- data/.circleci/config.yml +19 -36
- data/.circleci/trigger_func_test.sh +42 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +29 -0
- data/.github/ISSUE_TEMPLATE/enhancement_request.md +14 -0
- data/.github/ISSUE_TEMPLATE/failing_test.md +18 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- data/.gitignore +4 -0
- data/CLA.md +18 -0
- data/Gemfile.lock +55 -48
- data/Makefile +35 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/docker/Dockerfile +30 -45
- data/docker/Gemfile +18 -0
- data/docker/Gemfile.lock +170 -0
- data/docker/build.sh +20 -0
- data/fluent-plugin-k8s-metrics-agg.gemspec +7 -7
- data/lib/fluent/plugin/in_kubernetes_metrics_aggregator.rb +35 -24
- data/test/helper.rb +55 -71
- data/test/plugin/test_in_kubernetes_metrics_aggregator.rb +137 -104
- metadata +30 -24
- data/.circleci/build_and_push.sh +0 -10
- data/.circleci/build_and_push_to_dockerhub.sh +0 -11
- data/.circleci/build_and_push_to_github_release.sh +0 -11
- data/.circleci/push_gem.sh +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ed001cdfb56d96374f5fc2d09ee318827286b4fadefd0295d93b682cbe6921c
|
4
|
+
data.tar.gz: 2d863a2438ac373c19252f551c83c9e4d2b18e8042b656747597c093497e8a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6230fa97e57503d1e120cb84e116be613429a441a4c0c7bd156001a6283a467ee5f430ff7baa269fc8df099564b8595222f62515d71f07fb57c3a58b8919ad13
|
7
|
+
data.tar.gz: 6b3acd0eff4fdb3155eb1cbc5629ec2a254965504ba647200067101d1bbe10a8ae33fddff6929f4264826bca343281a8c1082b30653fe8c8d5fbce0ac5f38f6a
|
data/.circleci/config.yml
CHANGED
@@ -22,7 +22,7 @@ jobs:
|
|
22
22
|
paths:
|
23
23
|
- pkg
|
24
24
|
|
25
|
-
|
25
|
+
unit_test:
|
26
26
|
docker:
|
27
27
|
- image: circleci/ruby:2.6.1-node-browsers
|
28
28
|
working_directory: ~/repo
|
@@ -39,67 +39,50 @@ jobs:
|
|
39
39
|
- run:
|
40
40
|
name: Run unit tests
|
41
41
|
command: |
|
42
|
-
rake test -t -v
|
42
|
+
bundle exec rake test -t -v
|
43
43
|
|
44
|
-
|
44
|
+
func_test_main:
|
45
45
|
docker:
|
46
46
|
- image: circleci/ruby:2.6.1-node-browsers
|
47
47
|
working_directory: ~/repo
|
48
48
|
steps:
|
49
|
-
- attach_workspace:
|
50
|
-
at: /tmp
|
51
49
|
- checkout
|
52
50
|
- setup_remote_docker:
|
53
51
|
reusable: true
|
54
52
|
- run:
|
55
|
-
name:
|
53
|
+
name: trigger
|
56
54
|
command: |
|
57
|
-
.circleci/
|
58
|
-
- run:
|
59
|
-
name: Build and push docker image to ecr
|
60
|
-
command: |
|
61
|
-
.circleci/build_and_push.sh
|
55
|
+
.circleci/trigger_func_test.sh main
|
62
56
|
|
63
|
-
|
57
|
+
func_test_develop:
|
64
58
|
docker:
|
65
59
|
- image: circleci/ruby:2.6.1-node-browsers
|
66
60
|
working_directory: ~/repo
|
67
61
|
steps:
|
68
|
-
- attach_workspace:
|
69
|
-
at: /tmp
|
70
62
|
- checkout
|
71
63
|
- setup_remote_docker:
|
72
64
|
reusable: true
|
73
65
|
- run:
|
74
|
-
name:
|
75
|
-
command: |
|
76
|
-
.circleci/install_dep.sh
|
77
|
-
- run:
|
78
|
-
name: Build and push docker image to dockerhub
|
79
|
-
command: |
|
80
|
-
.circleci/build_and_push_to_dockerhub.sh
|
81
|
-
- run:
|
82
|
-
name: Upload gem to Github
|
66
|
+
name: trigger
|
83
67
|
command: |
|
84
|
-
.circleci/
|
68
|
+
.circleci/trigger_func_test.sh develop
|
85
69
|
|
86
70
|
workflows:
|
87
71
|
version: 2
|
88
72
|
build_test_push:
|
89
73
|
jobs:
|
90
|
-
- build
|
91
|
-
|
74
|
+
- build:
|
75
|
+
filters:
|
76
|
+
branches:
|
77
|
+
ignore:
|
78
|
+
- /^release\/.*/
|
79
|
+
- main
|
80
|
+
- unit_test:
|
92
81
|
requires:
|
93
82
|
- build
|
94
|
-
-
|
83
|
+
- func_test_main:
|
95
84
|
requires:
|
96
|
-
-
|
97
|
-
|
98
|
-
branches:
|
99
|
-
only: develop
|
100
|
-
- release:
|
85
|
+
- unit_test
|
86
|
+
- func_test_develop:
|
101
87
|
requires:
|
102
|
-
|
103
|
-
filters:
|
104
|
-
branches:
|
105
|
-
only: master
|
88
|
+
- unit_test
|
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# trigger SCK 'main' branch to introduce this new image from this commit
|
4
|
+
# to working version of every other component.
|
5
|
+
ORGANIZATION=splunk
|
6
|
+
PROJECT=splunk-connect-for-kubernetes
|
7
|
+
BRANCH=$1
|
8
|
+
|
9
|
+
# Trigger functional test
|
10
|
+
curl -X POST --header "Content-Type: application/json" \
|
11
|
+
-d '{"build_parameters": {"CIRCLE_JOB":"build_test", "TRIG_BRANCH":"'"$CIRCLE_BRANCH"'", "TRIG_PROJECT":"'"$CIRCLE_PROJECT_REPONAME"'", "TRIG_REPO":"'"$CIRCLE_REPOSITORY_URL"'"}}' "https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/tree/$BRANCH?circle-token=$CIRCLE_TOKEN" > build.json
|
12
|
+
cat build.json
|
13
|
+
BUILD_NUM=$(jq -r .build_num build.json)
|
14
|
+
sleep 10
|
15
|
+
|
16
|
+
# Wait until finish or maximum 20 minutes
|
17
|
+
TIMEOUT=20
|
18
|
+
DONE="FALSE"
|
19
|
+
until [ "$TIMEOUT" -lt 0 ] || [ "$DONE" == "TRUE" ]; do
|
20
|
+
curl https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/$BUILD_NUM?circle-token=$CIRCLE_TOKEN > build_progress.json
|
21
|
+
STATUS=$(jq -r .status build_progress.json)
|
22
|
+
echo "STATUS = $STATUS"
|
23
|
+
if [ "$STATUS" != "running" ] && [ "$STATUS" != "queued" ]; then
|
24
|
+
DONE="TRUE"
|
25
|
+
else
|
26
|
+
let TIMEOUT--
|
27
|
+
sleep 60
|
28
|
+
fi
|
29
|
+
done
|
30
|
+
|
31
|
+
BUILD_URL=$(jq -r .build_url build_progress.json)
|
32
|
+
if [ "$DONE" == "FALSE" ]; then
|
33
|
+
# Cancel hanging job and fail
|
34
|
+
curl -X POST https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/$BUILD_NUM/cancel?circle-token=$CIRCLE_TOKEN
|
35
|
+
else
|
36
|
+
if [ "$STATUS" != "success" ] && [ "$STATUS" != "fixed" ]; then
|
37
|
+
echo "Functional test have failed please see:"
|
38
|
+
echo $BUILD_URL
|
39
|
+
exit 1
|
40
|
+
fi
|
41
|
+
exit 0
|
42
|
+
fi
|
@@ -0,0 +1,29 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Report a bug encountered while operating fluent-plugin-k8s-metrics-agg
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
|
11
|
+
|
12
|
+
Please do not report security vulnerabilities with public GitHub issue reports. Please report security issues here: https://www.splunk.com/goto/report_vulnerabilities_prodsec
|
13
|
+
-->
|
14
|
+
|
15
|
+
|
16
|
+
**What happened**:
|
17
|
+
|
18
|
+
**What you expected to happen**:
|
19
|
+
|
20
|
+
**How to reproduce it (as minimally and precisely as possible)**:
|
21
|
+
|
22
|
+
**Anything else we need to know?**:
|
23
|
+
|
24
|
+
**Environment**:
|
25
|
+
- Kubernetes version (use `kubectl version`):
|
26
|
+
- Ruby version (use `ruby --version`):
|
27
|
+
- OS (e.g: `cat /etc/os-release`):
|
28
|
+
- Splunk version:
|
29
|
+
- Others:
|
@@ -0,0 +1,14 @@
|
|
1
|
+
---
|
2
|
+
name: Enhancement Request
|
3
|
+
about: Suggest an enhancement to the fluent-plugin-k8s-metrics-agg project
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
<<!-- Please only use this template for submitting enhancement requests -->
|
11
|
+
|
12
|
+
**What would you like to be added**:
|
13
|
+
|
14
|
+
**Why is this needed**:
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
name: Failing Test
|
3
|
+
about: Report test failures in fluent-plugin-k8s-metrics-agg
|
4
|
+
title: ''
|
5
|
+
labels: ''
|
6
|
+
assignees: ''
|
7
|
+
|
8
|
+
---
|
9
|
+
|
10
|
+
<!-- Please only use this template for submitting reports about failing tests -->
|
11
|
+
|
12
|
+
**Which test(s) are failing**:
|
13
|
+
|
14
|
+
**Since when has it been failing**:
|
15
|
+
|
16
|
+
**Reason for failure**:
|
17
|
+
|
18
|
+
**Anything else we need to know**:
|
@@ -0,0 +1,23 @@
|
|
1
|
+
## Proposed changes
|
2
|
+
|
3
|
+
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
|
4
|
+
|
5
|
+
## Types of changes
|
6
|
+
|
7
|
+
What types of changes does your code introduce?
|
8
|
+
_Put an `x` in the boxes that apply_
|
9
|
+
|
10
|
+
- [ ] Bugfix (non-breaking change which fixes an issue)
|
11
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
12
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
13
|
+
|
14
|
+
## Checklist
|
15
|
+
|
16
|
+
_Put an `x` in the boxes that apply._
|
17
|
+
|
18
|
+
- [ ] I have read the [CONTRIBUTING](https://github.com/splunk/fluent-plugin-k8s-metrics-agg/blob/develop/CONTRIBUTING.md) doc
|
19
|
+
- [ ] I have read the [CLA](https://github.com/splunk/fluent-plugin-k8s-metrics-agg/blob/develop/CLA.md)
|
20
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
21
|
+
- [ ] I have added necessary documentation (if appropriate)
|
22
|
+
- [ ] Any dependent changes have been merged and published in downstream modules
|
23
|
+
|
data/.gitignore
CHANGED
data/CLA.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
By submitting a Contribution to this Work, You agree that Your Contribution is made subject to the primary LICENSE
|
2
|
+
file applicable to this Work. In addition, You represent that: (i) You are the copyright owner of the Contribution
|
3
|
+
or (ii) You have the requisite rights to make the Contribution.
|
4
|
+
|
5
|
+
Definitions:
|
6
|
+
|
7
|
+
“You” shall mean: (i) yourself if you are making a Contribution on your own behalf; or (ii) your company,
|
8
|
+
if you are making a Contribution on behalf of your company. If you are making a Contribution on behalf of your
|
9
|
+
company, you represent that you have the requisite authority to do so.
|
10
|
+
|
11
|
+
"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing
|
12
|
+
work, that is intentionally submitted by You for inclusion in, or documentation of, this project/repository. For the
|
13
|
+
purposes of this definition, "submitted" means any form of electronic, verbal, or written communication submitted for
|
14
|
+
inclusion in this project/repository, including but not limited to communication on electronic mailing lists, source
|
15
|
+
code control systems, and issue tracking systems that are managed by, or on behalf of, the maintainers of
|
16
|
+
the project/repository.
|
17
|
+
|
18
|
+
“Work” shall mean the collective software, content, and documentation in this project/repository.
|
data/Gemfile.lock
CHANGED
@@ -1,67 +1,75 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-k8s-metrics-agg (1.1.
|
5
|
-
fluentd (
|
6
|
-
kubeclient (~> 4.
|
7
|
-
multi_json (~> 1.
|
8
|
-
oj (~> 3.
|
4
|
+
fluent-plugin-k8s-metrics-agg (1.1.5)
|
5
|
+
fluentd (>= 1.9.1)
|
6
|
+
kubeclient (~> 4.6.0)
|
7
|
+
multi_json (~> 1.14.1)
|
8
|
+
oj (~> 3.10.2)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
addressable (2.
|
14
|
-
public_suffix (>= 2.0.2, <
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
docile (1.3.
|
20
|
-
domain_name (0.5.
|
13
|
+
addressable (2.7.0)
|
14
|
+
public_suffix (>= 2.0.2, < 5.0)
|
15
|
+
concurrent-ruby (1.1.8)
|
16
|
+
cool.io (1.7.1)
|
17
|
+
crack (0.4.5)
|
18
|
+
rexml
|
19
|
+
docile (1.3.5)
|
20
|
+
domain_name (0.5.20190701)
|
21
21
|
unf (>= 0.0.5, < 1.0.0)
|
22
|
-
|
22
|
+
ffi (1.14.2)
|
23
|
+
ffi-compiler (1.0.1)
|
24
|
+
ffi (>= 1.0.0)
|
25
|
+
rake
|
26
|
+
fluentd (1.12.1)
|
27
|
+
bundler
|
23
28
|
cool.io (>= 1.4.5, < 2.0.0)
|
24
|
-
dig_rb (~> 1.0.0)
|
25
29
|
http_parser.rb (>= 0.5.1, < 0.7.0)
|
26
|
-
msgpack (>=
|
27
|
-
serverengine (>= 2.
|
30
|
+
msgpack (>= 1.3.1, < 2.0.0)
|
31
|
+
serverengine (>= 2.2.2, < 3.0.0)
|
28
32
|
sigdump (~> 0.2.2)
|
29
33
|
strptime (>= 0.2.2, < 1.0.0)
|
30
|
-
tzinfo (
|
34
|
+
tzinfo (>= 1.0, < 3.0)
|
31
35
|
tzinfo-data (~> 1.0)
|
32
36
|
yajl-ruby (~> 1.0)
|
33
|
-
hashdiff (0.
|
34
|
-
http (
|
37
|
+
hashdiff (1.0.1)
|
38
|
+
http (4.4.1)
|
35
39
|
addressable (~> 2.3)
|
36
40
|
http-cookie (~> 1.0)
|
37
|
-
http-form_data (~> 2.
|
38
|
-
|
41
|
+
http-form_data (~> 2.2)
|
42
|
+
http-parser (~> 1.2.0)
|
43
|
+
http-accept (1.7.0)
|
39
44
|
http-cookie (1.0.3)
|
40
45
|
domain_name (~> 0.5)
|
41
|
-
http-form_data (2.
|
46
|
+
http-form_data (2.3.0)
|
47
|
+
http-parser (1.2.3)
|
48
|
+
ffi-compiler (>= 1.0, < 2.0)
|
42
49
|
http_parser.rb (0.6.0)
|
43
|
-
json (2.1
|
44
|
-
kubeclient (4.
|
45
|
-
http (
|
50
|
+
json (2.5.1)
|
51
|
+
kubeclient (4.6.0)
|
52
|
+
http (>= 3.0, < 5.0)
|
46
53
|
recursive-open-struct (~> 1.0, >= 1.0.4)
|
47
54
|
rest-client (~> 2.0)
|
48
|
-
mime-types (3.
|
55
|
+
mime-types (3.3.1)
|
49
56
|
mime-types-data (~> 3.2015)
|
50
|
-
mime-types-data (3.
|
51
|
-
msgpack (1.2
|
52
|
-
multi_json (1.
|
57
|
+
mime-types-data (3.2021.0225)
|
58
|
+
msgpack (1.4.2)
|
59
|
+
multi_json (1.14.1)
|
53
60
|
netrc (0.11.0)
|
54
|
-
oj (3.
|
55
|
-
power_assert (
|
56
|
-
public_suffix (
|
57
|
-
rake (
|
58
|
-
recursive-open-struct (1.1.
|
59
|
-
rest-client (2.0
|
61
|
+
oj (3.10.18)
|
62
|
+
power_assert (2.0.0)
|
63
|
+
public_suffix (4.0.6)
|
64
|
+
rake (13.0.3)
|
65
|
+
recursive-open-struct (1.1.3)
|
66
|
+
rest-client (2.1.0)
|
67
|
+
http-accept (>= 1.7.0, < 2.0)
|
60
68
|
http-cookie (>= 1.0.2, < 2.0)
|
61
69
|
mime-types (>= 1.16, < 4.0)
|
62
70
|
netrc (~> 0.8)
|
63
|
-
|
64
|
-
serverengine (2.
|
71
|
+
rexml (3.2.4)
|
72
|
+
serverengine (2.2.3)
|
65
73
|
sigdump (~> 0.2.2)
|
66
74
|
sigdump (0.2.4)
|
67
75
|
simplecov (0.16.1)
|
@@ -69,17 +77,16 @@ GEM
|
|
69
77
|
json (>= 1.8, < 3)
|
70
78
|
simplecov-html (~> 0.10.0)
|
71
79
|
simplecov-html (0.10.2)
|
72
|
-
strptime (0.2.
|
73
|
-
test-unit (3.3.
|
80
|
+
strptime (0.2.5)
|
81
|
+
test-unit (3.3.9)
|
74
82
|
power_assert
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
tzinfo-data (1.2018.9)
|
83
|
+
tzinfo (2.0.4)
|
84
|
+
concurrent-ruby (~> 1.0)
|
85
|
+
tzinfo-data (1.2021.1)
|
79
86
|
tzinfo (>= 1.0.0)
|
80
87
|
unf (0.1.4)
|
81
88
|
unf_ext
|
82
|
-
unf_ext (0.0.7.
|
89
|
+
unf_ext (0.0.7.7)
|
83
90
|
webmock (3.5.1)
|
84
91
|
addressable (>= 2.3.6)
|
85
92
|
crack (>= 0.3.2)
|
@@ -90,12 +97,12 @@ PLATFORMS
|
|
90
97
|
ruby
|
91
98
|
|
92
99
|
DEPENDENCIES
|
93
|
-
bundler (~> 2.0
|
100
|
+
bundler (~> 2.0)
|
94
101
|
fluent-plugin-k8s-metrics-agg!
|
95
|
-
rake (~>
|
102
|
+
rake (~> 13.0)
|
96
103
|
simplecov (~> 0.16.1)
|
97
104
|
test-unit (~> 3.3.0)
|
98
105
|
webmock (~> 3.5.1)
|
99
106
|
|
100
107
|
BUNDLED WITH
|
101
|
-
2.
|
108
|
+
2.2.7
|
data/Makefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
VERSION := $(shell sh -c 'cat VERSION')
|
2
|
+
NODEJS_VERSION := 14.15.1
|
3
|
+
|
4
|
+
clean_pkg:
|
5
|
+
@rm -rf pkg/* docker/*.gem
|
6
|
+
|
7
|
+
clean_gems:
|
8
|
+
@rm -rf docker/gem/* docker/gems/*
|
9
|
+
|
10
|
+
clean: clean_pkg clean_gems
|
11
|
+
@rm -rf docker/licenses
|
12
|
+
|
13
|
+
build: clean_pkg
|
14
|
+
@bundle exec rake build
|
15
|
+
|
16
|
+
docker: build install-deps
|
17
|
+
@cp pkg/fluent-plugin-*.gem docker
|
18
|
+
@mkdir -p docker/licenses
|
19
|
+
@cp -rp LICENSE docker/licenses/
|
20
|
+
@docker build --no-cache --pull --build-arg VERSION=$(VERSION) --build-arg NODEJS_VERSION=$(NODEJS_VERSION) -t splunk/k8s-metrics-aggr:$(VERSION) ./docker
|
21
|
+
|
22
|
+
unit-test:
|
23
|
+
@bundle exec rake test
|
24
|
+
|
25
|
+
install-deps:
|
26
|
+
@gem install bundler
|
27
|
+
@bundle update --bundler
|
28
|
+
@bundle install
|
29
|
+
|
30
|
+
unpack: build
|
31
|
+
@cp pkg/fluent-plugin-*.gem docker
|
32
|
+
@mkdir -p docker/gem
|
33
|
+
@rm -rf docker/gem
|
34
|
+
@gem unpack docker/fluent-plugin-*.gem --target docker/gem
|
35
|
+
@cd docker && bundle install
|