Class: OpenTelemetry::DistributedContext::Entry::Key
- Inherits:
-
Object
- Object
- OpenTelemetry::DistributedContext::Entry::Key
- Defined in:
- lib/opentelemetry/distributed_context/entry.rb
Overview
Entry::Key is the name of the Entry. Entry::Key along with Entry::Value can be used to aggregate and group stats, annotate traces and logs, etc.
Restrictions
-
Must contain only printable ASCII (codes between 32 and 126 inclusive)
-
Must have length greater than zero and less than 256.
-
Must not be empty.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Key
constructor
A new instance of Key.
Constructor Details
#initialize(name) ⇒ Key
Returns a new instance of Key.
23 24 25 26 27 |
# File 'lib/opentelemetry/distributed_context/entry.rb', line 23 def initialize(name) raise ArgumentError unless Internal.printable_ascii?(name) && (1..255).include?(name.length) @name = -name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
21 22 23 |
# File 'lib/opentelemetry/distributed_context/entry.rb', line 21 def name @name end |