@opentelemetry/instrumentation-http 0.220.0 → 0.222.0-development.0

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.
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.HTTP_FLAVOR_VALUE_HTTP_1_1 = exports.NET_TRANSPORT_VALUE_IP_UDP = exports.NET_TRANSPORT_VALUE_IP_TCP = exports.ATTR_NET_TRANSPORT = exports.ATTR_NET_PEER_PORT = exports.ATTR_NET_PEER_NAME = exports.ATTR_NET_PEER_IP = exports.ATTR_NET_HOST_PORT = exports.ATTR_NET_HOST_NAME = exports.ATTR_NET_HOST_IP = exports.ATTR_HTTP_USER_AGENT = exports.ATTR_HTTP_URL = exports.ATTR_HTTP_TARGET = exports.ATTR_HTTP_STATUS_CODE = exports.ATTR_HTTP_SERVER_NAME = exports.ATTR_HTTP_SCHEME = exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH = exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH = exports.ATTR_HTTP_METHOD = exports.ATTR_HTTP_HOST = exports.ATTR_HTTP_FLAVOR = exports.ATTR_HTTP_CLIENT_IP = exports.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST = exports.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT = exports.ATTR_USER_AGENT_SYNTHETIC_TYPE = void 0;
7
+ exports.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST = exports.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT = exports.ATTR_USER_AGENT_SYNTHETIC_TYPE = void 0;
8
8
  /*
9
9
  * This file contains a copy of unstable semantic convention definitions
10
10
  * used by this package.
@@ -26,226 +26,4 @@ exports.USER_AGENT_SYNTHETIC_TYPE_VALUE_BOT = 'bot';
26
26
  * Enum value "test" for attribute {@link ATTR_USER_AGENT_SYNTHETIC_TYPE}.
27
27
  */
28
28
  exports.USER_AGENT_SYNTHETIC_TYPE_VALUE_TEST = 'test';
