tracelit 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tracelit/instrumentation.rb +18 -3
- data/lib/tracelit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: baa72093ff99cee94e4ba7221714f16691cac2907b37fc8973be2db9d58995cd
|
|
4
|
+
data.tar.gz: f18620a662414111c86741d4acf81da3add9db0577a384b973842cab3053721e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7a7961d36cb65b10d80b43cfecea3f767798ca5eb38d12352a8933ab2969d86d9a73d947e6d25eb0444ab1ea4374300ce215a8f34a65621b3a465f009ac24d28
|
|
7
|
+
data.tar.gz: c45e5931a15e408165258bea86c2ffd70285286a27e08e36c9dd30e0e9a705fff8ec2a2104cb35ae177a33f46379700c032bd91fd1b76d307bf2e409722df16a
|
|
@@ -52,9 +52,24 @@ module Tracelit
|
|
|
52
52
|
sha = config.resolved_commit_sha
|
|
53
53
|
base_attrs["service.commit_sha"] = sha if sha
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
# Resource.create also reads OTEL_RESOURCE_ATTRIBUTES from the
|
|
56
|
+
# environment and merges in Resource.default (process, OS info, etc.)
|
|
57
|
+
# Any of those sources can carry non-primitive values and raise
|
|
58
|
+
# ConfigurationError / ArgumentError. If that happens we fall back to
|
|
59
|
+
# an empty resource so the SDK configure block can still complete and
|
|
60
|
+
# install the real TracerProvider — traces will work, only the custom
|
|
61
|
+
# labels are missing. A clear warning tells the operator what to fix.
|
|
62
|
+
begin
|
|
63
|
+
otel.resource = OpenTelemetry::SDK::Resources::Resource.create(
|
|
64
|
+
base_attrs.merge(config.sanitized_resource_attributes)
|
|
65
|
+
)
|
|
66
|
+
rescue ArgumentError, OpenTelemetry::SDK::ConfigurationError => e
|
|
67
|
+
OpenTelemetry.logger.warn(
|
|
68
|
+
"[Tracelit] could not set resource attributes: #{e.message}. " \
|
|
69
|
+
"Check OTEL_RESOURCE_ATTRIBUTES and config.resource_attributes for " \
|
|
70
|
+
"non-string/integer/float/boolean values. Continuing with default resource."
|
|
71
|
+
)
|
|
72
|
+
end
|
|
58
73
|
|
|
59
74
|
# Build the OTLP exporter once — shared by both processors
|
|
60
75
|
exporter = OpenTelemetry::Exporter::OTLP::Exporter.new(
|
data/lib/tracelit/version.rb
CHANGED