opentelemetry-resource_detectors 0.7.0 → 0.8.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: 9ebbdd9564adeb0c2247ca7b2983b3eecd26767ee7a626a8db30cf351f357e34
4
- data.tar.gz: 697356bfa0e899b01c9bd7096ae70f4ab2dda92384fbdb11655d217120a86229
3
+ metadata.gz: 0a0ed927aefdb01b894d84105cbabcc2e06af196d61556fc9f4b382d4bd95c43
4
+ data.tar.gz: c2bad0ca1beb726a7015f379f4c1d6d208a7a74acb0356c44dc9ceff64897dca
5
5
  SHA512:
6
- metadata.gz: 59f63420e68821a2ecfbbe85c5bf4c9f162058851a02a174c9f645c3f52e8a159d04540c1678b40bd9487f80b872cd6dfa2c257b4ada9d2bc6e020d4021379f2
7
- data.tar.gz: 348e7116b130a12ff5bc55af93734b4ca00a426011fdc8ef833169978d69a0e9c6ed32b0e4d7f311c3362b345c5efb5867f024e480b78f3e0449002561079c14
6
+ metadata.gz: fbf411bde20705f06508a545a63372e8c662a32686c6078eb785fefe44fc2dc570ac43d449b3013304a4ea465249c9461d2cf221d2ab6286583d582ffc54c1be
7
+ data.tar.gz: 143db1dfd22614a684ebedfa7e553d994df7b4fafce1fafddc42115f4b7593efeae1acfc0fd84864b7493c8e7bd6432ba7553d8e2e4edb037df685544a38091a
@@ -1,5 +1,9 @@
1
1
  # Release History: opentelemetry-resource_detectors
2
2
 
3
+ ### v0.8.0 / 2020-10-27
4
+
5
+ * (No significant changes)
6
+
3
7
  ### v0.7.0 / 2020-10-07
4
8
 
5
9
  * DOCS: Standardize toplevel docs structure and readme
@@ -13,7 +13,7 @@ module OpenTelemetry
13
13
  module GoogleCloudPlatform
14
14
  extend self
15
15
 
16
- def detect # rubocop:disable Metrics/AbcSize
16
+ def detect # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength
17
17
  gcp_env = Google::Cloud::Env.new
18
18
  resource_attributes = {}
19
19
  resource_constants = OpenTelemetry::SDK::Resources::Constants
@@ -24,15 +24,16 @@ module OpenTelemetry
24
24
  resource_attributes[resource_constants::CLOUD_RESOURCE[:region]] = gcp_env.instance_attribute('cluster-location')
25
25
  resource_attributes[resource_constants::CLOUD_RESOURCE[:zone]] = gcp_env.instance_zone
26
26
 
27
- resource_attributes[resource_constants::HOST_RESOURCE[:hostname]] = hostname
28
27
  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')
28
+ resource_attributes[resource_constants::HOST_RESOURCE[:name]] = ENV['HOSTNAME'] ||
29
+ gcp_env.lookup_metadata('instance', 'hostname') ||
30
+ safe_gethostname
30
31
  end
31
32
 
32
33
  if gcp_env.kubernetes_engine?
33
34
  resource_attributes[resource_constants::K8S_RESOURCE[:cluster_name]] = gcp_env.instance_attribute('cluster-name')
34
35
  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
+ resource_attributes[resource_constants::K8S_RESOURCE[:pod_name]] = ENV['HOSTNAME'] || safe_gethostname
36
37
 
37
38
  resource_attributes[resource_constants::CONTAINER_RESOURCE[:name]] = ENV['CONTAINER_NAME']
38
39
  end
@@ -43,8 +44,8 @@ module OpenTelemetry
43
44
 
44
45
  private
45
46
 
46
- def hostname
47
- ENV['HOSTNAME'] || Socket.gethostname
47
+ def safe_gethostname
48
+ Socket.gethostname
48
49
  rescue StandardError
49
50
  ''
50
51
  end
@@ -7,7 +7,7 @@
7
7
  module OpenTelemetry
8
8
  module Resource
9
9
  module Detectors
10
- VERSION = '0.7.0'
10
+ VERSION = '0.8.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.7.0
4
+ version: 0.8.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-10-08 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-env
@@ -141,7 +141,11 @@ files:
141
141
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
142
142
  licenses:
143
143
  - Apache-2.0
144
- metadata: {}
144
+ metadata:
145
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-resource_detectors/v0.8.0/file.CHANGELOG.html
146
+ source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/resource_detectors
147
+ bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
148
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-resource_detectors/v0.8.0
145
149
  post_install_message:
146
150
  rdoc_options: []
147
151
  require_paths: