From 0257c5a6f0b0e3f4f0dcf718dbad53b0344d1751 Mon Sep 17 00:00:00 2001 From: Martin Kuba Date: Mon, 25 Mar 2024 09:52:43 -0700 Subject: [PATCH] added dedicated type for event data field --- experimental/packages/api-events/src/types/Event.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/experimental/packages/api-events/src/types/Event.ts b/experimental/packages/api-events/src/types/Event.ts index 8c493cb0c2..6c4b9900db 100644 --- a/experimental/packages/api-events/src/types/Event.ts +++ b/experimental/packages/api-events/src/types/Event.ts @@ -14,8 +14,10 @@ * limitations under the License. */ -import { Attributes } from '@opentelemetry/api'; -import { LogAttributeValue } from '@opentelemetry/api-logs'; +import { AttributeValue, Attributes } from '@opentelemetry/api'; +import { LogAttributes } from '@opentelemetry/api-logs'; + +export type EventDataValue = AttributeValue | LogAttributes; export interface Event { /** @@ -29,10 +31,10 @@ export interface Event { name: string; /** - * Attributes that describe the event. + * Data that describes the event. * Intended to be used by instrumentation libraries. */ - data?: LogAttributeValue; + data?: EventDataValue; /** * Additional attributes that describe the event.