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

Breadcrumb

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

interface TraceStateInterface

TraceState parses and stores the tracestate header as an immutable list of string key/value pairs. It provides the following operations following the rules described in the W3C Trace Context specification:

  • Get value for a given key
  • Add a new key/value pair
  • Update an existing value for a given key
  • Delete a key/value pair

All mutating operations return a new TraceState with the modifications applied.

Hierarchy

  • interface \OpenTelemetry\API\Trace\TraceStateInterface

Expanded class hierarchy of TraceStateInterface

All classes that implement TraceStateInterface

See also

https://www.w3.org/TR/trace-context/#tracestate-header

https://github.com/open-telemetry/opentelemetry-specification/blob/mast…

File

vendor/open-telemetry/api/Trace/TraceStateInterface.php, line 21

Namespace

OpenTelemetry\API\Trace
View source
interface TraceStateInterface {
    
    /**
     * Return a new TraceState object that inherits from this TraceState
     * and contains the given key value pair.
     *
     * @return TraceStateInterface
     */
    public function with(string $key, string $value) : TraceStateInterface;
    
    /**
     * Return a new TraceState object that inherits from this TraceState
     * without the given key value pair.
     *
     * @return TraceStateInterface
     */
    public function without(string $key) : TraceStateInterface;
    
    /**
     * Return the value of a given key from this TraceState if it exists
     *
     * @return string|null
     */
    public function get(string $key) : ?string;
    
    /**
     * Get the list-member count in this TraceState
     *
     * @return int
     */
    public function getListMemberCount() : int;
    
    /**
     * Returns the concatenated string representation.
     *
     * @param int|null $limit maximum length of the returned representation
     * @return string the string representation
     *
     * @see https://www.w3.org/TR/trace-context/#tracestate-limits
     */
    public function toString(?int $limit = null) : string;
    
    /**
     * Returns a string representation of this TraceSate
     */
    public function __toString() : string;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
TraceStateInterface::get public function Return the value of a given key from this TraceState if it exists 1
TraceStateInterface::getListMemberCount public function Get the list-member count in this TraceState 1
TraceStateInterface::toString public function Returns the concatenated string representation. 1
TraceStateInterface::with public function Return a new TraceState object that inherits from this TraceState
and contains the given key value pair.
1
TraceStateInterface::without public function Return a new TraceState object that inherits from this TraceState
without the given key value pair.
1
TraceStateInterface::__toString public function Returns a string representation of this TraceSate 1

API Navigation

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