fluent-plugin-label-router 0.2.9 → 0.2.10
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/README.md +2 -2
- data/fluent-plugin-label-router.gemspec +1 -1
- data/lib/fluent/plugin/out_label_router.rb +6 -5
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2eccef2ba45a644db797ef22980134d652db67bf049467e3d404e2211dbedd9c
|
|
4
|
+
data.tar.gz: ab9a02cde570157b3b01228d06982a8cef69ab39c8b5f28ca7c1518ef91ccf35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d61f1b61634e0afabc6e4f9418b8eb6d69eb6a5b20833973500b9094e123877af08971576fe6d11240fa53169bd87ed0ca0d94cfc42ba987f4bb3e74789afc6
|
|
7
|
+
data.tar.gz: d9ed37e986627feb738a384c89242fc8aadd05d58141f91573b3791f8498b6d6ce00e67ad6dfb38e5e151decb7ed5456392936ed3c0d821f241175e656c67a0e
|
data/README.md
CHANGED
|
@@ -13,7 +13,7 @@ $ gem install fluent-plugin-label-router
|
|
|
13
13
|
### Specific install
|
|
14
14
|
|
|
15
15
|
```
|
|
16
|
-
$ gem install specific_install &&
|
|
16
|
+
$ gem install specific_install && gem specific_install -l https://github.com/banzaicloud/fluent-plugin-label-router.git
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
### Bundler
|
|
@@ -114,7 +114,7 @@ Configuration to re-tag and re-label all logs from `default` namespace with labe
|
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
### 2. Exclude specific `labels` and `namespaces`
|
|
117
|
-
Configuration to re-tag and re-label all logs that **not** from `default` namespace **and not** have labels `
|
|
117
|
+
Configuration to re-tag and re-label all logs that **not** from `default` namespace **and not** have labels `app=nginx` and `env=dev`
|
|
118
118
|
```
|
|
119
119
|
<match example.tag**>
|
|
120
120
|
@type label_router
|
|
@@ -33,6 +33,8 @@ module Fluent
|
|
|
33
33
|
config_param :sticky_tags, :bool, default: true
|
|
34
34
|
desc "Default label to drain unmatched patterns"
|
|
35
35
|
config_param :default_route, :string, :default => ""
|
|
36
|
+
desc "Metrics labels for the default_route"
|
|
37
|
+
config_param :default_metrics_labels, :hash, :default => {}
|
|
36
38
|
desc "Default tag to drain unmatched patterns"
|
|
37
39
|
config_param :default_tag, :string, :default => ""
|
|
38
40
|
desc "Enable metrics for the router"
|
|
@@ -72,15 +74,14 @@ module Fluent
|
|
|
72
74
|
if registry.exist?(:fluentd_router_records_total)
|
|
73
75
|
@counter = registry.get(:fluentd_router_records_total)
|
|
74
76
|
else
|
|
75
|
-
@counter = registry.counter(:fluentd_router_records_total, docstring: "Total number of events
|
|
77
|
+
@counter = registry.counter(:fluentd_router_records_total, docstring: "Total number of events routed for the flow", labels: [:flow, :id])
|
|
76
78
|
end
|
|
77
79
|
end
|
|
78
80
|
end
|
|
79
81
|
|
|
80
82
|
def get_labels
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
labels
|
|
83
|
+
labels = { 'flow': @label, 'id': "default" }
|
|
84
|
+
!@metrics_labels.nil? ? labels.merge(@metrics_labels) : labels
|
|
84
85
|
end
|
|
85
86
|
|
|
86
87
|
# Evaluate selectors
|
|
@@ -211,7 +212,7 @@ module Fluent
|
|
|
211
212
|
end
|
|
212
213
|
|
|
213
214
|
if @default_route != '' or @default_tag != ''
|
|
214
|
-
default_rule = { 'matches' => nil, 'tag' => @default_tag, '@label' => @default_route}
|
|
215
|
+
default_rule = { 'matches' => nil, 'tag' => @default_tag, '@label' => @default_route, 'metrics_labels' => @default_metrics_labels }
|
|
215
216
|
@default_router = Route.new(default_rule, event_emitter_router(@default_route), @registry)
|
|
216
217
|
end
|
|
217
218
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-label-router
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Banzai Cloud
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-09-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -92,7 +92,7 @@ homepage: https://github.com/banzaicloud/fluent-plugin-label-router
|
|
|
92
92
|
licenses:
|
|
93
93
|
- Apache-2.0
|
|
94
94
|
metadata: {}
|
|
95
|
-
post_install_message:
|
|
95
|
+
post_install_message:
|
|
96
96
|
rdoc_options: []
|
|
97
97
|
require_paths:
|
|
98
98
|
- lib
|
|
@@ -107,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
107
107
|
- !ruby/object:Gem::Version
|
|
108
108
|
version: '0'
|
|
109
109
|
requirements: []
|
|
110
|
-
rubygems_version: 3.
|
|
111
|
-
signing_key:
|
|
110
|
+
rubygems_version: 3.0.3
|
|
111
|
+
signing_key:
|
|
112
112
|
specification_version: 4
|
|
113
113
|
summary: Routing records based on Kubernetes labels.
|
|
114
114
|
test_files:
|