-
Notifications
You must be signed in to change notification settings - Fork 67
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
Do not generate atoms / custom metrics formatting #74
Conversation
Hello, @aerosol! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information. |
Ebert has finished reviewing this Pull Request and has found:
You can see more details about this review at https://ebertapp.io/github/pinterest/elixometer/pulls/74. |
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 looks great to me. Thanks!
Let's see if @scohen has any comments before we merge.
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.
@jparise my only concern here is that pre-existing metrics will somehow have their names changed, though I'm skeptical that this will be the case, since the stringified version of an atom is just the atom.
lib/elixometer.ex
Outdated
@@ -174,13 +174,13 @@ defmodule Elixometer do | |||
|
|||
def get_metric_value(metric_name) do | |||
metric_name | |||
|> to_atom_list | |||
|> String.split(".") |
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.
Will this still work for metrics defined as an atom list?
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.
Either way, lets cover that case with a test.
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.
7061c28 - is that what you meant?
Thanks for the contribution, @aerosol! |
Hello,
This PR introduces two changes:
All the names are now transferred as list of binaries, instead of generating atoms at runtime. This is useful for an environment where metrics are built dynamically, preventing the VM from exploding due to atoms not being garbage collected.
exometer
is perfectly fine accepting lists of terms for metric identifiers.New configuration options:
max_messages
- allows fine tuning thepobox
buffer sizeformatter
- allows injecting a custom metric name formatting function, useful for legacy systems where metrics have already a naming scheme that needs to be preserved.Let me know please, if this is good to go 🍻