-
Notifications
You must be signed in to change notification settings - Fork 369
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
Store numeric tags as metrics #886
Conversation
Ran some tests to verify numeric tags show up in the UI as we expect; that seems to be behaving correctly. Status codes, ports, process IDs, etc are still visible. Unit tests are all that remain. |
Okay it's become clear from the unit tests although setting tags as metrics is fine, it has side effects for |
Given that tags and metrics will share the same domain for their keys, having tags return metrics or metrics return tags for the same key does seem reasonable at first glance. |
2ff23ad
to
11d0900
Compare
Updated this to have Should be ready for final review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@@ -92,12 +102,15 @@ def clear_tag(key) | |||
|
|||
# Return the tag with the given key, nil if it doesn't exist. | |||
def get_tag(key) | |||
@meta[key] | |||
@meta[key] || @metrics[key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is so weird to read for me, in Python empty string is falsey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only false values are false
and nil
in Ruby. Everything else evaluates to true
.
@@ -40,7 +40,12 @@ | |||
end | |||
|
|||
let(:cache_store_name) do | |||
Gem.loaded_specs['redis-activesupport'] ? 'redis_store' : 'redis_cache_store' | |||
if Gem.loaded_specs['redis-activesupport'] \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change seems unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, tests were breaking. No idea how these were passing before but we changed the default store for Rails 5+ to use the internal Redis implementation instead of the gem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, weird if it is only failing on this branch, otherwise if unrelated to your changes it should probably be in a separate PR
I don't see anything about the special case of Just to clarify this point, numbers greater than 2^53 (in absolute value) must be put in |
@lraucy Added in the size limit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the merge conflict, lgtm
85fa187
to
07ea6f7
Compare
07ea6f7
to
b756878
Compare
b756878
to
2029f63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good! Just a few minor comments.
2029f63
to
cd6e49f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
Minor CI issue is breaking this build; will resolve elsewhere. |
In order to support numeric facets in the interim, this pull request changes span behavior to save all numeric tags as metrics on the span. Keys between tags and metrics are also unique, meaning you can't have a tag and metric of the same name on the same span.