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}:#{Core::Environment::Identity.lang}".freeze, "#{Ext::Metrics::TAG_LANG_INTERPRETER}:#{Core::Environment::Identity.lang_interpreter}".freeze, "#{Ext::Metrics::TAG_LANG_VERSION}:#{Core::Environment::Identity.lang_version}".freeze, "#{Ext::Metrics::TAG_TRACER_VERSION}:#{Core::Environment::Identity.tracer_version}".freeze ].freeze }.freeze
Instance Method Summary collapse
Instance Method Details
#default_metric_options ⇒ Object
183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/ddtrace/metrics.rb', line 183 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
170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/ddtrace/metrics.rb', line 170 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 |