Skip to content

Allow users to customize AttributesProcessor and append to exist View #6981

@RuoqianXu

Description

@RuoqianXu

Is your feature request related to a problem? Please describe.
I am a framework developer, and my framework integrates the opentelemetry sdk. In my case, I need to trim or perform additional processing on the attributes of all instrument metrics (to adapt to different observability systems). Although I can achieve attribute trimming by registering a View, if there are already existing views, I need to modify all of them. The io.opentelemetry.sdk.metrics.internal.view.AttributesProcessor can solve my problem. However, the current constructor of AttributesProcessor is not public, and the getAttributesProcessor method in the io.opentelemetry.sdk.metrics.View class and the addAttributesProcessor method in the io.opentelemetry.sdk.metrics.ViewBuilder are also not public. Currently, I can only use reflection for handling.

Describe the solution you'd like
Make AttributesProcessor, getAttributesProcessor, and addAttributesProcessor public. hopefully View can be mutable, it is not possible to directly append AttributesProcessor to an existing view now.

Describe alternatives you've considered
Maybe AttributesProcessor can be separated from View, can be registered in SdkMeterProviderBuilder. Similar to View, can use InstrumentSelector to select instrument metrics to apply AttributesProcessors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestSuggest an idea for this projectblocked:specblocked on open or unresolved spec

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions