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

Breadcrumb

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

function ProtobufSerializer::serializeSpanId

File

vendor/open-telemetry/exporter-otlp/ProtobufSerializer.php, line 62

Class

ProtobufSerializer
@internal @psalm-type SUPPORTED_CONTENT_TYPES = ContentTypes::PROTOBUF|ContentTypes::JSON|ContentTypes::NDJSON

Namespace

OpenTelemetry\Contrib\Otlp

Code

public function serializeSpanId(string $spanId) : string {
    // @phpstan-ignore-next-line
    return match ($this->contentType) {    ContentTypes::PROTOBUF => $spanId,
        ContentTypes::JSON, ContentTypes::NDJSON => base64_decode(bin2hex($spanId)),
    
    };
}
RSS feed
Powered by Drupal