-
Notifications
You must be signed in to change notification settings - Fork 255
Follow up PR: Address feedback on OTEL Logs SDK #2680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: otel-sdk
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config should be injected from the main config and not applied here as it's own version (non-user configurable)
No description provided.