Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SpanFlags.php

class SpanFlags

SpanFlags represents constants used to interpret the Span.flags field, which is protobuf 'fixed32' type and is to be used as bit-fields. Each non-zero value defined in this enum is a bit-mask. To extract the bit-field, for example, use an expression like: (span.flags & SPAN_FLAGS_TRACE_FLAGS_MASK) See https://www.w3.org/TR/trace-context-2/#trace-flags for the flag definitions. Note that Span flags were introduced in version 1.1 of the OpenTelemetry protocol. Older Span producers do not set this field, consequently consumers should not rely on the absence of a particular flag bit to indicate the presence of a particular feature.

Protobuf type <code>opentelemetry.proto.trace.v1.SpanFlags</code>

Hierarchy

  • class \Opentelemetry\Proto\Trace\V1\SpanFlags

Expanded class hierarchy of SpanFlags

1 file declares its use of SpanFlags
SpanConverter.php in vendor/open-telemetry/exporter-otlp/SpanConverter.php

File

vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/SpanFlags.php, line 24

Namespace

Opentelemetry\Proto\Trace\V1
View source
class SpanFlags {
    
    /**
     * The zero value for the enum. Should not be used for comparisons.
     * Instead use bitwise "and" with the appropriate mask as shown above.
     *
     * Generated from protobuf enum <code>SPAN_FLAGS_DO_NOT_USE = 0;</code>
     */
    const SPAN_FLAGS_DO_NOT_USE = 0;
    
    /**
     * Bits 0-7 are used for trace flags.
     *
     * Generated from protobuf enum <code>SPAN_FLAGS_TRACE_FLAGS_MASK = 255;</code>
     */
    const SPAN_FLAGS_TRACE_FLAGS_MASK = 255;
    
    /**
     * Bits 8 and 9 are used to indicate that the parent span or link span is remote.
     * Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known.
     * Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote.
     *
     * Generated from protobuf enum <code>SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 256;</code>
     */
    const SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 256;
    
    /**
     * Generated from protobuf enum <code>SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512;</code>
     */
    const SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512;
    private static $valueToName = [
        self::SPAN_FLAGS_DO_NOT_USE => 'SPAN_FLAGS_DO_NOT_USE',
        self::SPAN_FLAGS_TRACE_FLAGS_MASK => 'SPAN_FLAGS_TRACE_FLAGS_MASK',
        self::SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK => 'SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK',
        self::SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK => 'SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK',
    ];
    public static function name($value) {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf('Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }
    public static function value($name) {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf('Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }

}

Members

Title Sort descending Modifiers Object type Summary
SpanFlags::$valueToName private static property
SpanFlags::name public static function
SpanFlags::SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK constant Bits 8 and 9 are used to indicate that the parent span or link span is remote.
Bit 8 (`HAS_IS_REMOTE`) indicates whether the value is known.
Bit 9 (`IS_REMOTE`) indicates whether the span or link is remote.
SpanFlags::SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK constant Generated from protobuf enum &lt;code&gt;SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512;&lt;/code&gt;
SpanFlags::SPAN_FLAGS_DO_NOT_USE constant The zero value for the enum. Should not be used for comparisons.
Instead use bitwise &quot;and&quot; with the appropriate mask as shown above.
SpanFlags::SPAN_FLAGS_TRACE_FLAGS_MASK constant Bits 0-7 are used for trace flags.
SpanFlags::value public static function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal