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

Breadcrumb

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

function OtlpUtil::getUserAgentHeader

@link https://github.com/open-telemetry/opentelemetry-specification/blob/main…

1 call to OtlpUtil::getUserAgentHeader()
OtlpUtil::getHeaders in vendor/open-telemetry/exporter-otlp/OtlpUtil.php

File

vendor/open-telemetry/exporter-otlp/OtlpUtil.php, line 70

Class

OtlpUtil

Namespace

OpenTelemetry\Contrib\Otlp

Code

public static function getUserAgentHeader() : array {
    static $header;
    if ($header === null) {
        $resource = (new Sdk())->getResource();
        $header = [
            'User-Agent' => sprintf('OTel OTLP Exporter PHP/%s', $resource->getAttributes()
                ->get(ResourceAttributes::TELEMETRY_SDK_VERSION) ?: 'unknown'),
        ];
    }
    return $header;
}

API Navigation

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