29
- /**
30
- * Deprecated, use `client.address` instead.
31
- *
32
- * @example "83.164.160.102"
33
- *
34
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
35
- *
36
- * @deprecated Replaced by `client.address`.
37
- */
38
- exports.ATTR_HTTP_CLIENT_IP = 'http.client_ip';
39
- /**
40
- * Deprecated, use `network.protocol.name` instead.
41
- *
42
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
43
- *
44
- * @deprecated Replaced by `network.protocol.name`.
45
- */
46
- exports.ATTR_HTTP_FLAVOR = 'http.flavor';
47
- /**
48
- * Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage.
49
- *
50
- * @example www.example.org
51
- *
52
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
53
- *
54
- * @deprecated Replaced by one of `server.address`, `client.address` or `http.request.header.host`, depending on the usage.
55
- */
56
- exports.ATTR_HTTP_HOST = 'http.host';
57
- /**
58
- * Deprecated, use `http.request.method` instead.
59
- *
60
- * @example GET
61
- * @example POST
62
- * @example HEAD
63
- *
64
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
65
- *
66
- * @deprecated Replaced by `http.request.method`.
67
- */
68
- exports.ATTR_HTTP_METHOD = 'http.method';
69
- /**
70
- * Deprecated, use `http.request.header.<key>` instead.
71
- *
72
- * @example 3495
73
- *
74
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
75
- *
76
- * @deprecated Replaced by `http.request.header.<key>`.
77
- */
78
- exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH = 'http.request_content_length';
79
- /**
80
- * Deprecated, use `http.request.body.size` instead.
81
- *
82
- * @example 5493
83
- *
84
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
85
- *
86
- * @deprecated Replaced by `http.request.body.size`.
87
- */
88
- exports.ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED = 'http.request_content_length_uncompressed';
89
- /**
90
- * Deprecated, use `http.response.header.<key>` instead.
91
- *
92
- * @example 3495
93
- *
94
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
95
- *
96
- * @deprecated Replaced by `http.response.header.<key>`.
97
- */
98
- exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length';
99
- /**
100
- * Deprecated, use `http.response.body.size` instead.
101
- *
102
- * @example 5493
103
- *
104
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
105
- *
106
- * @deprecated Replace by `http.response.body.size`.
107
- */
108
- exports.ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed';
109
- /**
110
- * Deprecated, use `url.scheme` instead.
111
- *
112
- * @example http
113
- * @example https
114
- *
115
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
116
- *
117
- * @deprecated Replaced by `url.scheme` instead.
118
- */
119
- exports.ATTR_HTTP_SCHEME = 'http.scheme';
120
- /**
121
- * Deprecated, use `server.address` instead.
122
- *
123
- * @example example.com
124
- *
125
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
126
- *
127
- * @deprecated Replaced by `server.address`.
128
- */
129
- exports.ATTR_HTTP_SERVER_NAME = 'http.server_name';
130
- /**
131
- * Deprecated, use `http.response.status_code` instead.
132
- *
133
- * @example 200
134
- *
135
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
136
- *
137
- * @deprecated Replaced by `http.response.status_code`.
138
- */
139
- exports.ATTR_HTTP_STATUS_CODE = 'http.status_code';
140
- /**
141
- * Deprecated, use `url.path` and `url.query` instead.
142
- *
143
- * @example /search?q=OpenTelemetry#SemConv
144
- *
145
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
146
- *
147
- * @deprecated Split to `url.path` and `url.query.
148
- */
149
- exports.ATTR_HTTP_TARGET = 'http.target';
150
- /**
151
- * Deprecated, use `url.full` instead.
152
- *
153
- * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv
154
- *
155
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
156
- *
157
- * @deprecated Replaced by `url.full`.
158
- */
159
- exports.ATTR_HTTP_URL = 'http.url';
160
- /**
161
- * Deprecated, use `user_agent.original` instead.
162
- *
163
- * @example CERN-LineMode/2.15 libwww/2.17b3
164
- * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1
165
- *
166
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
167
- *
168
- * @deprecated Replaced by `user_agent.original`.
169
- */
170
- exports.ATTR_HTTP_USER_AGENT = 'http.user_agent';
171
- /**
172
- * Deprecated, use `network.local.address`.
173
- *
174
- * @example "192.168.0.1"
175
- *
176
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
177
- *
178
- * @deprecated Replaced by `network.local.address`.
179
- */
180
- exports.ATTR_NET_HOST_IP = 'net.host.ip';
181
- /**
182
- * Deprecated, use `server.address`.
183
- *
184
- * @example example.com
185
- *
186
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
187
- *
188
- * @deprecated Replaced by `server.address`.
189
- */
190
- exports.ATTR_NET_HOST_NAME = 'net.host.name';
191
- /**
192
- * Deprecated, use `server.port`.
193
- *
194
- * @example 8080
195
- *
196
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
197
- *
198
- * @deprecated Replaced by `server.port`.
199
- */
200
- exports.ATTR_NET_HOST_PORT = 'net.host.port';
201
- /**
202
- * Deprecated, use `network.peer.address`.
203
- *
204
- * @example "127.0.0.1"
205
- *
206
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
207
- *
208
- * @deprecated Replaced by `network.peer.address`.
209
- */
210
- exports.ATTR_NET_PEER_IP = 'net.peer.ip';
211
- /**
212
- * Deprecated, use `server.address` on client spans and `client.address` on server spans.
213
- *
214
- * @example example.com
215
- *
216
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
217
- *
218
- * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.
219
- */
220
- exports.ATTR_NET_PEER_NAME = 'net.peer.name';
221
- /**
222
- * Deprecated, use `server.port` on client spans and `client.port` on server spans.
223
- *
224
- * @example 8080
225
- *
226
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
227
- *
228
- * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.
229
- */
230
- exports.ATTR_NET_PEER_PORT = 'net.peer.port';
231
- /**
232
- * Deprecated, use `network.transport`.
233
- *
234
- * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
235
- *
236
- * @deprecated Replaced by `network.transport`.
237
- */
238
- exports.ATTR_NET_TRANSPORT = 'net.transport';
239
- /**
240
- * Enum value "ip_tcp" for attribute {@link ATTR_NET_TRANSPORT}.
241
- */
242
- exports.NET_TRANSPORT_VALUE_IP_TCP = 'ip_tcp';
243
- /**
244
- * Enum value "ip_udp" for attribute {@link ATTR_NET_TRANSPORT}.
245
- */
246
- exports.NET_TRANSPORT_VALUE_IP_UDP = 'ip_udp';
247
- /**
248
- * Enum value "1.1" for attribute {@link ATTR_HTTP_FLAVOR}.
249
- */
250
- exports.HTTP_FLAVOR_VALUE_HTTP_1_1 = '1.1';
251
29
  //# sourceMappingURL=semconv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AACU,QAAA,8BAA8B,GACzC,2BAAoC,CAAC;AAEvC;;GAEG;AACU,QAAA,mCAAmC,GAAG,KAAc,CAAC;AAElE;;GAEG;AACU,QAAA,oCAAoC,GAAG,MAAe,CAAC;AAEpE;;;;;;;;GAQG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;GAMG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;GAQG;AACU,QAAA,cAAc,GAAG,WAAoB,CAAC;AAEnD;;;;;;;;;;GAUG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;GAQG;AACU,QAAA,gCAAgC,GAC3C,6BAAsC,CAAC;AAEzC;;;;;;;;GAQG;AACU,QAAA,6CAA6C,GACxD,0CAAmD,CAAC;AAEtD;;;;;;;;GAQG;AACU,QAAA,iCAAiC,GAC5C,8BAAuC,CAAC;AAE1C;;;;;;;;GAQG;AACU,QAAA,8CAA8C,GACzD,2CAAoD,CAAC;AAEvD;;;;;;;;;GASG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACU,QAAA,qBAAqB,GAAG,kBAA2B,CAAC;AAEjE;;;;;;;;GAQG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;GAQG;AACU,QAAA,aAAa,GAAG,UAAmB,CAAC;AAEjD;;;;;;;;;GASG;AACU,QAAA,oBAAoB,GAAG,iBAA0B,CAAC;AAE/D;;;;;;;;GAQG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;;;;;GAMG;AACU,QAAA,kBAAkB,GAAG,eAAwB,CAAC;AAE3D;;GAEG;AACU,QAAA,0BAA0B,GAAG,QAAiB,CAAC;AAE5D;;GAEG;AACU,QAAA,0BAA0B,GAAG,QAAiB,CAAC;AAE5D;;GAEG;AACU,QAAA,0BAA0B,GAAG,KAAc,CAAC","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\n/**\n * Deprecated, use `client.address` instead.\n *\n * @example \"83.164.160.102\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `client.address`.\n */\nexport const ATTR_HTTP_CLIENT_IP = 'http.client_ip' as const;\n\n/**\n * Deprecated, use `network.protocol.name` instead.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `network.protocol.name`.\n */\nexport const ATTR_HTTP_FLAVOR = 'http.flavor' as const;\n\n/**\n * Deprecated, use one of `server.address`, `client.address` or `http.request.header.host` instead, depending on the usage.\n *\n * @example www.example.org\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by one of `server.address`, `client.address` or `http.request.header.host`, depending on the usage.\n */\nexport const ATTR_HTTP_HOST = 'http.host' as const;\n\n/**\n * Deprecated, use `http.request.method` instead.\n *\n * @example GET\n * @example POST\n * @example HEAD\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.request.method`.\n */\nexport const ATTR_HTTP_METHOD = 'http.method' as const;\n\n/**\n * Deprecated, use `http.request.header.<key>` instead.\n *\n * @example 3495\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.request.header.<key>`.\n */\nexport const ATTR_HTTP_REQUEST_CONTENT_LENGTH =\n 'http.request_content_length' as const;\n\n/**\n * Deprecated, use `http.request.body.size` instead.\n *\n * @example 5493\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.request.body.size`.\n */\nexport const ATTR_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED =\n 'http.request_content_length_uncompressed' as const;\n\n/**\n * Deprecated, use `http.response.header.<key>` instead.\n *\n * @example 3495\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.response.header.<key>`.\n */\nexport const ATTR_HTTP_RESPONSE_CONTENT_LENGTH =\n 'http.response_content_length' as const;\n\n/**\n * Deprecated, use `http.response.body.size` instead.\n *\n * @example 5493\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replace by `http.response.body.size`.\n */\nexport const ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED =\n 'http.response_content_length_uncompressed' as const;\n\n/**\n * Deprecated, use `url.scheme` instead.\n *\n * @example http\n * @example https\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `url.scheme` instead.\n */\nexport const ATTR_HTTP_SCHEME = 'http.scheme' as const;\n\n/**\n * Deprecated, use `server.address` instead.\n *\n * @example example.com\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address`.\n */\nexport const ATTR_HTTP_SERVER_NAME = 'http.server_name' as const;\n\n/**\n * Deprecated, use `http.response.status_code` instead.\n *\n * @example 200\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `http.response.status_code`.\n */\nexport const ATTR_HTTP_STATUS_CODE = 'http.status_code' as const;\n\n/**\n * Deprecated, use `url.path` and `url.query` instead.\n *\n * @example /search?q=OpenTelemetry#SemConv\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Split to `url.path` and `url.query.\n */\nexport const ATTR_HTTP_TARGET = 'http.target' as const;\n\n/**\n * Deprecated, use `url.full` instead.\n *\n * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `url.full`.\n */\nexport const ATTR_HTTP_URL = 'http.url' as const;\n\n/**\n * Deprecated, use `user_agent.original` instead.\n *\n * @example CERN-LineMode/2.15 libwww/2.17b3\n * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `user_agent.original`.\n */\nexport const ATTR_HTTP_USER_AGENT = 'http.user_agent' as const;\n\n/**\n * Deprecated, use `network.local.address`.\n *\n * @example \"192.168.0.1\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `network.local.address`.\n */\nexport const ATTR_NET_HOST_IP = 'net.host.ip' as const;\n\n/**\n * Deprecated, use `server.address`.\n *\n * @example example.com\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address`.\n */\nexport const ATTR_NET_HOST_NAME = 'net.host.name' as const;\n\n/**\n * Deprecated, use `server.port`.\n *\n * @example 8080\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.port`.\n */\nexport const ATTR_NET_HOST_PORT = 'net.host.port' as const;\n\n/**\n * Deprecated, use `network.peer.address`.\n *\n * @example \"127.0.0.1\"\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `network.peer.address`.\n */\nexport const ATTR_NET_PEER_IP = 'net.peer.ip' as const;\n\n/**\n * Deprecated, use `server.address` on client spans and `client.address` on server spans.\n *\n * @example example.com\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.address` on client spans and `client.address` on server spans.\n */\nexport const ATTR_NET_PEER_NAME = 'net.peer.name' as const;\n\n/**\n * Deprecated, use `server.port` on client spans and `client.port` on server spans.\n *\n * @example 8080\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `server.port` on client spans and `client.port` on server spans.\n */\nexport const ATTR_NET_PEER_PORT = 'net.peer.port' as const;\n\n/**\n * Deprecated, use `network.transport`.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n *\n * @deprecated Replaced by `network.transport`.\n */\nexport const ATTR_NET_TRANSPORT = 'net.transport' as const;\n\n/**\n * Enum value \"ip_tcp\" for attribute {@link ATTR_NET_TRANSPORT}.\n */\nexport const NET_TRANSPORT_VALUE_IP_TCP = 'ip_tcp' as const;\n\n/**\n * Enum value \"ip_udp\" for attribute {@link ATTR_NET_TRANSPORT}.\n */\nexport const NET_TRANSPORT_VALUE_IP_UDP = 'ip_udp' as const;\n\n/**\n * Enum value \"1.1\" for attribute {@link ATTR_HTTP_FLAVOR}.\n */\nexport const HTTP_FLAVOR_VALUE_HTTP_1_1 = '1.1' as const;\n"]}
