diff --git a/experimental/packages/sdk-logs/src/LogRecord.ts b/experimental/packages/sdk-logs/src/LogRecord.ts index d827c7fa1d..7667b73550 100644 --- a/experimental/packages/sdk-logs/src/LogRecord.ts +++ b/experimental/packages/sdk-logs/src/LogRecord.ts @@ -26,7 +26,7 @@ import type { IResource } from '@opentelemetry/resources'; import type { ReadableLogRecord } from './export/ReadableLogRecord'; import type { LogRecordLimits } from './types'; -import { LogAttributes } from '@opentelemetry/api-logs'; +import { LogAttributes, LogAttributeValue } from '@opentelemetry/api-logs'; import { LoggerProviderSharedState } from './internal/LoggerProviderSharedState'; export class LogRecord implements ReadableLogRecord { @@ -38,7 +38,7 @@ export class LogRecord implements ReadableLogRecord { readonly attributes: logsAPI.LogAttributes = {}; private _severityText?: string; private _severityNumber?: logsAPI.SeverityNumber; - private _body?: string; + private _body?: LogAttributeValue; private totalAttributesCount: number = 0; private _isReadonly: boolean = false; @@ -64,13 +64,13 @@ export class LogRecord implements ReadableLogRecord { return this._severityNumber; } - set body(body: string | undefined) { + set body(body: LogAttributeValue | undefined) { if (this._isLogRecordReadonly()) { return; } this._body = body; } - get body(): string | undefined { + get body(): LogAttributeValue | undefined { return this._body; } diff --git a/experimental/packages/sdk-logs/src/export/ReadableLogRecord.ts b/experimental/packages/sdk-logs/src/export/ReadableLogRecord.ts index 2dc3ece865..d036a17ef2 100644 --- a/experimental/packages/sdk-logs/src/export/ReadableLogRecord.ts +++ b/experimental/packages/sdk-logs/src/export/ReadableLogRecord.ts @@ -17,7 +17,7 @@ import type { IResource } from '@opentelemetry/resources'; import type { HrTime, SpanContext } from '@opentelemetry/api'; import type { InstrumentationScope } from '@opentelemetry/core'; -import type { LogAttributes, SeverityNumber } from '@opentelemetry/api-logs'; +import type { LogAttributeValue, LogAttributes, SeverityNumber } from '@opentelemetry/api-logs'; export interface ReadableLogRecord { readonly hrTime: HrTime; @@ -25,7 +25,7 @@ export interface ReadableLogRecord { readonly spanContext?: SpanContext; readonly severityText?: string; readonly severityNumber?: SeverityNumber; - readonly body?: string; + readonly body?: LogAttributeValue; readonly resource: IResource; readonly instrumentationScope: InstrumentationScope; readonly attributes: LogAttributes;