Add singleton flags to factories and standardize attributes #12057
+566
−160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is an extension of #11344 that addresses #11814.
Major changes:
Metadata()
method toreceiver.Factory
,exporter.Factory
andconnector.Factory
(processor.Factory
excluded intentionally as described in Loggers for shared components should not report signal type. #11814). TheseMetadata()
methods returnMetadata
structs, which act similarly toconsumer.Capabilities
in that they are intended as a set of information which describes the components which the factory produces.go.opentelemetry.io/otel/attribute.Set
. This set is used as the ID in the graph, but also as the set of attributes that creates the logger. In the future, the set will be automatically used to describe other aspects of the collector's own telemetry.Minor changes:
Metadata
from the appropriate factory. There is a minor user facing change in that the error message is not wrapped in a "could not build" prefix. I moved the processors to this pattern as well in order to match the other components.