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

Breadcrumb

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

function Span::setStatus

Same name in this branch
  1. 11.1.x vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span.php \Opentelemetry\Proto\Trace\V1\Span::setStatus()

@inheritDoc

File

vendor/open-telemetry/sdk/Trace/Span.php, line 227

Class

Span

Namespace

OpenTelemetry\SDK\Trace

Code

public function setStatus(string $code, ?string $description = null) : self {
    if ($this->hasEnded) {
        return $this;
    }
    // An attempt to set value Unset SHOULD be ignored.
    if ($code === API\StatusCode::STATUS_UNSET) {
        return $this;
    }
    // When span status is set to Ok it SHOULD be considered final and any further attempts to change it SHOULD be ignored.
    if ($this->status
        ->getCode() === API\StatusCode::STATUS_OK) {
        return $this;
    }
    $this->status = StatusData::create($code, $description);
    return $this;
}
RSS feed
Powered by Drupal