opentelemetry-resource_detectors 0.5.1 → 0.6.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: 25c6ff9afacac86f3a66efe8e361f69bf2f79a0a7910d995eea154cf69afb6a2
4
- data.tar.gz: a3b0feffe4e6bc8473c487fa7b75e38a3639854f903e5f5e1e185370e1490a46
3
+ metadata.gz: d535862f90f1e764bcbaeeccdba57293e0bd98a58d0824d7913c76a0edae8cae
4
+ data.tar.gz: ca2c83de07de71c50d74b69beeafab678d8749873a26c8907d1b220269222702
5
5
  SHA512:
6
- metadata.gz: 423eb933b8c9d6889aab9274fb4b52b0874a5712045737a2be706239eedc687439ccc902ab5c5e59df9af1a602857c007b9613c64cc982c03a40cb9d71e98d2f
7
- data.tar.gz: 050bfe67e1a741b397deb4f3421f6eae22a5aa25535b7fc66e602fccbdf6d02eed387cdf5f7e4284f70ce3a6c5d6894b4db7b98f3360ce7c5a217d7d5bcd5007
6
+ metadata.gz: 0afd04139ca2ce20d38aa96bcc05e1e79f7eaea4902827bbd802f612e72d869f3a7e84aee34437ce78f3aa246668f0c0afcf18368b3f55ca7bc1070106552876
7
+ data.tar.gz: e7b5ccfb80b17e7c88e6b78521b50702f1613f27af4a969187c4063dd606f8e40afaaa79072ecec985d77a126edbef4f68745692f168e848a19611cab37e4a60
@@ -0,0 +1,8 @@
1
+ # Release History: opentelemetry-resource_detectors
2
+
3
+ ### v0.6.0 / 2020-09-10
4
+
5
+ * BREAKING CHANGE: Rename Resource labels to attributes
6
+
7
+ * FIXED: Rename Resource labels to attributes
8
+ * ADDED: Environment variable resource detection
data/README.md CHANGED
@@ -4,13 +4,13 @@ The `opentelemetry-resource-detectors` gem provides resource detectors for OpenT
4
4
 
5
5
  ## What is OpenTelemetry?
6
6
 
7
- [OpenTelemetry][opentelemetry-home] is an open source observability framework, providing a general-purpose API, SDK, and related tools required for the instrumentation of cloud-native software, frameworks, and libraries.
7
+ OpenTelemetry is an open source observability framework, providing a general-purpose API, SDK, and related tools required for the instrumentation of cloud-native software, frameworks, and libraries.
8
8
 
9
9
  OpenTelemetry provides a single set of APIs, libraries, agents, and collector services to capture distributed traces and metrics from your application. You can analyze them using Prometheus, Jaeger, and other observability tools.
10
10
 
11
11
  ## How does this gem fit in?
12
12
 
13
- The `opentelemetry-resource-detectors` gem provides a means of retrieving a [resource](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/sdk.md) for supported environments following the [resource semantic conventions](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/README.md).
13
+ The `opentelemetry-resource-detectors` gem provides a means of retrieving a resource for supported environments following the resource semantic conventions.
14
14
 
15
15
  ## How do I get started?
16
16
 
@@ -21,7 +21,7 @@ gem install opentelemetry-sdk
21
21
  gem install opentelemetry-resource-detectors
22
22
  ```
23
23
 
24
- Or, if you use [bundler][bundler-home], include `opentelemetry-sdk` and `opentelemetry-resource-detectors` in your `Gemfile`.
24
+ Or, if you use Bundler, include `opentelemetry-sdk` and `opentelemetry-resource-detectors` in your `Gemfile`.
25
25
 
26
26
  ```rb
27
27
  require 'opentelemetry/sdk'
@@ -40,20 +40,10 @@ end
40
40
 
41
41
  ## How can I get involved?
42
42
 
43
- The `opentelemetry-resource-detectors` gem source is [on github][repo-github], along with related gems.
43
+ The `opentelemetry-resource-detectors` gem source is on github, along with related gems.
44
44
 
45
- The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us on our [gitter channel][ruby-gitter] or attending our weekly meeting. See the [meeting calendar][community-meetings] for dates and times. For more information on this and other language SIGs, see the OpenTelemetry [community page][ruby-sig].
45
+ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special interest group (SIG). You can get involved by joining us on our gitter channel or attending our weekly meeting. See the meeting calendar for dates and times. For more information on this and other language SIGs, see the OpenTelemetry community page.
46
46
 
47
47
  ## License
48
48
 
