Class: Google::Cloud::Trace::SpanKind

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/trace/span_kind.rb

Overview

SpanKind represents values for the "kind" field of span.

Constant Summary collapse

UNSPECIFIED =

The :SPAN_KIND_UNSPECIFIED value

new :SPAN_KIND_UNSPECIFIED
RPC_SERVER =

The :RPC_SERVER value

new :RPC_SERVER
RPC_CLIENT =

The :RPC_CLIENT value

new :RPC_CLIENT
@@mapping =
{}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get(name) ⇒ SpanKind

Returns the SpanKind given a symbol or string representation.

Parameters:

  • name (String, Symbol)

    The name of the SpanKind.

Returns:

  • (SpanKind)

    The SpanKind, or nil if not known.



74
75
76
# File 'lib/google/cloud/trace/span_kind.rb', line 74

def self.get name
  @@mapping[name.to_sym]
end

Instance Method Details

#to_sString

Returns the string representation of this SpanKind

Returns:

  • (String)

    String representation.



64
65
66
# File 'lib/google/cloud/trace/span_kind.rb', line 64

def to_s
  to_sym.to_s
end

#to_symSymbol

Returns the symbolic representation of this SpanKind

Returns:

  • (Symbol)

    Symbol representation.



55
56
57
# File 'lib/google/cloud/trace/span_kind.rb', line 55

def to_sym
  @name
end