Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicating add tags #1009

Merged
merged 4 commits into from
Nov 30, 2022

Conversation

andresgalindo-stripe
Copy link
Contributor

Summary

Changes add_tags behavior to replace elements in the slice with the same key, if they exist, otherwise default to append.

Motivation

Using add_tags can cause us to have tags with duplicate keys (though different values), this has not been a problem because most of the sinks will transform the slice into a map which will naturally "dedupe". However, it causes a problem when we're using the max_tags configuration because now we don't have an accurate accounting of the number of tags.

This doesn't solve the problem of the metric being emitted with duplicate tags but that isn't something we've observed happens often.

Test plan

Unit test.

Rollout/monitoring/revert plan

@andresgalindo-stripe andresgalindo-stripe merged commit 0f8f107 into master Nov 30, 2022
andresgalindo-stripe added a commit that referenced this pull request Nov 30, 2022
When metrics are going through the globalization pipeline metrics from veneur local will have tags added to them by the `add_tags` functionality when these same metrics arrive at the globalization pipeline if veneur global has its own `add_tags` specified that overlap with those from veneur local we would end up with duplicate tags. See the original fix [here](#1009).

As to why this PR: when accessing a substring of ft where `len(k)` is longer than `ft` itself we'll receive an out of bounds error, I was operating under the assumption they'd behave a lot like python strings where this behavior is valid:
```
Python 3.9.11 (main, Sep 13 2022, 16:05:34)
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> foo = "test"
>>> foo[0:20]
'test'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants