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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b7fb09af37b3435f4e2fb3b4cad0c83b864af8a5736ee363cb254eaf1495233
4
- data.tar.gz: f0634bcff726634e62b6fd99989fc74a29e811c21309c6edcec93cbd0a8ef175
3
+ metadata.gz: 2eccef2ba45a644db797ef22980134d652db67bf049467e3d404e2211dbedd9c
4
+ data.tar.gz: ab9a02cde570157b3b01228d06982a8cef69ab39c8b5f28ca7c1518ef91ccf35
5
5
  SHA512:
6
- metadata.gz: 63f428db21d8538f1d3d3e4eefbdf369e1efe9d73d0e480d1f24d301529b8f7d9530b8fa12bf2fc66b39c13f10627bab2b6d20f88071fd23f9a10076a84db073
7
- data.tar.gz: 7e803c4b8ab849dae41f08940b6537e321a622d523970c7eb81849c2fa0f64ecb96c0a9437b85d19fe5a44ae6ace59696186bd7f966b12bfd162db1ff6e410ec
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 && gem specific_install -l https://github.com/banzaicloud/fluent-plugin-label-router.git
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 `ap=nginx` and `env=dev`
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
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-label-router"
6
- spec.version = "0.2.9"
6
+ spec.version = "0.2.10"
7
7
  spec.authors = ["Banzai Cloud"]
8
8
  spec.email = ["info@banzaicloud.com"]
9
9
 
@@ -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 router for the flow", labels: [:flow, :id])
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
- default = { 'flow': @label }
82
- labels = default.merge(@metrics_labels)
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.9
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-07-08 00:00:00.000000000 Z
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.1.6
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: