Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ To enable Datadog reporting in non-production environments, add the following to
config.environments = ['staging', 'production']
end

Override the default metric name with the following configuration:

config.metric = :rails_performance

## Contributing

1. Fork it ( https://github.com/metova/datadoge/fork )
Expand Down
3 changes: 2 additions & 1 deletion lib/datadoge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module Datadoge

with_configuration do
has :environments, classes: Array, default: ['production']
has :metric, classes: [Symbol, String], default: 'Performance'
end

class Railtie < Rails::Railtie
Expand Down Expand Up @@ -37,7 +38,7 @@ def send_event_to_statsd(name, payload)
measurement = payload[:measurement]
value = payload[:value]
tags = payload[:tags]
key_name = "#{name.to_s.capitalize}.#{measurement}"
key_name = "#{Datadoge.configuration.metric.to_s}.#{measurement}"
if action == :increment
$statsd.increment key_name, :tags => tags
else
Expand Down