opentelemetry-resource_detectors 0.7.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/LICENSE +1 -1
- data/lib/opentelemetry-resource_detectors.rb +1 -1
- data/lib/opentelemetry/resource/detectors.rb +1 -1
- data/lib/opentelemetry/resource/detectors/auto_detector.rb +1 -1
- data/lib/opentelemetry/resource/detectors/google_cloud_platform.rb +8 -7
- data/lib/opentelemetry/resource/detectors/version.rb +2 -2
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cf68b2a3a7eacb8e3edfe6c4d64848513230738df95e1b43908dd6743c4b79a
|
4
|
+
data.tar.gz: c6e7d63eabf0e797c4e7e42739f32765a40182bff67cbb718614e0d5c48d00de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef6f34be47b1bf60b4fc4bbaee433327710d3966fbbfd6f6d1da3c969444214b940b32517ae9be9f033383771d0e1f43d0d7743ff56338d16aefd8f9946fbbeb
|
7
|
+
data.tar.gz: c9019b60880e2ff7e5aa3542401541b0446ba9e4f884a9858d6e7ffcbdb8f3e85bf41e8a6e36ab6fa01525e8746fe040d9aec934e8bbafbf54fdabcdf446de19
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Release History: opentelemetry-resource_detectors
|
2
2
|
|
3
|
+
### v0.12.0 / 2020-12-24
|
4
|
+
|
5
|
+
* (No significant changes)
|
6
|
+
|
7
|
+
### v0.11.0 / 2020-12-11
|
8
|
+
|
9
|
+
* FIXED: Copyright comments to not reference year
|
10
|
+
|
11
|
+
### v0.10.0 / 2020-12-03
|
12
|
+
|
13
|
+
* (No significant changes)
|
14
|
+
|
15
|
+
### v0.9.0 / 2020-11-27
|
16
|
+
|
17
|
+
* BREAKING CHANGE: Add timeout for force_flush and shutdown
|
18
|
+
|
19
|
+
* ADDED: Add timeout for force_flush and shutdown
|
20
|
+
|
21
|
+
### v0.8.0 / 2020-10-27
|
22
|
+
|
23
|
+
* (No significant changes)
|
24
|
+
|
3
25
|
### v0.7.0 / 2020-10-07
|
4
26
|
|
5
27
|
* DOCS: Standardize toplevel docs structure and readme
|
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
|
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
|
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]] =
|
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
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Copyright
|
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.
|
10
|
+
VERSION = '0.12.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.
|
4
|
+
version: 0.12.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-
|
11
|
+
date: 2020-12-24 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.12.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.12.0
|
145
149
|
post_install_message:
|
146
150
|
rdoc_options: []
|
147
151
|
require_paths:
|