opentelemetry-resource_detectors 0.17.0 → 0.19.1

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: 469b53f604a5b11235ece8357dfcdc613560d5b0853059eb4d56e0f3129bcec2
4
- data.tar.gz: 64cebb9ede72ac283c3af65bb8ea016a1d65b93723b7e781ed99b16eda1dec22
3
+ metadata.gz: 1c64bed3d25422a99ec4246fc3afd7844837670a5750a3daba2cf63a1bbedfc6
4
+ data.tar.gz: 955ee4fc54c11b4f243aa67f89b42cf0865160d86b8703a385d4098c961d7782
5
5
  SHA512:
6
- metadata.gz: 31d31b272a4ec0dfdc478c3c370f8ad25778055cbbba0a36d4008bc206e37fd9b56db1074e4243fe5d5e339684ed6e853a7af2221f9f4330571b7a41abd1f170
7
- data.tar.gz: a4cb1e0b674d814977d9b56d0007bf585e864276e9c0865e31b911edefa678b2bd0e0fa522fb9bfa8fe76123c7662ce802182417b347d5871ecacfb9e35bcb7f
6
+ metadata.gz: 5eeae4f6e2bbf36a8dc0efb81f96c2960276fdca9bdab6acaa87229f55a36f8e4d85535b6d3d418c2b6f92ef59f6d5528ea98b46a4c035e90102aaeb6ba4aced
7
+ data.tar.gz: 353da61a51d2a7bca8ce94d13e262f4b51c23b6af4fd26fa55b6dbaae4b927732d3a910c1c6284c4297b5b0d9807ba257b8907f0e307782e5834845e6e339295
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Release History: opentelemetry-resource_detectors
2
2
 
3
+ ### v0.19.1 / 2021-09-29
4
+
5
+ * (No significant changes)
6
+
7
+ ### v0.19.0 / 2021-08-12
8
+
9
+ * BREAKING CHANGE: Use auto-generated resource constants in sdk and resource_detectors
10
+
11
+ * ADDED: Use auto-generated resource constants in sdk and resource_detectors
12
+
13
+ ### v0.18.1 / 2021-06-23
14
+
15
+ * (No significant changes)
16
+
17
+ ### v0.18.0 / 2021-05-21
18
+
19
+ * FIXED: Rename cloud.zone to cloud.availability_zone
20
+
3
21
  ### v0.17.0 / 2021-04-22
4
22
 
5
23
  * (No significant changes)
@@ -16,27 +16,26 @@ module OpenTelemetry
16
16
  def detect # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
17
17
  gcp_env = Google::Cloud::Env.new
18
18
  resource_attributes = {}
19
- resource_constants = OpenTelemetry::SDK::Resources::Constants
20
19
 
21
20
  if gcp_env.compute_engine?
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[:id]] = gcp_env.lookup_metadata('instance', 'id')
28
- resource_attributes[resource_constants::HOST_RESOURCE[:name]] = ENV['HOSTNAME'] ||
29
- gcp_env.lookup_metadata('instance', 'hostname') ||
30
- safe_gethostname
21
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::CLOUD_PROVIDER] = 'gcp'
22
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::CLOUD_ACCOUNT_ID] = gcp_env.project_id
23
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::CLOUD_REGION] = gcp_env.instance_attribute('cluster-location')
24
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::CLOUD_AVAILABILITY_ZONE] = gcp_env.instance_zone
25
+
26
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::HOST_ID] = gcp_env.lookup_metadata('instance', 'id')
27
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::HOST_NAME] = ENV['HOSTNAME'] ||
28
+ gcp_env.lookup_metadata('instance', 'hostname') ||
29
+ safe_gethostname
31
30
  end
32
31
 
33
32
  if gcp_env.kubernetes_engine?
34
- resource_attributes[resource_constants::K8S_RESOURCE[:cluster_name]] = gcp_env.instance_attribute('cluster-name')
35
- resource_attributes[resource_constants::K8S_RESOURCE[:namespace_name]] = gcp_env.kubernetes_engine_namespace_id
36
- resource_attributes[resource_constants::K8S_RESOURCE[:pod_name]] = ENV['HOSTNAME'] || safe_gethostname
37
- resource_attributes[resource_constants::K8S_RESOURCE[:node_name]] = gcp_env.lookup_metadata('instance', 'hostname')
33
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::K8S_CLUSTER_NAME] = gcp_env.instance_attribute('cluster-name')
34
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::K8S_NAMESPACE_NAME] = gcp_env.kubernetes_engine_namespace_id
35
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::K8S_POD_NAME] = ENV['HOSTNAME'] || safe_gethostname
36
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::K8S_NODE_NAME] = gcp_env.lookup_metadata('instance', 'hostname')
38
37
 
39
- resource_attributes[resource_constants::CONTAINER_RESOURCE[:name]] = ENV['CONTAINER_NAME']
38
+ resource_attributes[OpenTelemetry::SemanticConventions::Resource::CONTAINER_NAME] = ENV['CONTAINER_NAME']
40
39
  end
41
40
 
42
41
  resource_attributes.delete_if { |_key, value| value.nil? || value.empty? }
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Resource
9
9
  module Detectors
10
- VERSION = '0.17.0'
10
+ VERSION = '0.19.1'
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.17.0
4
+ version: 0.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-23 00:00:00.000000000 Z
11
+ date: 2021-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-env
@@ -156,10 +156,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
156
156
  licenses:
157
157
  - Apache-2.0
158
158
  metadata:
159
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-resource_detectors/v0.17.0/file.CHANGELOG.html
159
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-resource_detectors/v0.19.1/file.CHANGELOG.html
160
160
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/resource_detectors
161
161
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
162
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-resource_detectors/v0.17.0
162
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-resource_detectors/v0.19.1
163
163
  post_install_message:
164
164
  rdoc_options: []
165
165
  require_paths: