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

Name New Relic transactions according to command called #8

Merged
merged 1 commit into from
Oct 16, 2017

Conversation

kstole
Copy link
Collaborator

@kstole kstole commented Oct 13, 2017

Depends on refactoring in SlackRubyBot::Commands::Base: slack-ruby/slack-ruby-bot#164

This causes transactions in New Relic to be separated by command.
E.g. MySlackBot::Commands::Authentication/auth

@kstole kstole force-pushed the feature/transaction_naming branch from f48d43b to b0ca427 Compare October 13, 2017 00:38
@kstole
Copy link
Collaborator Author

kstole commented Oct 13, 2017

This is a PR for #7
@dblock Let me know what you think and if it looks good I can update the README

command_class.class_eval do
class << self
def call_command_with_new_relic(client, data, match, block)
::NewRelic::Agent.set_transaction_name("#{self}/#{match[:command].downcase}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why downcase? Because the matching is not case-sensitive?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New Relic separates transactions by name and is case sensitive. So if someone types @mybot Command it would show up separately from @mybot command. Downcasing normalizes the names so that individual commands are aggregated in New Relic.

@dblock
Copy link
Collaborator

dblock commented Oct 13, 2017

It looks good.

@kstole kstole force-pushed the feature/transaction_naming branch from b0ca427 to 0c10acb Compare October 15, 2017 03:38
@kstole
Copy link
Collaborator Author

kstole commented Oct 15, 2017

I added tests and support for matches from command, operator, match, and scan.
I also set the minimum version of SlackRubyBot to 0.10.5 since it requires the latest refactoring (tests will pass when that's available). Any idea when 0.10.5 will be released?

@dblock
Copy link
Collaborator

dblock commented Oct 15, 2017

@kstole I added you to slack-ruby-bot (https://github.com/slack-ruby/slack-ruby-bot/invitations), so you can just make that release (follow RELEASING as usual).

@kstole
Copy link
Collaborator Author

kstole commented Oct 16, 2017

Closing and reopening to start new build

@kstole kstole closed this Oct 16, 2017
@kstole kstole reopened this Oct 16, 2017
@kstole kstole merged commit 0fcad90 into slack-ruby:master Oct 16, 2017
@kstole kstole deleted the feature/transaction_naming branch October 16, 2017 16:33
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