fluent-plugin-wodby 0.1.8 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57ac4a430d1c7d6f5ff0be056648e3a1cf139a7964a2e2ef7bc86350412f9b19
4
- data.tar.gz: 9adf5941a2fa080534b3f878e329cc5e81501c2025c180ef2cf3b511f34adf51
3
+ metadata.gz: 23ae85cc153a514e34cca03046b10a61ad3147fef2e2116fd94dead6d14e0fbb
4
+ data.tar.gz: 9e98ed0e992289f9b3d6fa0143c27d72377d460bed2bce9343b80b863723a70a
5
5
  SHA512:
6
- metadata.gz: 7490189d97937b66a21d8f6d391547d6d2aca6f010ac3861cfd825666c5db819c257186792057f54f32f8a26cf3647da321d91dd0b35177d5484a98de5a6d94b
7
- data.tar.gz: acea16faaf6d820cb71394f47e6abc8e39a43d015d2fbf011a4c56ff0b7919c5b622465b14b2795090e5b05b9811f3e0819de37c876f28ece2498d80e17d7dd0
6
+ metadata.gz: 59116055801189e0e2a14af1783d9c3d32eeb3796c7f15ca6d78e0299bfe37e86d11b5fd18ee63db5ff47d623359bcbfcf2e54e1d6c6249aa0f4fbf5681afa50
7
+ data.tar.gz: 8ab9b95f8843fed694541bc4e1489fba6338b0870f16a161a6fa736f059273902252b4b4a194a39396e759bfa8df8dd22bc8850ccf6df4726cdfd626220ac68f
@@ -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-wodby"
6
- spec.version = "0.1.8"
6
+ spec.version = "0.2.0"
7
7
  spec.authors = ["Robert Wunderer"]
8
8
  spec.email = ["robert@ramsalt.com"]
9
9
 
@@ -40,15 +40,22 @@ module Fluent
40
40
  record['wodby.instance_query'] = namespace
41
41
  instance = get_instance(namespace)
42
42
  app = get_app(instance['app_id'])
43
+ org = get_org(app['org_id'])
43
44
 
44
45
  @instance_map[namespace] = {
45
46
  'name' => "#{app['name']}.#{instance['name']}",
46
47
  'title' => "#{app['title']} - #{instance['title']}",
48
+ 'type' => instance['type'],
49
+ 'organization' => org['title'],
50
+ 'organization_name' => org['name'],
47
51
  }
48
52
  end
49
53
 
50
54
  record['wodby.instance'] = @instance_map[namespace]['name']
51
55
  record['wodby.instance_title'] = @instance_map[namespace]['title']
56
+ record['wodby.instance_type'] = @instance_map[namespace]['type']
57
+ record['wodby.organization'] = @instance_map[namespace]['organization']
58
+ record['wodby.organization_name'] = @instance_map[namespace]['organization_name']
52
59
  else
53
60
  log.info "No namespace found"
54
61
  log.info record
@@ -86,6 +93,20 @@ module Fluent
86
93
 
87
94
  app
88
95
  end
96
+
97
+ def get_org(org_id)
98
+ begin
99
+ response = RestClient.get(
100
+ "https://api.wodby.com/api/v3/orgs/#{org_id}",
101
+ headers={'X-API-KEY': @api_key}
102
+ )
103
+ org = JSON.parse(response)
104
+ rescue RestClient::ExceptionWithResponse
105
+ org = {}
106
+ end
107
+
108
+ org
109
+ end
89
110
  end
90
111
  end
91
112
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-wodby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Wunderer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-06 00:00:00.000000000 Z
11
+ date: 2023-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  requirements: []
140
- rubygems_version: 3.3.7
140
+ rubygems_version: 3.3.26
141
141
  signing_key:
142
142
  specification_version: 4
143
143
  summary: Tranlates Wodbys instance UUIDs into instance names