File tree 2 files changed +10
-7
lines changed
lib/datadog/core/configuration
spec/datadog/core/configuration
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -629,15 +629,17 @@ def initialize(*_)
629
629
env_value . split ( sep ) . each do |tag |
630
630
tag . strip!
631
631
next if tag . empty?
632
+
632
633
# tag by : or = (for OpenTelemetry)
633
634
key , val = if tag . include? ( ':' )
634
- tag . split ( ':' , 2 ) . map ( &:strip )
635
- elsif tag . include? ( '=' )
636
- tag . split ( '=' , 2 ) . map ( &:strip )
637
- else
638
- [ tag . strip , '' ]
639
- end
635
+ tag . split ( ':' , 2 ) . map ( &:strip )
636
+ elsif tag . include? ( '=' )
637
+ tag . split ( '=' , 2 ) . map ( &:strip )
638
+ else
639
+ [ tag . strip , '' ]
640
+ end
640
641
next if key . empty?
642
+
641
643
# maps OpenTelemetry semantic attributes to Datadog tags
642
644
case key . downcase
643
645
when 'deployment.environment'
Original file line number Diff line number Diff line change 1108
1108
[ 'key' , 'key:' , 'key: ' ] . each do |tag |
1109
1109
context "when tag is #{ tag . inspect } " do
1110
1110
let ( :env_tags ) { tag }
1111
- it { is_expected . to eq ( { " key" => "" } ) }
1111
+ it { is_expected . to eq ( { ' key' => '' } ) }
1112
1112
end
1113
1113
end
1114
1114
end
1115
+
1115
1116
context 'with multiple colons' do
1116
1117
let ( :env_tags ) { 'key:va:lue' }
1117
1118
You can’t perform that action at this time.
0 commit comments