Skip to content

Commit c69a371

Browse files
committed
use named interface for transaction metadata
1 parent 623584d commit c69a371

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/tracing/src/transaction.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ import { dropUndefinedKeys, isInstanceOf, logger } from '@sentry/utils';
44

55
import { Span as SpanClass, SpanRecorder } from './span';
66

7+
interface TransactionMetadata {
8+
transactionSampling?: { [key: string]: string | number };
9+
}
10+
711
/** JSDoc */
812
export class Transaction extends SpanClass implements TransactionInterface {
913
public name: string;
1014

11-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
12-
private _metadata: { [key: string]: any } = {};
15+
private _metadata: TransactionMetadata = {};
1316

1417
private _measurements: Measurements = {};
1518

@@ -72,8 +75,7 @@ export class Transaction extends SpanClass implements TransactionInterface {
7275
* Set metadata for this transaction.
7376
* @hidden
7477
*/
75-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
76-
public setMetadata(newMetadata: { [key: string]: any }): void {
78+
public setMetadata(newMetadata: TransactionMetadata): void {
7779
this._metadata = { ...this._metadata, ...newMetadata };
7880
}
7981

0 commit comments

Comments
 (0)