From 104a5e88673f52af76383665b5157c1c81316d7b Mon Sep 17 00:00:00 2001 From: Siim Kallas Date: Wed, 6 Dec 2023 11:14:24 +0200 Subject: [PATCH] fix(api-logs): allow passing in TimeInput for LogRecord (#4345) * fix: allow passing in TimeInput for LogRecord * chore: update changelog --- CHANGELOG.md | 1 + experimental/packages/api-logs/src/types/LogRecord.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22ce796f14..2a17af1e32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/ ### :bug: (Bug Fix) +* fix(api-logs): allow for TimeInput type for LogRecord timestamps [#4345](https://github.com/open-telemetry/opentelemetry-js/pull/4345) * fix(sdk-trace-web): only access location if it is defined [#4063](https://github.com/open-telemetry/opentelemetry-js/pull/4063) * fix(sdk-trace-base): processor onStart called with a span having empty attributes diff --git a/experimental/packages/api-logs/src/types/LogRecord.ts b/experimental/packages/api-logs/src/types/LogRecord.ts index 59718aa30b..69dd14f7cb 100644 --- a/experimental/packages/api-logs/src/types/LogRecord.ts +++ b/experimental/packages/api-logs/src/types/LogRecord.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { AttributeValue, Context } from '@opentelemetry/api'; +import { AttributeValue, Context, TimeInput } from '@opentelemetry/api'; export type LogAttributeValue = AttributeValue | LogAttributes; export interface LogAttributes { @@ -53,12 +53,12 @@ export interface LogRecord { /** * The time when the log record occurred as UNIX Epoch time in nanoseconds. */ - timestamp?: number; + timestamp?: TimeInput; /** * Time when the event was observed by the collection system. */ - observedTimestamp?: number; + observedTimestamp?: TimeInput; /** * Numerical value of the severity.