open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library

Home Page:https://opentelemetry.io/docs/instrumentation/php/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Save further cycles around resource merging by not re-validating attributes

bobstrecansky opened this issue · comments

Describe the solution you'd like
What do you want to happen instead? What is the expected behavior?

Save further cycles around resource merging by not re-validating attributes. This is most likely going to be done here: https://github.com/open-telemetry/opentelemetry-php/blob/main/src/SDK/Resource/ResourceInfo.php#L66

We also re-normalize values when merging attributes, probably unnecessarily.

Since attributes are validated+normalized when being created, we can be confident that are valid and do not need to be re-validated when we merge two resources (which we do a number of times when detecting resources).

Fixed by #1214