opentelemetry-resource_detectors 0.6.0 → 0.11.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: d535862f90f1e764bcbaeeccdba57293e0bd98a58d0824d7913c76a0edae8cae
4
- data.tar.gz: ca2c83de07de71c50d74b69beeafab678d8749873a26c8907d1b220269222702
3
+ metadata.gz: f7a032fb111efcec73adf090d6230b93486897812ee53925b30a042519b1f658
4
+ data.tar.gz: ab96c8742e9d21e61e5f44378d99ca96beba49f12e697ecbe277da58bdc39cea
5
5
  SHA512:
6
- metadata.gz: 0afd04139ca2ce20d38aa96bcc05e1e79f7eaea4902827bbd802f612e72d869f3a7e84aee34437ce78f3aa246668f0c0afcf18368b3f55ca7bc1070106552876
7
- data.tar.gz: e7b5ccfb80b17e7c88e6b78521b50702f1613f27af4a969187c4063dd606f8e40afaaa79072ecec985d77a126edbef4f68745692f168e848a19611cab37e4a60
6
+ metadata.gz: ad68a8aee8f22aede98362b3e498840e8aeaac2d1fa08fd400963c8919f54769ea8c883d6bcdca2bc07658c9d269cead185003e54e88584dfc8cf6f4070bb830
7
+ data.tar.gz: f9bf7663542a532e16b6ef999ea295d8cc06b943b1a1706cf3fb73d9490024b10b23964d9faf7bc053ab1fb69e28d9b8e5a5d2d43987a99e899fb7dbcf6de48b
@@ -0,0 +1,9 @@
1
+ --no-private
2
+ --title=OpenTelemetry Resource Detectors
3
+ --markup=markdown
4
+ --main=README.md
5
+ ./lib/opentelemetry/resource/detectors/**/*.rb
6
+ ./lib/opentelemetry/resource/detectors.rb
7
+ -
8
+ README.md
9
+ CHANGELOG.md
@@ -1,5 +1,27 @@
1
1
  # Release History: opentelemetry-resource_detectors
2
2
 
3
+ ### v0.11.0 / 2020-12-11
4
+
5
+ * FIXED: Copyright comments to not reference year
6
+
7
+ ### v0.10.0 / 2020-12-03
8
+
9
+ * (No significant changes)
10
+
11
+ ### v0.9.0 / 2020-11-27
12
+
13
+ * BREAKING CHANGE: Add timeout for force_flush and shutdown
14
+
15
+ * ADDED: Add timeout for force_flush and shutdown
16
+
17
+ ### v0.8.0 / 2020-10-27
18
+
19
+ * (No significant changes)
20
+
21
+ ### v0.7.0 / 2020-10-07
22
+
23
+ * DOCS: Standardize toplevel docs structure and readme
24
+
3
25
  ### v0.6.0 / 2020-09-10
4
26
 
5
27
  * BREAKING CHANGE: Rename Resource labels to attributes
data/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2020 OpenTelemetry Authors
189
+ Copyright The OpenTelemetry Authors
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -9,6 +9,12 @@ require 'opentelemetry/resource/detectors/version'
9
9
  require 'opentelemetry/resource/detectors/google_cloud_platform'
10
10
  require 'opentelemetry/resource/detectors/auto_detector'
11
11
 
12
+ # OpenTelemetry is an open source observability framework, providing a
13
+ # general-purpose API, SDK, and related tools required for the instrumentation
14
+ # of cloud-native software, frameworks, and libraries.
15
+ #
16
+ # The OpenTelemetry module provides global accessors for telemetry objects.
17
+ # See the documentation for the `opentelemetry-api` gem for details.
12
18
  module OpenTelemetry
13
19
  module Resource
14
20
  # Detectors contains the resource detectors as well as the AutoDetector
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
@@ -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
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2020 OpenTelemetry Authors
3
+ # Copyright The OpenTelemetry Authors
4
4
  #
5
5
  # SPDX-License-Identifier: Apache-2.0
6
6
 
7
7
  module OpenTelemetry
8
8
  module Resource
9
9
  module Detectors
10
- VERSION = '0.6.0'
10
+ VERSION = '0.11.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.6.0
4
+ version: 0.11.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-09-11 00:00:00.000000000 Z
11
+ date: 2020-12-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
+ - ".yardopts"
132
133
  - CHANGELOG.md
133
134
  - LICENSE
134
135
  - README.md
@@ -140,7 +141,11 @@ files:
140
141
  homepage: https://github.com/open-telemetry/opentelemetry-ruby
141
142
  licenses:
142
143
  - Apache-2.0
143
- metadata: {}
144
+ metadata:
145
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-resource_detectors/v0.11.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.11.0
144
149
  post_install_message:
145
150
  rdoc_options: []
146
151
  require_paths:
@@ -156,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
161
  - !ruby/object:Gem::Version
157
162
  version: '0'
158
163
  requirements: []
159
- rubygems_version: 3.1.2
164
+ rubygems_version: 3.1.4
160
165
  signing_key:
161
166
  specification_version: 4
162
167
  summary: Resource detection helpers for OpenTelemetry