mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
newrelic distributed tracing Transaction handle methods (#40550)
* Adds newrelic distributed tracing Transaction handle methods * Adds newrelic distributed tracing Transaction handle methods
This commit is contained in:
committed by
Sheetal Nandi
parent
6f4c34b258
commit
85e29d5a71
Vendored
+23
@@ -4,6 +4,7 @@
|
||||
// Brooks Patton <https://github.com/brookspatton>
|
||||
// Michael Bond <https://github.com/MichaelRBond>
|
||||
// Kyle Scully <https://github.com/zieka>
|
||||
// Kenneth Aasan <https://github.com/kennethaasan>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// https://docs.newrelic.com/docs/agents/nodejs-agent/api-guides/nodejs-agent-api
|
||||
@@ -354,6 +355,18 @@ export interface Metric {
|
||||
sumOfSquares: number;
|
||||
}
|
||||
|
||||
export interface DistributedTracePayload {
|
||||
/**
|
||||
* The base64 encoded JSON representation of the distributed trace payload.
|
||||
*/
|
||||
text(): string;
|
||||
|
||||
/**
|
||||
* The base64 encoded JSON representation of the distributed trace payload.
|
||||
*/
|
||||
httpSafe(): string;
|
||||
}
|
||||
|
||||
export interface TransactionHandle {
|
||||
/**
|
||||
* End the transaction.
|
||||
@@ -364,4 +377,14 @@ export interface TransactionHandle {
|
||||
* Mark the transaction to be ignored.
|
||||
*/
|
||||
ignore(): void;
|
||||
|
||||
/**
|
||||
* Creates a distributed trace payload.
|
||||
*/
|
||||
createDistributedTracePayload(): DistributedTracePayload;
|
||||
|
||||
/**
|
||||
* Parses incoming distributed trace header payload.
|
||||
*/
|
||||
acceptDistributedTracePayload(payload: DistributedTracePayload): void;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ const trans = newrelic.getTransaction();
|
||||
trans.ignore(); // $ExpectType void
|
||||
trans.end(); // $ExpectType void
|
||||
trans.end(() => {}); // $ExpectType void
|
||||
const payload = trans.createDistributedTracePayload(); // $ExpectType DistributedTracePayload
|
||||
trans.acceptDistributedTracePayload(payload); // $ExpectType void
|
||||
|
||||
newrelic.setDispatcher('foo'); // $ExpectType void
|
||||
newrelic.setDispatcher('foo', '42'); // $ExpectType void
|
||||
|
||||
Reference in New Issue
Block a user