49
- The `opentelemetry-resource-detectors` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
50
-
51
-
52
- [opentelemetry-home]: https://opentelemetry.io
53
- [bundler-home]: https://bundler.io
54
- [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
55
- [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/master/LICENSE
56
- [examples-github]: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/examples
57
- [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
58
- [community-meetings]: https://github.com/open-telemetry/community#community-meetings
59
- [ruby-gitter]: https://gitter.im/open-telemetry/opentelemetry-ruby
49
+ The `opentelemetry-resource-detectors` gem is distributed under the Apache 2.0 license. See LICENSE for more information.
@@ -9,36 +9,36 @@ require 'google-cloud-env'
9
9
  module OpenTelemetry
10
10
  module Resource
11
11
  module Detectors
12
- # GoogleCloudPlatform contains detect class method for determining gcp environment resource labels
12
+ # GoogleCloudPlatform contains detect class method for determining gcp environment resource attributes
13
13
  module GoogleCloudPlatform
14
14
  extend self
15
15
 
16
16
  def detect # rubocop:disable Metrics/AbcSize
17
17
  gcp_env = Google::Cloud::Env.new
18
- resource_labels = {}
18
+ resource_attributes = {}
19
19
  resource_constants = OpenTelemetry::SDK::Resources::Constants
20
20
 
21
21
  if gcp_env.compute_engine?
22
- resource_labels[resource_constants::CLOUD_RESOURCE[:provider]] = 'gcp'
23
- resource_labels[resource_constants::CLOUD_RESOURCE[:account_id]] = gcp_env.project_id
24
- resource_labels[resource_constants::CLOUD_RESOURCE[:region]] = gcp_env.instance_attribute('cluster-location')
25
- resource_labels[resource_constants::CLOUD_RESOURCE[:zone]] = gcp_env.instance_zone
26
-
27
- resource_labels[resource_constants::HOST_RESOURCE[:hostname]] = hostname
28
- resource_labels[resource_constants::HOST_RESOURCE[:id]] = gcp_env.lookup_metadata('instance', 'id')
29
- resource_labels[resource_constants::HOST_RESOURCE[:name]] = gcp_env.lookup_metadata('instance', 'hostname')
22
+ resource_attributes[resource_constants::CLOUD_RESOURCE[:provider]] = 'gcp'
23
+ resource_attributes[resource_constants::CLOUD_RESOURCE[:account_id]] = gcp_env.project_id
24
+ resource_attributes[resource_constants::CLOUD_RESOURCE[:region]] = gcp_env.instance_attribute('cluster-location')
25
+ resource_attributes[resource_constants::CLOUD_RESOURCE[:zone]] = gcp_env.instance_zone
26
+
27
+ resource_attributes[resource_constants::HOST_RESOURCE[:hostname]] = hostname
28
+ resource_attributes[resource_constants::HOST_RESOURCE[:id]] = gcp_env.lookup_metadata('instance', 'id')
29
+ resource_attributes[resource_constants::HOST_RESOURCE[:name]] = gcp_env.lookup_metadata('instance', 'hostname')
30
30
  end
31
31
 
32
32
  if gcp_env.kubernetes_engine?
33
- resource_labels[resource_constants::K8S_RESOURCE[:cluster_name]] = gcp_env.instance_attribute('cluster-name')
34
- resource_labels[resource_constants::K8S_RESOURCE[:namespace_name]] = gcp_env.kubernetes_engine_namespace_id
35
- resource_labels[resource_constants::K8S_RESOURCE[:pod_name]] = hostname
33
+ resource_attributes[resource_constants::K8S_RESOURCE[:cluster_name]] = gcp_env.instance_attribute('cluster-name')
34
+ resource_attributes[resource_constants::K8S_RESOURCE[:namespace_name]] = gcp_env.kubernetes_engine_namespace_id
35
+ resource_attributes[resource_constants::K8S_RESOURCE[:pod_name]] = hostname
36
36
 
37
- resource_labels[resource_constants::CONTAINER_RESOURCE[:name]] = ENV['CONTAINER_NAME']
37
+ resource_attributes[resource_constants::CONTAINER_RESOURCE[:name]] = ENV['CONTAINER_NAME']
38
38
  end
39
39
 
40
- resource_labels.delete_if { |_key, value| value.nil? || value.empty? }
41
- OpenTelemetry::SDK::Resources::Resource.create(resource_labels)
40
+ resource_attributes.delete_if { |_key, value| value.nil? || value.empty? }
41
+ OpenTelemetry::SDK::Resources::Resource.create(resource_attributes)
42
42
  end
43
43
 
44
44
  private
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Resource
9
9
  module Detectors
10
- VERSION = '0.5.1'
10
+ VERSION = '0.6.0'
11
11
  end
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-resource_detectors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-20 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-env
@@ -129,6 +129,7 @@ executables: []
129
129
  extensions: []
130
130
  extra_rdoc_files: []
131
131
  files:
132
+ - CHANGELOG.md
132
133
  - LICENSE
133
134
  - README.md
134
135
  - lib/opentelemetry-resource_detectors.rb
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
156
  - !ruby/object:Gem::Version
156
157
  version: '0'
157
158
  requirements: []
158
- rubygems_version: 3.0.3
159
+ rubygems_version: 3.1.2
159
160
  signing_key:
160
161
  specification_version: 4
161
162
  summary: Resource detection helpers for OpenTelemetry