Follow up PR: Address feedback on OTEL Logs SDK#2680
Follow up PR: Address feedback on OTEL Logs SDK#2680rads-1996 wants to merge 3 commits intomicrosoft:otel-sdkfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds noop (no-operation) implementations for the OpenTelemetry metrics API, enabling the SDK to provide safe default behavior when metrics functionality is disabled or not configured. The PR introduces two new interface type definitions and two noop factory functions.
Key changes:
- Added
IObservableCallbackandIMetricAttributestype definitions for metrics support - Implemented
createNoopMeter()andcreateNoopMeterProvider()factory functions that return non-functional metric implementations
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
shared/OpenTelemetry/src/interfaces/metrics/meter/IObservableCallback.ts |
Defines callback type for observable metrics with generic attribute types |
shared/OpenTelemetry/src/interfaces/metrics/meter/IMetricAttributes.ts |
Type alias for metric attributes extending base OTel attributes |
shared/OpenTelemetry/src/api/noop/noopMeterProvider.ts |
Factory function creating noop meter provider implementation |
shared/OpenTelemetry/src/api/noop/noopMeter.ts |
Factory functions for noop meter and all metric types (Counter, Gauge, Histogram, Observable variants) |
shared/OpenTelemetry/src/interfaces/metrics/meter/IObservableCallback.ts
Outdated
Show resolved
Hide resolved
| const handlers: IOTelErrorHandlers = {}; | ||
| const attributeContainer = createAttributeContainer<any>( | ||
| { | ||
| traceCfg: { |
There was a problem hiding this comment.
The config should be injected from the main config and not applied here as it's own version (non-user configurable)
|
This PR has been inactive for 30 days and has been marked as abandoned. You can remove this label by commenting or pushing new changes. If it remains inactive with the abandoned label, it will eventually also be marked as stale and closed. |
|
work in progress. |
No description provided.