-
Notifications
You must be signed in to change notification settings - Fork 256
Phase 0 implementation #2717
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?
Phase 0 implementation #2717
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { IOTelErrorHandlers } from "../config/IOTelErrorHandlers"; | ||
| import { IOTelContext } from "./IOTelContext"; | ||
|
|
||
| /** | ||
| * Configuration interface for creating a context manager. | ||
| * | ||
| * @since 4.0.0 | ||
| */ | ||
| export interface IContextManagerConfig { | ||
| /** | ||
| * The parent / root context to use if there is no active context. | ||
| */ | ||
| parentContext?: IOTelContext; | ||
|
|
||
| /** | ||
| * Error handlers for internal diagnostics. | ||
| * | ||
| * @see {@link IOTelErrorHandlers} | ||
| */ | ||
| errorHandlers?: IOTelErrorHandlers; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,45 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { IOTelErrorHandlers } from "../config/IOTelErrorHandlers"; | ||
| import { IOTelResource } from "../resources/IOTelResource"; | ||
| import { IOTelLogRecordLimits } from "./IOTelLogRecordLimits"; | ||
| import { IOTelLogRecordProcessor } from "./IOTelLogRecordProcessor"; | ||
|
|
||
| /** | ||
| * Configuration interface for the OpenTelemetry LoggerProvider. | ||
| * Provides all configuration options required for LoggerProvider initialization. | ||
| * | ||
| * @remarks | ||
| * - The `resource` and `errorHandlers` properties are required | ||
| * - Config is used directly — never copied with spread operator | ||
| * - Supports dynamic configuration via `onConfigChange` callbacks | ||
| * | ||
| * @since 3.4.0 | ||
| */ | ||
| export interface IOTelLoggerProviderConfig { | ||
| /** Resource associated with trace telemetry */ | ||
| resource?: IOTelResource; | ||
| /** | ||
| * Resource information for telemetry source identification. | ||
| * Provides attributes that describe the entity producing telemetry. | ||
| */ | ||
| resource: IOTelResource; | ||
|
|
||
| /** | ||
| * Error handlers for internal diagnostics. | ||
| * Provides hooks to customize how different types of errors and | ||
| * diagnostic messages are handled. | ||
| * | ||
| * @see {@link IOTelErrorHandlers} | ||
| */ | ||
| errorHandlers: IOTelErrorHandlers; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as context |
||
|
|
||
| /** | ||
| * How long the forceFlush can run before it is cancelled. | ||
| * The default value is 30000ms | ||
| */ | ||
| forceFlushTimeoutMillis?: number; | ||
|
|
||
| /** Log Record Limits*/ | ||
| /** Log Record Limits */ | ||
| logRecordLimits?: IOTelLogRecordLimits; | ||
|
|
||
| /** Log Record Processors */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { ITraceHost } from "../../ai/ITraceProvider"; | ||
| import { IOTelErrorHandlers } from "../config/IOTelErrorHandlers"; | ||
|
|
||
| /** | ||
| * Configuration interface for creating a TracerProvider. | ||
| * | ||
| * @remarks | ||
| * The TracerProvider manages Tracer instances and delegates span creation | ||
| * to the configured trace host. | ||
| * | ||
| * @since 4.0.0 | ||
| */ | ||
| export interface ITracerProviderConfig { | ||
| /** | ||
| * The trace host that provides span creation and context management. | ||
| * | ||
| * @see {@link ITraceHost} | ||
| */ | ||
| host: ITraceHost; | ||
|
|
||
| /** | ||
| * Error handlers for internal diagnostics. | ||
| * | ||
| * @see {@link IOTelErrorHandlers} | ||
| */ | ||
| errorHandlers?: IOTelErrorHandlers; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as context -- and this being defined for context, logs and trace reinforces my original comment |
||
| } | ||
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.
I don't think we should have this defined here, the "implementation" should inherit/use the core (Sdk/Distro) config to use the errorHandlers -- which should be provided during initialization...
Otherwise, we could end up passing the same error handlers multiple times