tracelit 0.1.5 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac30fca1b8142f07af651ef3b03f63f4f1862e38c14fae393e2855f563f19c5b
4
- data.tar.gz: 935de9e4afefc7f6f635677f551d8ce6115365fa7e62142cba4d558ae1ade1f6
3
+ metadata.gz: baa72093ff99cee94e4ba7221714f16691cac2907b37fc8973be2db9d58995cd
4
+ data.tar.gz: f18620a662414111c86741d4acf81da3add9db0577a384b973842cab3053721e
5
5
  SHA512:
6
- metadata.gz: 34b639abf3f4cec8aa267ca1f78b1a6349b2e4ee7c1995d60f04f8b95dd79a916ab82b717b1989bd417f6315ef5882b6720d66413d18546c9e8e7fbedbe6d854
7
- data.tar.gz: 77f510e3104ddb98fe9349d380a2b246dbfa339232bd8694461ccbcc679d6f8c7ce0ffca9972c118643bf402b62932636b95ced8294001d1bd836a196f0d9466
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
- otel.resource = OpenTelemetry::SDK::Resources::Resource.create(
56
- base_attrs.merge(config.sanitized_resource_attributes)
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(
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tracelit
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracelit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tracelit