Module: Datadog::Metrics::Options
- Included in:
- Datadog::Metrics, Datadog::Metrics
- Defined in:
- lib/ddtrace/metrics.rb
Overview
For defining and adding default options to metrics
Constant Summary collapse
- DEFAULT =
{ tags: DEFAULT_TAGS = [ "#{Ext::Metrics::TAG_LANG}:#{Runtime::Identity.lang}".freeze, "#{Ext::Metrics::TAG_LANG_INTERPRETER}:#{Runtime::Identity.lang_interpreter}".freeze, "#{Ext::Metrics::TAG_LANG_VERSION}:#{Runtime::Identity.lang_version}".freeze, "#{Ext::Metrics::TAG_TRACER_VERSION}:#{Runtime::Identity.tracer_version}".freeze ].freeze }.freeze
Instance Method Summary collapse
Instance Method Details
#default_metric_options ⇒ Object
150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/ddtrace/metrics.rb', line 150 def # Return dupes, so that the constant isn't modified, # and defaults are unfrozen for mutation in Statsd. DEFAULT.dup.tap do || [:tags] = [:tags].dup env = Datadog.configuration.env [:tags] << "#{Datadog::Ext::Environment::TAG_ENV}:#{env}" unless env.nil? version = Datadog.configuration.version [:tags] << "#{Datadog::Ext::Environment::TAG_VERSION}:#{version}" unless version.nil? end end |
#metric_options(options = nil) ⇒ Object
137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/ddtrace/metrics.rb', line 137 def ( = nil) return if .nil? .merge() do |key, old_value, new_value| case key when :tags old_value.dup.concat(new_value).uniq else new_value end end end |