1
+ {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH;;;;;;GAMG;AACU,QAAA,8BAA8B,GACzC,2BAAoC,CAAC;AAEvC;;GAEG;AACU,QAAA,mCAAmC,GAAG,KAAc,CAAC;AAElE;;GAEG;AACU,QAAA,oCAAoC,GAAG,MAAe,CAAC","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"]}
@@ -67,7 +67,11 @@ export interface HttpInstrumentationConfig extends InstrumentationConfig {
67
67
  startIncomingSpanHook?: StartIncomingSpanCustomAttributeFunction;
68
68
  /** Function for adding custom attributes before a span is started in outgoingRequest */
69
69
  startOutgoingSpanHook?: StartOutgoingSpanCustomAttributeFunction;
70
- /** The primary server name of the matched virtual host. */
70
+ /**
71
+ * The primary server name of the matched virtual host.
72
+ * @deprecated No longer used. Stable HTTP semantic conventions do not include
73
+ * the `http.server_name` attribute; this option has no effect.
74
+ */
71
75
  serverName?: string;
72
76
  /** Require parent to create span for outgoing requests */
73
77
  requireParentforOutgoingSpans?: boolean;
@@ -90,12 +94,22 @@ export interface HttpInstrumentationConfig extends InstrumentationConfig {
90
94
  **/
91
95
  enableSyntheticSourceDetection?: boolean;
92
96
  /**
93
- * [Optional] Additional query parameters to redact.
97
+ * [Optional] Query parameters to redact on outgoing (client) spans.
94
98
  * Use this to specify custom query strings that contain sensitive information.
95
99
  * These will replace/overwrite the default query strings that are to be redacted.
96
- * @example default strings ['sig','Signature','AWSAccessKeyId','X-Goog-Signature']
100
+ * When omitted, defaults to a built-in list of known sensitive parameter
101
+ * names; see the package README for the current list.
102
+ * Set to an empty array to disable client-side query parameter redaction entirely.
97
103
  * @experimental
98
104
  */
99
105
  redactedQueryParams?: string[];
106
+ /**
107
+ * [Optional] Query parameters to redact on incoming (server) spans.
108
+ * When omitted, defaults to a built-in list of known sensitive parameter
109
+ * names; see the package README for the current list.
110
+ * Set to an empty array to disable server-side query parameter redaction entirely.
111
+ * @experimental
112
+ */
113
+ redactedQueryParamsServer?: string[];
100
114
  }
101
115
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { Span, Attributes } from '@opentelemetry/api';\nimport type {\n ClientRequest,\n IncomingMessage,\n ServerResponse,\n RequestOptions,\n} from 'http';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\n\nexport interface HttpCustomAttributeFunction {\n (\n span: Span,\n request: ClientRequest | IncomingMessage,\n response: IncomingMessage | ServerResponse\n ): void;\n}\n\n/**\n * Called with each incoming request. Return `true` to skip creating a server\n * span for that request.\n */\nexport interface IgnoreIncomingRequestFunction {\n (request: IncomingMessage): boolean;\n}\n\n/**\n * Called with each outgoing request's parsed options. Return `true` to skip\n * creating a client span for that request.\n */\nexport interface IgnoreOutgoingRequestFunction {\n (request: RequestOptions): boolean;\n}\n\n/**\n * Called with the active span and request before the request is handled.\n */\nexport interface HttpRequestCustomAttributeFunction {\n (span: Span, request: ClientRequest | IncomingMessage): void;\n}\n\n/**\n * Called with the active span and response before the response is handled.\n */\nexport interface HttpResponseCustomAttributeFunction {\n (span: Span, response: IncomingMessage | ServerResponse): void;\n}\n\n/**\n * Called before an incoming request span is started. Returned attributes are\n * added to the new server span.\n */\nexport interface StartIncomingSpanCustomAttributeFunction {\n (request: IncomingMessage): Attributes;\n}\n\n/**\n * Called with an outgoing request's parsed options before the span is started.\n * Returned attributes are added to the new client span.\n */\nexport interface StartOutgoingSpanCustomAttributeFunction {\n (request: RequestOptions): Attributes;\n}\n\n/**\n * 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))\n */\nexport interface HttpInstrumentationConfig extends InstrumentationConfig {\n /** Do not trace incoming requests for which this function returns `true`. */\n ignoreIncomingRequestHook?: IgnoreIncomingRequestFunction;\n /** Do not trace outgoing requests for which this function returns `true`. */\n ignoreOutgoingRequestHook?: IgnoreOutgoingRequestFunction;\n /** If set to true, incoming requests will not be instrumented at all. */\n disableIncomingRequestInstrumentation?: boolean;\n /** If set to true, outgoing requests will not be instrumented at all. */\n disableOutgoingRequestInstrumentation?: boolean;\n /** Function for adding custom attributes after response is handled */\n applyCustomAttributesOnSpan?: HttpCustomAttributeFunction;\n /** Function for adding custom attributes before request is handled */\n requestHook?: HttpRequestCustomAttributeFunction;\n /** Function for adding custom attributes before response is handled */\n responseHook?: HttpResponseCustomAttributeFunction;\n /** Function for adding custom attributes before a span is started in incomingRequest */\n startIncomingSpanHook?: StartIncomingSpanCustomAttributeFunction;\n /** Function for adding custom attributes before a span is started in outgoingRequest */\n startOutgoingSpanHook?: StartOutgoingSpanCustomAttributeFunction;\n /** The primary server name of the matched virtual host. */\n serverName?: string;\n /** Require parent to create span for outgoing requests */\n requireParentforOutgoingSpans?: boolean;\n /** Require parent to create span for incoming requests */\n requireParentforIncomingSpans?: boolean;\n /** Map the following HTTP headers to span attributes. */\n headersToSpanAttributes?: {\n client?: { requestHeaders?: string[]; responseHeaders?: string[] };\n server?: { requestHeaders?: string[]; responseHeaders?: string[] };\n };\n /**\n * Enable automatic population of synthetic source type based on the user-agent header\n * @experimental\n **/\n enableSyntheticSourceDetection?: boolean;\n /**\n * [Optional] Additional query parameters to redact.\n * Use this to specify custom query strings that contain sensitive information.\n * These will replace/overwrite the default query strings that are to be redacted.\n * @example default strings ['sig','Signature','AWSAccessKeyId','X-Goog-Signature']\n * @experimental\n */\n redactedQueryParams?: string[];\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { Span, Attributes } from '@opentelemetry/api';\nimport type {\n ClientRequest,\n IncomingMessage,\n ServerResponse,\n RequestOptions,\n} from 'http';\nimport type { InstrumentationConfig } from '@opentelemetry/instrumentation';\n\nexport interface HttpCustomAttributeFunction {\n (\n span: Span,\n request: ClientRequest | IncomingMessage,\n response: IncomingMessage | ServerResponse\n ): void;\n}\n\n/**\n * Called with each incoming request. Return `true` to skip creating a server\n * span for that request.\n */\nexport interface IgnoreIncomingRequestFunction {\n (request: IncomingMessage): boolean;\n}\n\n/**\n * Called with each outgoing request's parsed options. Return `true` to skip\n * creating a client span for that request.\n */\nexport interface IgnoreOutgoingRequestFunction {\n (request: RequestOptions): boolean;\n}\n\n/**\n * Called with the active span and request before the request is handled.\n */\nexport interface HttpRequestCustomAttributeFunction {\n (span: Span, request: ClientRequest | IncomingMessage): void;\n}\n\n/**\n * Called with the active span and response before the response is handled.\n */\nexport interface HttpResponseCustomAttributeFunction {\n (span: Span, response: IncomingMessage | ServerResponse): void;\n}\n\n/**\n * Called before an incoming request span is started. Returned attributes are\n * added to the new server span.\n */\nexport interface StartIncomingSpanCustomAttributeFunction {\n (request: IncomingMessage): Attributes;\n}\n\n/**\n * Called with an outgoing request's parsed options before the span is started.\n * Returned attributes are added to the new client span.\n */\nexport interface StartOutgoingSpanCustomAttributeFunction {\n (request: RequestOptions): Attributes;\n}\n\n/**\n * 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))\n */\nexport interface HttpInstrumentationConfig extends InstrumentationConfig {\n /** Do not trace incoming requests for which this function returns `true`. */\n ignoreIncomingRequestHook?: IgnoreIncomingRequestFunction;\n /** Do not trace outgoing requests for which this function returns `true`. */\n ignoreOutgoingRequestHook?: IgnoreOutgoingRequestFunction;\n /** If set to true, incoming requests will not be instrumented at all. */\n disableIncomingRequestInstrumentation?: boolean;\n /** If set to true, outgoing requests will not be instrumented at all. */\n disableOutgoingRequestInstrumentation?: boolean;\n /** Function for adding custom attributes after response is handled */\n applyCustomAttributesOnSpan?: HttpCustomAttributeFunction;\n /** Function for adding custom attributes before request is handled */\n requestHook?: HttpRequestCustomAttributeFunction;\n /** Function for adding custom attributes before response is handled */\n responseHook?: HttpResponseCustomAttributeFunction;\n /** Function for adding custom attributes before a span is started in incomingRequest */\n startIncomingSpanHook?: StartIncomingSpanCustomAttributeFunction;\n /** Function for adding custom attributes before a span is started in outgoingRequest */\n startOutgoingSpanHook?: StartOutgoingSpanCustomAttributeFunction;\n /**\n * The primary server name of the matched virtual host.\n * @deprecated No longer used. Stable HTTP semantic conventions do not include\n * the `http.server_name` attribute; this option has no effect.\n */\n serverName?: string;\n /** Require parent to create span for outgoing requests */\n requireParentforOutgoingSpans?: boolean;\n /** Require parent to create span for incoming requests */\n requireParentforIncomingSpans?: boolean;\n /** Map the following HTTP headers to span attributes. */\n headersToSpanAttributes?: {\n client?: { requestHeaders?: string[]; responseHeaders?: string[] };\n server?: { requestHeaders?: string[]; responseHeaders?: string[] };\n };\n /**\n * Enable automatic population of synthetic source type based on the user-agent header\n * @experimental\n **/\n enableSyntheticSourceDetection?: boolean;\n /**\n * [Optional] Query parameters to redact on outgoing (client) spans.\n * Use this to specify custom query strings that contain sensitive information.\n * These will replace/overwrite the default query strings that are to be redacted.\n * When omitted, defaults to a built-in list of known sensitive parameter\n * names; see the package README for the current list.\n * Set to an empty array to disable client-side query parameter redaction entirely.\n * @experimental\n */\n redactedQueryParams?: string[];\n /**\n * [Optional] Query parameters to redact on incoming (server) spans.\n * When omitted, defaults to a built-in list of known sensitive parameter\n * names; see the package README for the current list.\n * Set to an empty array to disable server-side query parameter redaction entirely.\n * @experimental\n */\n redactedQueryParamsServer?: string[];\n}\n"]}
@@ -2,9 +2,13 @@
2
2
  import type { Attributes, Span, DiagLogger } from '@opentelemetry/api';
3
3
  import { SpanStatusCode, SpanKind } from '@opentelemetry/api';
4
4
  import type { IncomingHttpHeaders, IncomingMessage, OutgoingHttpHeaders, RequestOptions, ServerResponse } from 'http';
5
- import { SemconvStability } from '@opentelemetry/instrumentation';
6
5
  import * as url from 'url';
7
6
  import type { Err, IgnoreMatcher, ParsedRequestOptions } from './internal-types';
7
+ /**
8
+ * Redacts sensitive query parameters from a query string (without leading '?').
9
+ * Returns the input unchanged if it cannot be parsed.
10
+ */
11
+ export declare const redactQueryString: (searchParams: URLSearchParams, paramsToRedact: string[]) => string;
8
12
  /**
9
13
  * Get an absolute url
10
14
  */
@@ -23,23 +27,8 @@ export declare const satisfiesPattern: (constant: string, pattern: IgnoreMatcher
23
27
  * Sets the span with the error passed in params
24
28
  * @param {Span} span the span that need to be set
25
29
  * @param {Error} error error that will be set to span
26
- * @param {SemconvStability} semconvStability determines which semconv version to use
27
30
  */
28
- export declare const setSpanWithError: (span: Span, error: Err, semconvStability: SemconvStability) => void;
29
- /**
30
- * Adds attributes for request content-length and content-encoding HTTP headers
31
- * @param { IncomingMessage } Request object whose headers will be analyzed
32
- * @param { Attributes } Attributes object to be modified
33
- */
34
- export declare const setRequestContentLengthAttribute: (request: IncomingMessage, attributes: Attributes) => void;
35
- /**
36
- * Adds attributes for response content-length and content-encoding HTTP headers
37
- * @param { IncomingMessage } Response object whose headers will be analyzed
38
- * @param { Attributes } Attributes object to be modified
39
- *
40
- * @deprecated this is for an older version of semconv. It is retained for compatibility using OTEL_SEMCONV_STABILITY_OPT_IN
41
- */
42
- export declare const setResponseContentLengthAttribute: (response: IncomingMessage, attributes: Attributes) => void;
31
+ export declare const setSpanWithError: (span: Span, error: Err) => void;
43
32
  export declare const isCompressed: (headers: OutgoingHttpHeaders | IncomingHttpHeaders) => boolean;
44
33
  /**
45
34
  * Makes sure options is an url object
@@ -68,7 +57,6 @@ export declare const extractHostnameAndPort: (requestOptions: Pick<ParsedRequest
68
57
  * Returns outgoing request attributes scoped to the options passed to the request
69
58
  * @param {ParsedRequestOptions} requestOptions the same options used to make the request
70
59
  * @param {{ component: string, hostname: string, hookAttributes?: Attributes }} options used to pass data needed to create attributes
71
- * @param {SemconvStability} semconvStability determines which semconv version to use
72
60
  */
73
61
  export declare const getOutgoingRequestAttributes: (requestOptions: ParsedRequestOptions, options: {
74
62
  component: string;
@@ -76,28 +64,16 @@ export declare const getOutgoingRequestAttributes: (requestOptions: ParsedReques
76
64
  port: string | number;
77
65
  hookAttributes?: Attributes;
78
66
  redactedQueryParams?: string[];
79
- }, semconvStability: SemconvStability, enableSyntheticSourceDetection: boolean) => Attributes;
80
- /**
81
- * Returns outgoing request Metric attributes scoped to the request data
82
- * @param {Attributes} spanAttributes the span attributes
83
- */
84
- export declare const getOutgoingRequestMetricAttributes: (spanAttributes: Attributes) => Attributes;
85
- /**
86
- * Returns attributes related to the kind of HTTP protocol used
87
- * @param {string} [kind] Kind of HTTP protocol used: "1.0", "1.1", "2", "SPDY" or "QUIC".
88
- */
89
- export declare const setAttributesFromHttpKind: (kind: string | undefined, attributes: Attributes) => void;
67
+ }, enableSyntheticSourceDetection: boolean) => Attributes;
90
68
  /**
91
69
  * Returns outgoing request attributes scoped to the response data
92
70
  * @param {IncomingMessage} response the response object
93
- * @param {SemconvStability} semconvStability determines which semconv version to use
94
71
  */
95
- export declare const getOutgoingRequestAttributesOnResponse: (response: IncomingMessage, semconvStability: SemconvStability) => Attributes;
72
+ export declare const getOutgoingRequestAttributesOnResponse: (response: IncomingMessage) => Attributes;
96
73
  /**
97
74
  * Returns outgoing request Metric attributes scoped to the response data
98
75
  * @param {Attributes} spanAttributes the span attributes
99
76
  */
100
- export declare const getOutgoingRequestMetricAttributesOnResponse: (spanAttributes: Attributes) => Attributes;
101
77
  export declare const getOutgoingStableRequestMetricAttributesOnResponse: (spanAttributes: Attributes) => Attributes;
102
78
  /**
103
79
  * Get server.address and port according to http semconv 1.27
@@ -107,36 +83,23 @@ export declare function getRemoteClientAddress(request: IncomingMessage): string
107
83
  /**
108
84
  * Returns incoming request attributes scoped to the request data
109
85
  * @param {IncomingMessage} request the request object
110
- * @param {{ component: string, serverName?: string, hookAttributes?: Attributes }} options used to pass data needed to create attributes
111
- * @param {SemconvStability} semconvStability determines which semconv version to use
86
+ * @param {{ component: string, hookAttributes?: Attributes, enableSyntheticSourceDetection: boolean }} options used to pass data needed to create attributes
112
87
  */
113
88
  export declare const getIncomingRequestAttributes: (request: IncomingMessage, options: {
114
89
  component: 'http' | 'https';
115
- serverName?: string;
116
90
  hookAttributes?: Attributes;
117
- semconvStability: SemconvStability;
118
91
  enableSyntheticSourceDetection: boolean;
92
+ redactedQueryParams?: string[];
119
93
  }, logger: DiagLogger) => Attributes;
120
- /**
121
- * Returns incoming request Metric attributes scoped to the request data
122
- * @param {Attributes} spanAttributes the span attributes
123
- * @param {{ component: string }} options used to pass data needed to create attributes
124
- */
125
- export declare const getIncomingRequestMetricAttributes: (spanAttributes: Attributes) => Attributes;
126
94
  /**
127
95
  * Returns incoming request attributes scoped to the response data
128
96
  * @param {(ServerResponse & { socket: Socket; })} response the response object
129
97
  */
130
- export declare const getIncomingRequestAttributesOnResponse: (request: IncomingMessage, response: ServerResponse, semconvStability: SemconvStability) => Attributes;
131
- /**
132
- * Returns incoming request Metric attributes scoped to the request data
133
- * @param {Attributes} spanAttributes the span attributes
134
- */
135
- export declare const getIncomingRequestMetricAttributesOnResponse: (spanAttributes: Attributes) => Attributes;
98
+ export declare const getIncomingRequestAttributesOnResponse: (response: ServerResponse) => Attributes;
136
99
  /**
137
100
  * Returns incoming stable request Metric attributes scoped to the request data
138
101
  * @param {Attributes} spanAttributes the span attributes
139
102
  */
140
103
  export declare const getIncomingStableRequestMetricAttributesOnResponse: (spanAttributes: Attributes) => Attributes;
141
- export declare function headerCapture(type: 'request' | 'response', headers: string[], semconvStability: SemconvStability): (getHeader: (key: string) => undefined | string | string[] | number) => Attributes;
104
+ export declare function headerCapture(type: 'request' | 'response', headers: string[]): (getHeader: (key: string) => undefined | string | string[] | number) => Attributes;
142
105
  //# sourceMappingURL=utils.d.ts.map