Skip to content

Commit

Permalink
Try to infer the service name if it's not explicitly set
Browse files Browse the repository at this point in the history
  • Loading branch information
sulami committed Jan 18, 2024
1 parent 6cef9d6 commit b788eec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/degica_datadog/config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

require "datadog/statsd"
require "rails"
require "json"
require "uri"

Expand All @@ -17,7 +18,7 @@ def statsd_client
end

def service
ENV.fetch("SERVICE_NAME", nil)
ENV.fetch("SERVICE_NAME", Rails.application&.class&.module_parent_name&.downcase)
end

def version
Expand Down

0 comments on commit b788eec

Please sign in to comment.