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

Do not generate atoms / custom metrics formatting #74

Merged
merged 3 commits into from
Apr 4, 2017

Conversation

aerosol
Copy link
Contributor

@aerosol aerosol commented Apr 3, 2017

Hello,

This PR introduces two changes:

  1. 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.

  2. New configuration options:

  • max_messages - allows fine tuning the pobox buffer size
  • formatter - 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 🍻

@sourcelevel-bot
Copy link

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.

@sourcelevel-bot
Copy link

Ebert has finished reviewing this Pull Request and has found:

  • 1 fixed issue! 🎉

You can see more details about this review at https://ebertapp.io/github/pinterest/elixometer/pulls/74.

@jparise jparise requested a review from scohen April 3, 2017 14:33
Copy link
Collaborator

@jparise jparise left a 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.

Copy link
Collaborator

@scohen scohen left a 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.

@@ -174,13 +174,13 @@ defmodule Elixometer do

def get_metric_value(metric_name) do
metric_name
|> to_atom_list
|> String.split(".")
Copy link
Collaborator

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?

Copy link
Collaborator

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.

Copy link
Contributor Author

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?

@jparise jparise merged commit fdb1737 into pinterest:master Apr 4, 2017
@jparise
Copy link
Collaborator

jparise commented Apr 4, 2017

Thanks for the contribution, @aerosol!

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.

3 participants