Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/datadog/statsd/serialization/tag_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def to_tags_list(tags)

def escape_tag_content(tag)
tag = tag.to_s
return tag unless tag.include?('|')
tag.delete('|,')
return tag unless tag.include?('|') || tag.include?(',')
tag.delete('|,')
end

def dd_tags(env = ENV)
Expand Down
2 changes: 2 additions & 0 deletions spec/statsd/serialization/tag_serializer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
context '[testing serialization edge cases]' do
it 'formats tags with reserved characters' do
expect(subject.format(['name:foo,bar|foo'])).to eq 'name:foobarfoo'
expect(subject.format(['name:foobar|foo'])).to eq 'name:foobarfoo'
expect(subject.format(['name:foo, bar, and foo'])).to eq 'name:foo bar and foo'
end

it 'formats tags values with to_s' do
Expand Down
Loading