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

Breadcrumb

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

function MetricConverter::convertExemplar

2 calls to MetricConverter::convertExemplar()
MetricConverter::convertHistogramDataPoint in vendor/open-telemetry/exporter-otlp/MetricConverter.php
MetricConverter::convertNumberDataPoint in vendor/open-telemetry/exporter-otlp/MetricConverter.php

File

vendor/open-telemetry/exporter-otlp/MetricConverter.php, line 219

Class

MetricConverter

Namespace

OpenTelemetry\Contrib\Otlp

Code

private function convertExemplar(SDK\Metrics\Data\Exemplar $exemplar) : Exemplar {
    $pExemplar = new Exemplar();
    $this->setFilteredAttributes($pExemplar, $exemplar->attributes);
    $pExemplar->setTimeUnixNano($exemplar->timestamp);
    $pExemplar->setSpanId($this->serializer
        ->serializeSpanId(hex2bin((string) $exemplar->spanId)));
    $pExemplar->setTraceId($this->serializer
        ->serializeTraceId(hex2bin((string) $exemplar->traceId)));
    if (is_int($exemplar->value)) {
        $pExemplar->setAsInt($exemplar->value);
    }
    if (is_float($exemplar->value)) {
        $pExemplar->setAsDouble($exemplar->value);
    }
    return $pExemplar;
}

API Navigation

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