Skip to content

Conversation

@JacksonWeber
Copy link

This pull request introduces a comprehensive set of new TypeScript interfaces and enums to the shared/OpenTelemetry/src directory, laying the groundwork for OpenTelemetry log record processing in the codebase. The changes add key abstractions for log records, loggers, processors, configuration, and severity levels, enabling structured logging and extensibility for future OpenTelemetry features.

Log Record and Severity Abstractions

  • Added the OTelSeverityNumber enum to standardize numerical severity levels for logs, supporting granular trace, debug, info, warn, error, and fatal levels. (OTelSeverityNumber.ts)
  • Introduced the IOTelLogRecord and IOTelSdkLogRecord interfaces to define the structure and mutator methods for log records, including attributes, body, severity, timestamps, and context. (IOTelLogRecord.ts, IOTelSdkLogRecord.ts) [1] [2]
  • Added ReadableLogRecord interface for immutable log record representation with high-resolution timestamps and dropped attribute tracking. (IOTelReadableLogRecord.ts)

Logger and Processor Interfaces

  • Defined IOTelLogger, IOTelLoggerProvider, and IOTelLoggerOptions interfaces to support logger creation, configuration, and log emission. (IOTelLogger.ts, IOTelLoggerProvider.ts, IOTelLoggerOptions.ts) [1] [2] [3]
  • Created IOTelLogRecordProcessor interface for log record processing lifecycle management, including force flush, shutdown, and onEmit handling. (IOTelLogRecordProcessor.ts)

Configuration and Exporter Support

  • Added configuration interfaces for batching, buffering, and log record limits, such as IOTelBufferConfig, IOTelBatchLogRecordProcessorBrowserConfig, and IOTelLogRecordLimits, supporting advanced log export and processing strategies. (IOTelBufferConfig.ts, IOTelBatchLogRecordProcessorBrowserConfig.ts, IOTelLogRecordLimits.ts) [1] [2] [3]
  • Introduced IOTelLogRecordExporter interface to allow configuration of different log exporters (console, OTLP HTTP/gRPC/file), preparing for future extensibility. (IOTelLogRecordExporter.ts)
  • Added IOTelLoggerProviderConfig for centralized logger provider configuration, including resource, flush timeout, log record limits, and processor registration. (IOTelLoggerProviderConfig.ts)

These additions set up the foundation for OpenTelemetry-compliant logging, enabling structured log creation, processing, and export in the browser and other environments.

@JacksonWeber JacksonWeber requested a review from a team as a code owner October 31, 2025 23:01
Copilot AI review requested due to automatic review settings November 6, 2025 19:24
Copy link
Contributor

Copilot AI left a 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 introduces OpenTelemetry logging interfaces for the Application Insights JavaScript SDK. It adds comprehensive interface definitions for the logging API, including log records, loggers, processors, and various configuration options.

Key changes:

  • Adds core log record interfaces (IOTelLogRecord, IOTelSdkLogRecord, and ReadableLogRecord)
  • Introduces logger and logger provider interfaces with configuration options
  • Defines log record processors, exporters, and batch processing configurations
  • Adds severity level enums and type definitions for log attributes and bodies

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
IOTelSdkLogRecord.ts Defines the SDK log record interface with read-write capabilities and builder methods
IOTelReadableLogRecord.ts Defines read-only log record interface for consumption by processors/exporters
IOTelLoggerProviderConfig.ts Configuration interface for logger provider including resource, limits, and processors
IOTelLoggerProvider.ts Logger provider interface for creating named loggers
IOTelLoggerOptions.ts Options interface for logger configuration including schema URL and trace context
IOTelLogger.ts Core logger interface defining the emit method
IOTelLogRecordProcessor.ts Processor interface for handling emitted log records
IOTelLogRecordLimits.ts Configuration limits for log record attributes
IOTelLogRecordExporter.ts Exporter interface (currently placeholder with commented sections)
IOTelLogRecord.ts Base log record interface with input properties
IOTelBufferConfig.ts Buffer configuration for batch processing
IOTelBatchLogRecordProcesorBrowserConfig.ts Browser-specific batch processor configuration
OTelSeverityNumber.ts Enum defining log severity levels
OTelAnyValue.ts Type definitions for flexible log attribute and body values

JacksonWeber and others added 2 commits November 6, 2025 12:01
…or.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@JacksonWeber JacksonWeber requested a review from MSNev November 6, 2025 20:01
@JacksonWeber JacksonWeber merged commit ceeac83 into microsoft:otel-sdk Nov 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants