in exporters/metrics/src/main/java/com/google/cloud/opentelemetry/metric/AggregateByLabelMetricTimeSeriesBuilder.java [180:193]
private Attributes instrumentationLibraryLabels(
Attributes attributes, InstrumentationScopeInfo instrumentationScopeInfo) {
if (!instrumentationLibraryLabelsEnabled) {
return attributes;
}
return attributes.toBuilder()
.put(
AttributeKey.stringKey(LABEL_INSTRUMENTATION_SOURCE),
instrumentationScopeInfo.getName())
.put(
AttributeKey.stringKey(LABEL_INSTRUMENTATION_VERSION),
Optional.ofNullable(instrumentationScopeInfo.getVersion()).orElse(""))
.build();
}