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

Breadcrumb

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

function ProtobufSerializer::serializeTraceId

File

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

Class

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

Namespace

OpenTelemetry\Contrib\Otlp

Code

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