Skip to content

Commit 20f4bbc

Browse files
committed
random cleanup
1 parent f2c8fbd commit 20f4bbc

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
lines changed

packages/angular/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ components initializations.
7676

7777
#### Install
7878

79-
Registering a Trace Service is a 3 step process.
79+
Registering a Trace Service is a 3-step process.
8080

8181
1. Register and configure the `BrowserTracing` integration from `@sentry/tracing`, including custom Angular routing
8282
instrumentation:

packages/node/src/handlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { flush } from './sdk';
1515
const DEFAULT_SHUTDOWN_TIMEOUT = 2000;
1616

1717
/**
18-
* Express compatible tracing handler.
18+
* Express-compatible tracing handler.
1919
* @see Exposed as `Handlers.tracingHandler`
2020
*/
2121
export function tracingHandler(): (
@@ -28,7 +28,7 @@ export function tracingHandler(): (
2828
res: http.ServerResponse,
2929
next: (error?: any) => void,
3030
): void {
31-
// TODO: At this point req.route.path we use in `extractTransaction` is not available
31+
// TODO: At this point `req.route.path` (which we use in `extractTransaction`) is not available
3232
// but `req.path` or `req.url` should do the job as well. We could unify this here.
3333
const reqMethod = (req.method || '').toUpperCase();
3434
const reqUrl = req.url;

packages/tracing/src/hubextensions.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,18 +104,22 @@ function getDefaultSampleContext(): SampleContext {
104104
const defaultSampleContext: SampleContext = {};
105105

106106
if (isNodeEnv()) {
107-
// look at koa TODO
108107
const domain = getActiveDomain();
109-
const nodeHttpModule = dynamicRequire(module, 'http');
110-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
111-
const requestType = nodeHttpModule.IncomingMessage;
108+
112109
if (domain) {
113-
// TODO is the below true?
114110
// for all node servers that we currently support, we store the incoming request object (which is an instance of
115-
// http.IncomingMessage) on the domain the domain is stored as an array, so our only way to find the request is to
116-
// iterate through the array and compare types
117-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
111+
// http.IncomingMessage) on the domain
112+
113+
// the domain members are stored as an array, so our only way to find the request is to iterate through the array
114+
// and compare types
115+
116+
const nodeHttpModule = dynamicRequire(module, 'http');
117+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
118+
const requestType = nodeHttpModule.IncomingMessage;
119+
120+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
118121
const request = domain.members.find((member: any) => isInstanceOf(member, requestType));
122+
119123
if (request) {
120124
defaultSampleContext.request = extractNodeRequestData(request);
121125
}

packages/tracing/src/transaction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export class Transaction extends SpanClass {
6868
this.name = '<unlabeled transaction>';
6969
}
7070

71+
// just sets the end timestamp
7172
super.finish(endTimestamp);
7273

7374
if (this.sampled !== true) {

packages/types/src/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,5 +157,5 @@ export interface Options {
157157
*
158158
* @returns A sample rate between 0 and 1 (0 drops the trace, 1 guarantees it will be sent).
159159
*/
160-
tracesSampler?(traceContext: SampleContext): number;
160+
tracesSampler?(sampleContext: SampleContext): number;
161161
}

packages/types/src/transaction.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export interface Transaction extends TransactionContext, Span {
5151

5252
/**
5353
* The data passed to the `tracesSampler` function, which forms the basis for whatever decisions it might make.
54+
* Combination of default values (which differ per SDK/integration) and data passed to `startTransaction`.
5455
*/
5556
export interface SampleContext {
56-
[key: string]: string;
57-
// TODO (kmclb) fill this out
57+
[key: string]: any;
5858
}

0 commit comments

Comments
 (0)