Skip to content

Commit

Permalink
add data field to the Event interface
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkuba committed Mar 22, 2024
1 parent 6547440 commit e0180de
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion experimental/packages/api-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"access": "public"
},
"dependencies": {
"@opentelemetry/api": "^1.0.0"
"@opentelemetry/api": "^1.0.0",
"@opentelemetry/api-logs": "0.49.1"
},
"devDependencies": {
"@types/mocha": "10.0.6",
Expand Down
7 changes: 7 additions & 0 deletions experimental/packages/api-events/src/types/Event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import { Attributes } from '@opentelemetry/api';
import { LogAttributeValue } from '@opentelemetry/api-logs';

export interface Event {
/**
Expand All @@ -27,6 +28,12 @@ export interface Event {
*/
name: string;

/**
* Attributes that describe the event.
* Intended to be used by instrumentation libraries.
*/
data?: LogAttributeValue;

/**
* Additional attributes that describe the event.
*/
Expand Down
3 changes: 3 additions & 0 deletions experimental/packages/api-events/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"references": [
{
"path": "../../../api"
},
{
"path": "../api-logs"
}
]
}
3 changes: 3 additions & 0 deletions experimental/packages/api-events/tsconfig.esnext.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
"references": [
{
"path": "../../../api"
},
{
"path": "../api-logs"
}
]
}
3 changes: 3 additions & 0 deletions experimental/packages/api-events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"references": [
{
"path": "../../../api"
},
{
"path": "../api-logs"
}
]
}
2 changes: 1 addition & 1 deletion experimental/packages/api-logs/src/types/LogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export interface LogRecord {
/**
* A value containing the body of the log record.
*/
body?: string;
body?: LogAttributeValue;

/**
* Attributes that define the log record.
Expand Down

0 comments on commit e0180de

Please sign in to comment.