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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a0ed927aefdb01b894d84105cbabcc2e06af196d61556fc9f4b382d4bd95c43
|
4
|
+
data.tar.gz: c2bad0ca1beb726a7015f379f4c1d6d208a7a74acb0356c44dc9ceff64897dca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf411bde20705f06508a545a63372e8c662a32686c6078eb785fefe44fc2dc570ac43d449b3013304a4ea465249c9461d2cf221d2ab6286583d582ffc54c1be
|
7
|
+
data.tar.gz: 143db1dfd22614a684ebedfa7e553d994df7b4fafce1fafddc42115f4b7593efeae1acfc0fd84864b7493c8e7bd6432ba7553d8e2e4edb037df685544a38091a
|
data/CHANGELOG.md
CHANGED
@@ -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]] =
|
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]] =
|
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
|
47
|
-
|
47
|
+
def safe_gethostname
|
48
|
+
Socket.gethostname
|
48
49
|
rescue StandardError
|
49
50
|
''
|
50
51
|
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.
|
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-
|
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:
|