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

Breadcrumb

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

function MetricConverter::setAttributes

Parameters

Resource_|NumberDataPoint|HistogramDataPoint|InstrumentationScope $pElement:

4 calls to MetricConverter::setAttributes()
MetricConverter::convertHistogramDataPoint in vendor/open-telemetry/exporter-otlp/MetricConverter.php
MetricConverter::convertNumberDataPoint in vendor/open-telemetry/exporter-otlp/MetricConverter.php
MetricConverter::convertResourceMetrics in vendor/open-telemetry/exporter-otlp/MetricConverter.php
MetricConverter::convertScopeMetrics in vendor/open-telemetry/exporter-otlp/MetricConverter.php

File

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

Class

MetricConverter

Namespace

OpenTelemetry\Contrib\Otlp

Code

private function setAttributes($pElement, SDK\Common\Attribute\AttributesInterface $attributes) : void {
    foreach ($attributes as $key => $value) {
        
        /** @psalm-suppress InvalidArgument */
        $pElement->getAttributes()[] = $pAttribute = new KeyValue();
        $pAttribute->setKey($key);
        $pAttribute->setValue(AttributesConverter::convertAnyValue($value));
    }
    if (method_exists($pElement, 'setDroppedAttributesCount')) {
        $pElement->setDroppedAttributesCount($attributes->getDroppedAttributesCount());
    }
}

API Navigation

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