Skip to content

NodeSDK should accept multiple metricReaders #5760

Open
@trentm

Description

@trentm

The NodeSDK (from @opentelemetry/sdk-node) constructor currently supports a metricReader option:

export interface NodeSDKConfiguration {
...
  /** @deprecated use logRecordProcessors instead*/
  logRecordProcessor: LogRecordProcessor;
  logRecordProcessors?: LogRecordProcessor[];
  metricReader: IMetricReader;
...
  /** @deprecated use spanProcessors instead*/
  spanProcessor?: SpanProcessor;
  spanProcessors?: SpanProcessor[];
...
}

AFAICT there isn't a way to specify multiple metric readers.

(Trying to get a handle on the registered MeterProvider after sdk.start() and adding additional MetricReaders isn't possible because (a) MeterProvider.addMetricReader() was dropped in SDK v2.0 and (b) one would likely run into #4112.)

Is there a reason to not add a metricReaders (plural) option to NodeSDKConfiguration and deprecate the singular metricReader -- as was done for spanProcessors and logRecordProcessors?

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersneeds:code-contributionThis feature/bug is ready to implementtriage:acceptedThis feature has been acceptedtype:featureA feature with no sub-issues to addressup-for-grabsGood for taking. Extra help will be provided by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions