Skip to content

Commit 4c2b01e

Browse files
committed
fix: rename evaluation event property from data to body
Signed-off-by: Michael Beemer <[email protected]>
1 parent 40deec0 commit 4c2b01e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/shared/src/telemetry/evaluation-event.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { TelemetryFlagMetadata } from './flag-metadata';
88
type EvaluationEvent = {
99
name: string;
1010
attributes: Record<string, string | number | boolean>;
11-
data: Record<string, JsonValue>;
11+
body: Record<string, JsonValue>;
1212
};
1313

1414
const FLAG_EVALUATION_EVENT_NAME = 'feature_flag.evaluation';
@@ -28,12 +28,12 @@ export function createEvaluationEvent(
2828
[TelemetryAttribute.PROVIDER]: hookContext.providerMetadata.name,
2929
[TelemetryAttribute.REASON]: (evaluationDetails.reason ?? StandardResolutionReasons.UNKNOWN).toLowerCase(),
3030
};
31-
const data: EvaluationEvent['data'] = {};
31+
const body: EvaluationEvent['body'] = {};
3232

3333
if (evaluationDetails.variant) {
3434
attributes[TelemetryAttribute.VARIANT] = evaluationDetails.variant;
3535
} else {
36-
data[TelemetryEvaluationData.VALUE] = evaluationDetails.value;
36+
body[TelemetryEvaluationData.VALUE] = evaluationDetails.value;
3737
}
3838

3939
const contextId =
@@ -62,6 +62,6 @@ export function createEvaluationEvent(
6262
return {
6363
name: FLAG_EVALUATION_EVENT_NAME,
6464
attributes,
65-
data,
65+
body,
6666
};
6767
}

packages/shared/test/telemetry.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('evaluationEvent', () => {
4444
[TelemetryAttribute.REASON]: StandardResolutionReasons.STATIC.toLowerCase(),
4545
[TelemetryAttribute.CONTEXT_ID]: 'test-target',
4646
});
47-
expect(result.data).toEqual({
47+
expect(result.body).toEqual({
4848
[TelemetryEvaluationData.VALUE]: true,
4949
});
5050
});

0 commit comments

Comments
 (0)