Skip to content

Commit 0257c5a

Browse files
committed
added dedicated type for event data field
1 parent f0cc15e commit 0257c5a

File tree

1 file changed

+6
-4
lines changed
  • experimental/packages/api-events/src/types

1 file changed

+6
-4
lines changed

experimental/packages/api-events/src/types/Event.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { Attributes } from '@opentelemetry/api';
18-
import { LogAttributeValue } from '@opentelemetry/api-logs';
17+
import { AttributeValue, Attributes } from '@opentelemetry/api';
18+
import { LogAttributes } from '@opentelemetry/api-logs';
19+
20+
export type EventDataValue = AttributeValue | LogAttributes;
1921

2022
export interface Event {
2123
/**
@@ -29,10 +31,10 @@ export interface Event {
2931
name: string;
3032

3133
/**
32-
* Attributes that describe the event.
34+
* Data that describes the event.
3335
* Intended to be used by instrumentation libraries.
3436
*/
35-
data?: LogAttributeValue;
37+
data?: EventDataValue;
3638

3739
/**
3840
* Additional attributes that describe the event.

0 commit comments

Comments
 (0)