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

Breadcrumb

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

function ProtobufSerializer::serialize

File

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

Class

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

Namespace

OpenTelemetry\Contrib\Otlp

Code

public function serialize(Message $message) : string {
    // @phpstan-ignore-next-line
    return match ($this->contentType) {    ContentTypes::PROTOBUF => $message->serializeToString(),
        ContentTypes::JSON => self::postProcessJsonEnumValues($message, $message->serializeToJsonString()),
        ContentTypes::NDJSON => self::postProcessJsonEnumValues($message, $message->serializeToJsonString()) . "\n",
    
    };
}

API Navigation

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