module OpenCensus::Tags
The Tags
module contains support for OpenCensus
tags. Tags
are key-value pairs. Tags
provide additional cardinality to the OpenCensus
instrumentation data.
Constants
Attributes
Get the current configuration @private
Public Class Methods
Configure OpenCensus
Tags
. These configuration fields include parameters formatter.
This configuration is also available as the `tags` subconfig under the main configuration `OpenCensus.configure`. If the OpenCensus
Railtie is installed in a Rails application, the configuration object is also exposed as `config.opencensus.tags`.
Generally, you should configure this once at process initialization, but it can be modified at any time.
Supported fields are:
-
`binary_formatter` The tags context propagation formatter to use. Must be a formatter, an object with `serialize`, `deserialize`, methods. See {OpenCensus::Tags::Formatters::Binary}.
@example
OpenCensus::Tags.configure do |config| config.binary_formatter = OpenCensus::Tags::Formatters::Binary.new end
# File lib/opencensus/tags/config.rb, line 59 def configure if block_given? yield @config else @config end end
Returns the current thread-local TagMap
object.
@return [TagMap, nil]
# File lib/opencensus/tags.rb, line 58 def tag_map_context OpenCensus::Context.get TAG_MAP_CONTEXT_KEY end
Unsets the current thread-local TagMap
context
# File lib/opencensus/tags.rb, line 50 def unset_tag_map_context OpenCensus::Context.unset TAG_MAP_CONTEXT_KEY end