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

Define default Adapter#name #762

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Define default Adapter#name #762

merged 1 commit into from
Sep 20, 2023

Conversation

bkeepers
Copy link
Collaborator

I noticed while working on #760 that every adapter defines #name and it's just a variable set in initialize. This PR added a default Adapter#name method, which is just the snake_case version of the ClassName.

In #760 (comment), @jnunemaker said:

I don't usually allow changing the adapter name. But seeing it makes me wonder if we should allow this for people as I could see scenarios where someone wants to override for instrumentation purposes.

Currently, the ActiveRecord and Sequel adapters are the only ones that allow setting the name. Those will still work with this change. Should we allow others?

@bkeepers bkeepers requested a review from jnunemaker September 20, 2023 14:54
Copy link
Collaborator

@jnunemaker jnunemaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work. As long as the names are the same for anyone instrumenting we should be fine. If the magic changed any names, we'd want to let people know in changeling as metric names would change and they'd have to update graphs.

@bkeepers
Copy link
Collaborator Author

👍 All names should be the same.

@bkeepers bkeepers merged commit 57f95ef into main Sep 20, 2023
@bkeepers bkeepers deleted the default-name branch September 20, 2023 15:42
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