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

Breadcrumb

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

function ResourceInfo::merge

Merge current resource with an updating resource, combining all attributes. If a key exists on both the old and updating resource, the value of the updating resource MUST be picked (even if the updated value is empty)

@todo can we optimize this to avoid re-validating the attributes on merge?

See also

https://github.com/open-telemetry/opentelemetry-specification/blob/v1.2…

File

vendor/open-telemetry/sdk/Resource/ResourceInfo.php, line 64

Class

ResourceInfo
A Resource is an immutable representation of the entity producing telemetry. For example, a process producing telemetry that is running in a container on Kubernetes has a Pod name, it is in a namespace and possibly is part of a Deployment which also…

Namespace

OpenTelemetry\SDK\Resource

Code

public function merge(ResourceInfo $updating) : ResourceInfo {
    $schemaUrl = self::mergeSchemaUrl($this->getSchemaUrl(), $updating->getSchemaUrl());
    $attributes = Attributes::factory()->builder()
        ->merge($this->getAttributes(), $updating->getAttributes());
    return ResourceInfo::create($attributes, $schemaUrl);
}

API Navigation

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