@opentelemetry/instrumentation-http 0.222.0 → 0.300.0-development.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/_virtual/_rolldown/runtime.mjs +5 -0
- package/dist/http.cjs +425 -0
- package/dist/http.cjs.map +1 -0
- package/dist/http.d.cts +61 -0
- package/dist/http.d.cts.map +1 -0
- package/dist/http.d.mts +61 -0
- package/dist/http.d.mts.map +1 -0
- package/dist/http.mjs +425 -0
- package/dist/http.mjs.map +1 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +2 -0
- package/dist/internal-types.cjs +32 -0
- package/dist/internal-types.cjs.map +1 -0
- package/dist/internal-types.mjs +29 -0
- package/dist/internal-types.mjs.map +1 -0
- package/dist/semconv.cjs +18 -0
- package/dist/semconv.cjs.map +1 -0
- package/dist/semconv.mjs +17 -0
- package/dist/semconv.mjs.map +1 -0
- package/dist/types.d.cts +112 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +112 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/utils.cjs +486 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.mjs +471 -0
- package/dist/utils.mjs.map +1 -0
- package/dist/version.cjs +6 -0
- package/dist/version.cjs.map +1 -0
- package/dist/version.mjs +6 -0
- package/dist/version.mjs.map +1 -0
- package/package.json +35 -25
- package/build/src/http.d.ts +0 -61
- package/build/src/http.js +0 -562
- package/build/src/http.js.map +0 -1
- package/build/src/index.d.ts +0 -3
- package/build/src/index.js +0 -10
- package/build/src/index.js.map +0 -1
- package/build/src/internal-types.d.ts +0 -42
- package/build/src/internal-types.js +0 -32
- package/build/src/internal-types.js.map +0 -1
- package/build/src/semconv.d.ts +0 -17
- package/build/src/semconv.js +0 -29
- package/build/src/semconv.js.map +0 -1
- package/build/src/types.d.ts +0 -115
- package/build/src/types.js +0 -3
- package/build/src/types.js.map +0 -1
- package/build/src/utils.d.ts +0 -105
- package/build/src/utils.js +0 -655
- package/build/src/utils.js.map +0 -1
- package/build/src/version.d.ts +0 -2
- package/build/src/version.js +0 -10
- package/build/src/version.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/internal-types.ts
|
|
2
|
+
/**
|
|
3
|
+
* Names of possible synthetic test sources.
|
|
4
|
+
*/
|
|
5
|
+
const SYNTHETIC_TEST_NAMES = ["alwayson"];
|
|
6
|
+
/**
|
|
7
|
+
* Names of possible synthetic bot sources.
|
|
8
|
+
*/
|
|
9
|
+
const SYNTHETIC_BOT_NAMES = ["googlebot", "bingbot"];
|
|
10
|
+
/**
|
|
11
|
+
* REDACTED string used to replace sensitive information in URLs.
|
|
12
|
+
*/
|
|
13
|
+
const STR_REDACTED = "REDACTED";
|
|
14
|
+
/**
|
|
15
|
+
* List of URL query keys that are considered sensitive and whose value should be redacted.
|
|
16
|
+
*/
|
|
17
|
+
const DEFAULT_QUERY_STRINGS_TO_REDACT = [
|
|
18
|
+
"sig",
|
|
19
|
+
"Signature",
|
|
20
|
+
"AWSAccessKeyId",
|
|
21
|
+
"X-Goog-Signature",
|
|
22
|
+
"X-Amz-Signature",
|
|
23
|
+
"X-Amz-Credential",
|
|
24
|
+
"X-Amz-Security-Token"
|
|
25
|
+
];
|
|
26
|
+
//#endregion
|
|
27
|
+
export { DEFAULT_QUERY_STRINGS_TO_REDACT, STR_REDACTED, SYNTHETIC_BOT_NAMES, SYNTHETIC_TEST_NAMES };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=internal-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-types.mjs","names":[],"sources":["../src/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type * as http from 'http';\nimport type * as https from 'https';\nimport type { get, IncomingMessage, request } from 'http';\nimport type * as url from 'url';\n\nexport type IgnoreMatcher = string | RegExp | ((url: string) => boolean);\nexport type HttpCallback = (res: IncomingMessage) => void;\nexport type RequestFunction = typeof request;\nexport type GetFunction = typeof get;\n\nexport type HttpCallbackOptional = HttpCallback | undefined;\n\n// from node 10+\nexport type RequestSignature = [http.RequestOptions, HttpCallbackOptional] &\n HttpCallback;\n\nexport type HttpRequestArgs = Array<HttpCallbackOptional | RequestSignature>;\n\nexport type ParsedRequestOptions =\n | (http.RequestOptions & Partial<url.UrlWithParsedQuery>)\n | http.RequestOptions;\nexport type Http = typeof http;\nexport type Https = typeof https;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type Func<T> = (...args: any[]) => T;\n\nexport interface Err extends Error {\n errno?: number;\n code?: string;\n path?: string;\n syscall?: string;\n stack?: string;\n}\n\n/**\n * Names of possible synthetic test sources.\n */\nexport const SYNTHETIC_TEST_NAMES = ['alwayson'];\n\n/**\n * Names of possible synthetic bot sources.\n */\nexport const SYNTHETIC_BOT_NAMES = ['googlebot', 'bingbot'];\n\n/**\n * REDACTED string used to replace sensitive information in URLs.\n */\nexport const STR_REDACTED = 'REDACTED';\n\n/**\n * List of URL query keys that are considered sensitive and whose value should be redacted.\n */\nexport const DEFAULT_QUERY_STRINGS_TO_REDACT = [\n 'sig',\n 'Signature',\n 'AWSAccessKeyId',\n 'X-Goog-Signature',\n 'X-Amz-Signature',\n 'X-Amz-Credential',\n 'X-Amz-Security-Token',\n] as const;\n"],"mappings":";;;;AA0CA,MAAa,uBAAuB,CAAC,UAAU;;;;AAK/C,MAAa,sBAAsB,CAAC,aAAa,SAAS;;;;AAK1D,MAAa,eAAe;;;;AAK5B,MAAa,kCAAkC;CAC7C;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
|
package/dist/semconv.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/semconv.ts
|
|
2
|
+
/**
|
|
3
|
+
* Specifies the category of synthetic traffic, such as tests or bots.
|
|
4
|
+
*
|
|
5
|
+
* @note This attribute **MAY** be derived from the contents of the `user_agent.original` attribute. Components that populate the attribute are responsible for determining what they consider to be synthetic bot or test traffic. This attribute can either be set for self-identification purposes, or on telemetry detected to be generated as a result of a synthetic request. This attribute is useful for distinguishing between genuine client traffic and synthetic traffic generated by bots or tests.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
8
|
+
*/
|
|
9
|
+
const ATTR_USER_AGENT_SYNTHETIC_TYPE = "user_agent.synthetic.type";
|
|
10
|
+
/**
|
|
11
|
+
* Enum value "test" for attribute {@link ATTR_USER_AGENT_SYNTHETIC_TYPE}.
|
|
12
|
+
*/
|
|
13
|
+
const USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST = "test";
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.ATTR_USER_AGENT_SYNTHETIC_TYPE = ATTR_USER_AGENT_SYNTHETIC_TYPE;
|
|
16
|
+
exports.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST = USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST;
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=semconv.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.cjs","names":[],"sources":["../src/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Specifies the category of synthetic traffic, such as tests or bots.\n *\n * @note This attribute **MAY** be derived from the contents of the `user_agent.original` attribute. Components that populate the attribute are responsible for determining what they consider to be synthetic bot or test traffic. This attribute can either be set for self-identification purposes, or on telemetry detected to be generated as a result of a synthetic request. This attribute is useful for distinguishing between genuine client traffic and synthetic traffic generated by bots or tests.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_USER_AGENT_SYNTHETIC_TYPE =\n 'user_agent.synthetic.type' as const;\n\n/**\n * Enum value \"bot\" for attribute {@link ATTR_USER_AGENT_SYNTHETIC_TYPE}.\n */\nexport const USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT = 'bot' as const;\n\n/**\n * Enum value \"test\" for attribute {@link ATTR_USER_AGENT_SYNTHETIC_TYPE}.\n */\nexport const USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST = 'test' as const;\n"],"mappings":";;;;;;;;AAkBA,MAAa,iCACX;;;;AAUF,MAAa,uCAAuC"}
|
package/dist/semconv.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/semconv.ts
|
|
2
|
+
/**
|
|
3
|
+
* Specifies the category of synthetic traffic, such as tests or bots.
|
|
4
|
+
*
|
|
5
|
+
* @note This attribute **MAY** be derived from the contents of the `user_agent.original` attribute. Components that populate the attribute are responsible for determining what they consider to be synthetic bot or test traffic. This attribute can either be set for self-identification purposes, or on telemetry detected to be generated as a result of a synthetic request. This attribute is useful for distinguishing between genuine client traffic and synthetic traffic generated by bots or tests.
|
|
6
|
+
*
|
|
7
|
+
* @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
|
|
8
|
+
*/
|
|
9
|
+
const ATTR_USER_AGENT_SYNTHETIC_TYPE = "user_agent.synthetic.type";
|
|
10
|
+
/**
|
|
11
|
+
* Enum value "test" for attribute {@link ATTR_USER_AGENT_SYNTHETIC_TYPE}.
|
|
12
|
+
*/
|
|
13
|
+
const USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST = "test";
|
|
14
|
+
//#endregion
|
|
15
|
+
export { ATTR_USER_AGENT_SYNTHETIC_TYPE, USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=semconv.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.mjs","names":[],"sources":["../src/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * Specifies the category of synthetic traffic, such as tests or bots.\n *\n * @note This attribute **MAY** be derived from the contents of the `user_agent.original` attribute. Components that populate the attribute are responsible for determining what they consider to be synthetic bot or test traffic. This attribute can either be set for self-identification purposes, or on telemetry detected to be generated as a result of a synthetic request. This attribute is useful for distinguishing between genuine client traffic and synthetic traffic generated by bots or tests.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_USER_AGENT_SYNTHETIC_TYPE =\n 'user_agent.synthetic.type' as const;\n\n/**\n * Enum value \"bot\" for attribute {@link ATTR_USER_AGENT_SYNTHETIC_TYPE}.\n */\nexport const USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT = 'bot' as const;\n\n/**\n * Enum value \"test\" for attribute {@link ATTR_USER_AGENT_SYNTHETIC_TYPE}.\n */\nexport const USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST = 'test' as const;\n"],"mappings":";;;;;;;;AAkBA,MAAa,iCACX;;;;AAUF,MAAa,uCAAuC"}
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Attributes, Span } from "@opentelemetry/api";
|
|
3
|
+
import { ClientRequest, IncomingMessage, RequestOptions, ServerResponse } from "http";
|
|
4
|
+
import { InstrumentationConfig } from "@opentelemetry/instrumentation";
|
|
5
|
+
//#region src/types.d.ts
|
|
6
|
+
interface HttpCustomAttributeFunction {
|
|
7
|
+
(span: Span, request: ClientRequest | IncomingMessage, response: IncomingMessage | ServerResponse): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Called with each incoming request. Return `true` to skip creating a server
|
|
11
|
+
* span for that request.
|
|
12
|
+
*/
|
|
13
|
+
interface IgnoreIncomingRequestFunction {
|
|
14
|
+
(request: IncomingMessage): boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Called with each outgoing request's parsed options. Return `true` to skip
|
|
18
|
+
* creating a client span for that request.
|
|
19
|
+
*/
|
|
20
|
+
interface IgnoreOutgoingRequestFunction {
|
|
21
|
+
(request: RequestOptions): boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Called with the active span and request before the request is handled.
|
|
25
|
+
*/
|
|
26
|
+
interface HttpRequestCustomAttributeFunction {
|
|
27
|
+
(span: Span, request: ClientRequest | IncomingMessage): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Called with the active span and response before the response is handled.
|
|
31
|
+
*/
|
|
32
|
+
interface HttpResponseCustomAttributeFunction {
|
|
33
|
+
(span: Span, response: IncomingMessage | ServerResponse): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Called before an incoming request span is started. Returned attributes are
|
|
37
|
+
* added to the new server span.
|
|
38
|
+
*/
|
|
39
|
+
interface StartIncomingSpanCustomAttributeFunction {
|
|
40
|
+
(request: IncomingMessage): Attributes;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Called with an outgoing request's parsed options before the span is started.
|
|
44
|
+
* Returned attributes are added to the new client span.
|
|
45
|
+
*/
|
|
46
|
+
interface StartOutgoingSpanCustomAttributeFunction {
|
|
47
|
+
(request: RequestOptions): Attributes;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Options available for the HTTP instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http#http-instrumentation-options))
|
|
51
|
+
*/
|
|
52
|
+
interface HttpInstrumentationConfig extends InstrumentationConfig {
|
|
53
|
+
/** Do not trace incoming requests for which this function returns `true`. */
|
|
54
|
+
ignoreIncomingRequestHook?: IgnoreIncomingRequestFunction;
|
|
55
|
+
/** Do not trace outgoing requests for which this function returns `true`. */
|
|
56
|
+
ignoreOutgoingRequestHook?: IgnoreOutgoingRequestFunction;
|
|
57
|
+
/** If set to true, incoming requests will not be instrumented at all. */
|
|
58
|
+
disableIncomingRequestInstrumentation?: boolean;
|
|
59
|
+
/** If set to true, outgoing requests will not be instrumented at all. */
|
|
60
|
+
disableOutgoingRequestInstrumentation?: boolean;
|
|
61
|
+
/** Function for adding custom attributes after response is handled */
|
|
62
|
+
applyCustomAttributesOnSpan?: HttpCustomAttributeFunction;
|
|
63
|
+
/** Function for adding custom attributes before request is handled */
|
|
64
|
+
requestHook?: HttpRequestCustomAttributeFunction;
|
|
65
|
+
/** Function for adding custom attributes before response is handled */
|
|
66
|
+
responseHook?: HttpResponseCustomAttributeFunction;
|
|
67
|
+
/** Function for adding custom attributes before a span is started in incomingRequest */
|
|
68
|
+
startIncomingSpanHook?: StartIncomingSpanCustomAttributeFunction;
|
|
69
|
+
/** Function for adding custom attributes before a span is started in outgoingRequest */
|
|
70
|
+
startOutgoingSpanHook?: StartOutgoingSpanCustomAttributeFunction;
|
|
71
|
+
/** Require parent to create span for outgoing requests */
|
|
72
|
+
requireParentforOutgoingSpans?: boolean;
|
|
73
|
+
/** Require parent to create span for incoming requests */
|
|
74
|
+
requireParentforIncomingSpans?: boolean;
|
|
75
|
+
/** Map the following HTTP headers to span attributes. */
|
|
76
|
+
headersToSpanAttributes?: {
|
|
77
|
+
client?: {
|
|
78
|
+
requestHeaders?: string[];
|
|
79
|
+
responseHeaders?: string[];
|
|
80
|
+
};
|
|
81
|
+
server?: {
|
|
82
|
+
requestHeaders?: string[];
|
|
83
|
+
responseHeaders?: string[];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Enable automatic population of synthetic source type based on the user-agent header
|
|
88
|
+
* @experimental
|
|
89
|
+
**/
|
|
90
|
+
enableSyntheticSourceDetection?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* [Optional] Query parameters to redact on outgoing (client) spans.
|
|
93
|
+
* Use this to specify custom query strings that contain sensitive information.
|
|
94
|
+
* These will replace/overwrite the default query strings that are to be redacted.
|
|
95
|
+
* When omitted, defaults to a built-in list of known sensitive parameter
|
|
96
|
+
* names; see the package README for the current list.
|
|
97
|
+
* Set to an empty array to disable client-side query parameter redaction entirely.
|
|
98
|
+
* @experimental
|
|
99
|
+
*/
|
|
100
|
+
redactedQueryParams?: string[];
|
|
101
|
+
/**
|
|
102
|
+
* [Optional] Query parameters to redact on incoming (server) spans.
|
|
103
|
+
* When omitted, defaults to a built-in list of known sensitive parameter
|
|
104
|
+
* names; see the package README for the current list.
|
|
105
|
+
* Set to an empty array to disable server-side query parameter redaction entirely.
|
|
106
|
+
* @experimental
|
|
107
|
+
*/
|
|
108
|
+
redactedQueryParamsServer?: string[];
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { HttpCustomAttributeFunction, HttpInstrumentationConfig, HttpRequestCustomAttributeFunction, HttpResponseCustomAttributeFunction, IgnoreIncomingRequestFunction, IgnoreOutgoingRequestFunction, StartIncomingSpanCustomAttributeFunction, StartOutgoingSpanCustomAttributeFunction };
|
|
112
|
+
//# sourceMappingURL=types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.cts","names":[],"sources":["../src/types.d.ts"],"mappings":";;;;;UAIiB;GACZ,MAAM,MAAM,SAAS,gBAAgB,iBAAiB,UAAU,kBAAkB;;;;;;UAMtE;GACZ,SAAS;;;;;;UAMG;GACZ,SAAS;;;;;UAKG;GACZ,MAAM,MAAM,SAAS,gBAAgB;;;;;UAKzB;GACZ,MAAM,MAAM,UAAU,kBAAkB;;;;;;UAM5B;GACZ,SAAS,kBAAkB;;;;;;UAMf;GACZ,SAAS,iBAAiB;;;;;UAKd,kCAAkC;;EAE/C,4BAA4B;;EAE5B,4BAA4B;;EAE5B;;EAEA;;EAEA,8BAA8B;;EAE9B,cAAc;;EAEd,eAAe;;EAEf,wBAAwB;;EAExB,wBAAwB;;EAExB;;EAEA;;EAEA;IACI;MACI;MACA;;IAEJ;MACI;MACA;;;;;;;EAOR;;;;;;;;;;EAUA;;;;;;;;EAQA"}
|
package/dist/types.d.mts
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Attributes, Span } from "@opentelemetry/api";
|
|
3
|
+
import { InstrumentationConfig } from "@opentelemetry/instrumentation";
|
|
4
|
+
import { ClientRequest, IncomingMessage, RequestOptions, ServerResponse } from "http";
|
|
5
|
+
//#region src/types.d.ts
|
|
6
|
+
interface HttpCustomAttributeFunction {
|
|
7
|
+
(span: Span, request: ClientRequest | IncomingMessage, response: IncomingMessage | ServerResponse): void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Called with each incoming request. Return `true` to skip creating a server
|
|
11
|
+
* span for that request.
|
|
12
|
+
*/
|
|
13
|
+
interface IgnoreIncomingRequestFunction {
|
|
14
|
+
(request: IncomingMessage): boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Called with each outgoing request's parsed options. Return `true` to skip
|
|
18
|
+
* creating a client span for that request.
|
|
19
|
+
*/
|
|
20
|
+
interface IgnoreOutgoingRequestFunction {
|
|
21
|
+
(request: RequestOptions): boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Called with the active span and request before the request is handled.
|
|
25
|
+
*/
|
|
26
|
+
interface HttpRequestCustomAttributeFunction {
|
|
27
|
+
(span: Span, request: ClientRequest | IncomingMessage): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Called with the active span and response before the response is handled.
|
|
31
|
+
*/
|
|
32
|
+
interface HttpResponseCustomAttributeFunction {
|
|
33
|
+
(span: Span, response: IncomingMessage | ServerResponse): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Called before an incoming request span is started. Returned attributes are
|
|
37
|
+
* added to the new server span.
|
|
38
|
+
*/
|
|
39
|
+
interface StartIncomingSpanCustomAttributeFunction {
|
|
40
|
+
(request: IncomingMessage): Attributes;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Called with an outgoing request's parsed options before the span is started.
|
|
44
|
+
* Returned attributes are added to the new client span.
|
|
45
|
+
*/
|
|
46
|
+
interface StartOutgoingSpanCustomAttributeFunction {
|
|
47
|
+
(request: RequestOptions): Attributes;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Options available for the HTTP instrumentation (see [documentation](https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http#http-instrumentation-options))
|
|
51
|
+
*/
|
|
52
|
+
interface HttpInstrumentationConfig extends InstrumentationConfig {
|
|
53
|
+
/** Do not trace incoming requests for which this function returns `true`. */
|
|
54
|
+
ignoreIncomingRequestHook?: IgnoreIncomingRequestFunction;
|
|
55
|
+
/** Do not trace outgoing requests for which this function returns `true`. */
|
|
56
|
+
ignoreOutgoingRequestHook?: IgnoreOutgoingRequestFunction;
|
|
57
|
+
/** If set to true, incoming requests will not be instrumented at all. */
|
|
58
|
+
disableIncomingRequestInstrumentation?: boolean;
|
|
59
|
+
/** If set to true, outgoing requests will not be instrumented at all. */
|
|
60
|
+
disableOutgoingRequestInstrumentation?: boolean;
|
|
61
|
+
/** Function for adding custom attributes after response is handled */
|
|
62
|
+
applyCustomAttributesOnSpan?: HttpCustomAttributeFunction;
|
|
63
|
+
/** Function for adding custom attributes before request is handled */
|
|
64
|
+
requestHook?: HttpRequestCustomAttributeFunction;
|
|
65
|
+
/** Function for adding custom attributes before response is handled */
|
|
66
|
+
responseHook?: HttpResponseCustomAttributeFunction;
|
|
67
|
+
/** Function for adding custom attributes before a span is started in incomingRequest */
|
|
68
|
+
startIncomingSpanHook?: StartIncomingSpanCustomAttributeFunction;
|
|
69
|
+
/** Function for adding custom attributes before a span is started in outgoingRequest */
|
|
70
|
+
startOutgoingSpanHook?: StartOutgoingSpanCustomAttributeFunction;
|
|
71
|
+
/** Require parent to create span for outgoing requests */
|
|
72
|
+
requireParentforOutgoingSpans?: boolean;
|
|
73
|
+
/** Require parent to create span for incoming requests */
|
|
74
|
+
requireParentforIncomingSpans?: boolean;
|
|
75
|
+
/** Map the following HTTP headers to span attributes. */
|
|
76
|
+
headersToSpanAttributes?: {
|
|
77
|
+
client?: {
|
|
78
|
+
requestHeaders?: string[];
|
|
79
|
+
responseHeaders?: string[];
|
|
80
|
+
};
|
|
81
|
+
server?: {
|
|
82
|
+
requestHeaders?: string[];
|
|
83
|
+
responseHeaders?: string[];
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Enable automatic population of synthetic source type based on the user-agent header
|
|
88
|
+
* @experimental
|
|
89
|
+
**/
|
|
90
|
+
enableSyntheticSourceDetection?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* [Optional] Query parameters to redact on outgoing (client) spans.
|
|
93
|
+
* Use this to specify custom query strings that contain sensitive information.
|
|
94
|
+
* These will replace/overwrite the default query strings that are to be redacted.
|
|
95
|
+
* When omitted, defaults to a built-in list of known sensitive parameter
|
|
96
|
+
* names; see the package README for the current list.
|
|
97
|
+
* Set to an empty array to disable client-side query parameter redaction entirely.
|
|
98
|
+
* @experimental
|
|
99
|
+
*/
|
|
100
|
+
redactedQueryParams?: string[];
|
|
101
|
+
/**
|
|
102
|
+
* [Optional] Query parameters to redact on incoming (server) spans.
|
|
103
|
+
* When omitted, defaults to a built-in list of known sensitive parameter
|
|
104
|
+
* names; see the package README for the current list.
|
|
105
|
+
* Set to an empty array to disable server-side query parameter redaction entirely.
|
|
106
|
+
* @experimental
|
|
107
|
+
*/
|
|
108
|
+
redactedQueryParamsServer?: string[];
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { HttpCustomAttributeFunction, HttpInstrumentationConfig, HttpRequestCustomAttributeFunction, HttpResponseCustomAttributeFunction, IgnoreIncomingRequestFunction, IgnoreOutgoingRequestFunction, StartIncomingSpanCustomAttributeFunction, StartOutgoingSpanCustomAttributeFunction };
|
|
112
|
+
//# sourceMappingURL=types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.mts","names":[],"sources":["../src/types.d.ts"],"mappings":";;;;;UAIiB;GACZ,MAAM,MAAM,SAAS,gBAAgB,iBAAiB,UAAU,kBAAkB;;;;;;UAMtE;GACZ,SAAS;;;;;;UAMG;GACZ,SAAS;;;;;UAKG;GACZ,MAAM,MAAM,SAAS,gBAAgB;;;;;UAKzB;GACZ,MAAM,MAAM,UAAU,kBAAkB;;;;;;UAM5B;GACZ,SAAS,kBAAkB;;;;;;UAMf;GACZ,SAAS,iBAAiB;;;;;UAKd,kCAAkC;;EAE/C,4BAA4B;;EAE5B,4BAA4B;;EAE5B;;EAEA;;EAEA,8BAA8B;;EAE9B,cAAc;;EAEd,eAAe;;EAEf,wBAAwB;;EAExB,wBAAwB;;EAExB;;EAEA;;EAEA;IACI;MACI;MACA;;IAEJ;MACI;MACA;;;;;;;EAOR;;;;;;;;;;EAUA;;;;;;;;EAQA"}
|