@opentelemetry/api 1.5.0 → 1.7.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.
Files changed (229) hide show
  1. package/build/esm/index.d.ts +1 -1
  2. package/build/esm/index.js.map +1 -1
  3. package/build/esm/metrics/Metric.d.ts +16 -0
  4. package/build/esm/metrics/Metric.js.map +1 -1
  5. package/build/esm/trace/NonRecordingSpan.d.ts +1 -1
  6. package/build/esm/trace/NonRecordingSpan.js +1 -1
  7. package/build/esm/trace/NonRecordingSpan.js.map +1 -1
  8. package/build/esm/trace/span.d.ts +0 -8
  9. package/build/esm/trace/span.js.map +1 -1
  10. package/build/esm/version.d.ts +1 -1
  11. package/build/esm/version.js +1 -1
  12. package/build/esm/version.js.map +1 -1
  13. package/build/esnext/api/context.d.ts +41 -0
  14. package/build/esnext/api/context.js +77 -0
  15. package/build/esnext/api/context.js.map +1 -0
  16. package/build/esnext/api/diag.d.ts +30 -0
  17. package/build/esnext/api/diag.js +89 -0
  18. package/build/esnext/api/diag.js.map +1 -0
  19. package/build/esnext/api/metrics.d.ts +28 -0
  20. package/build/esnext/api/metrics.js +57 -0
  21. package/build/esnext/api/metrics.js.map +1 -0
  22. package/build/esnext/api/propagation.d.ts +49 -0
  23. package/build/esnext/api/propagation.js +85 -0
  24. package/build/esnext/api/propagation.js.map +1 -0
  25. package/build/esnext/api/trace.d.ts +40 -0
  26. package/build/esnext/api/trace.js +75 -0
  27. package/build/esnext/api/trace.js.map +1 -0
  28. package/build/esnext/baggage/context-helpers.d.ts +29 -0
  29. package/build/esnext/baggage/context-helpers.js +56 -0
  30. package/build/esnext/baggage/context-helpers.js.map +1 -0
  31. package/build/esnext/baggage/internal/baggage-impl.d.ts +12 -0
  32. package/build/esnext/baggage/internal/baggage-impl.js +51 -0
  33. package/build/esnext/baggage/internal/baggage-impl.js.map +1 -0
  34. package/build/esnext/baggage/internal/symbol.d.ts +5 -0
  35. package/build/esnext/baggage/internal/symbol.js +20 -0
  36. package/build/esnext/baggage/internal/symbol.js.map +1 -0
  37. package/build/esnext/baggage/types.d.ts +60 -0
  38. package/build/esnext/baggage/types.js +17 -0
  39. package/build/esnext/baggage/types.js.map +1 -0
  40. package/build/esnext/baggage/utils.d.ts +15 -0
  41. package/build/esnext/baggage/utils.js +46 -0
  42. package/build/esnext/baggage/utils.js.map +1 -0
  43. package/build/esnext/common/Attributes.d.ts +15 -0
  44. package/build/esnext/common/Attributes.js +17 -0
  45. package/build/esnext/common/Attributes.js.map +1 -0
  46. package/build/esnext/common/Exception.d.ts +26 -0
  47. package/build/esnext/common/Exception.js +17 -0
  48. package/build/esnext/common/Exception.js.map +1 -0
  49. package/build/esnext/common/Time.d.ts +20 -0
  50. package/build/esnext/common/Time.js +2 -0
  51. package/build/esnext/common/Time.js.map +1 -0
  52. package/build/esnext/context/NoopContextManager.d.ts +9 -0
  53. package/build/esnext/context/NoopContextManager.js +34 -0
  54. package/build/esnext/context/NoopContextManager.js.map +1 -0
  55. package/build/esnext/context/context.d.ts +6 -0
  56. package/build/esnext/context/context.js +51 -0
  57. package/build/esnext/context/context.js.map +1 -0
  58. package/build/esnext/context/types.d.ts +52 -0
  59. package/build/esnext/context/types.js +17 -0
  60. package/build/esnext/context/types.js.map +1 -0
  61. package/build/esnext/context-api.d.ts +4 -0
  62. package/build/esnext/context-api.js +21 -0
  63. package/build/esnext/context-api.js.map +1 -0
  64. package/build/esnext/diag/ComponentLogger.d.ts +20 -0
  65. package/build/esnext/diag/ComponentLogger.js +55 -0
  66. package/build/esnext/diag/ComponentLogger.js.map +1 -0
  67. package/build/esnext/diag/consoleLogger.d.ts +38 -0
  68. package/build/esnext/diag/consoleLogger.js +53 -0
  69. package/build/esnext/diag/consoleLogger.js.map +1 -0
  70. package/build/esnext/diag/internal/logLevelLogger.d.ts +3 -0
  71. package/build/esnext/diag/internal/logLevelLogger.js +41 -0
  72. package/build/esnext/diag/internal/logLevelLogger.js.map +1 -0
  73. package/build/esnext/diag/internal/noopLogger.d.ts +8 -0
  74. package/build/esnext/diag/internal/noopLogger.js +31 -0
  75. package/build/esnext/diag/internal/noopLogger.js.map +1 -0
  76. package/build/esnext/diag/types.d.ts +100 -0
  77. package/build/esnext/diag/types.js +41 -0
  78. package/build/esnext/diag/types.js.map +1 -0
  79. package/build/esnext/diag-api.d.ts +9 -0
  80. package/build/esnext/diag-api.js +26 -0
  81. package/build/esnext/diag-api.js.map +1 -0
  82. package/build/esnext/index.d.ts +54 -0
  83. package/build/esnext/index.js +53 -0
  84. package/build/esnext/index.js.map +1 -0
  85. package/build/esnext/internal/global-utils.d.ts +18 -0
  86. package/build/esnext/internal/global-utils.js +58 -0
  87. package/build/esnext/internal/global-utils.js.map +1 -0
  88. package/build/esnext/internal/semver.d.ts +34 -0
  89. package/build/esnext/internal/semver.js +118 -0
  90. package/build/esnext/internal/semver.js.map +1 -0
  91. package/build/esnext/metrics/Meter.d.ts +104 -0
  92. package/build/esnext/metrics/Meter.js +17 -0
  93. package/build/esnext/metrics/Meter.js.map +1 -0
  94. package/build/esnext/metrics/MeterProvider.d.ts +17 -0
  95. package/build/esnext/metrics/MeterProvider.js +17 -0
  96. package/build/esnext/metrics/MeterProvider.js.map +1 -0
  97. package/build/esnext/metrics/Metric.d.ts +109 -0
  98. package/build/esnext/metrics/Metric.js +22 -0
  99. package/build/esnext/metrics/Metric.js.map +1 -0
  100. package/build/esnext/metrics/NoopMeter.d.ts +74 -0
  101. package/build/esnext/metrics/NoopMeter.js +103 -0
  102. package/build/esnext/metrics/NoopMeter.js.map +1 -0
  103. package/build/esnext/metrics/NoopMeterProvider.d.ts +11 -0
  104. package/build/esnext/metrics/NoopMeterProvider.js +27 -0
  105. package/build/esnext/metrics/NoopMeterProvider.js.map +1 -0
  106. package/build/esnext/metrics/ObservableResult.d.ts +31 -0
  107. package/build/esnext/metrics/ObservableResult.js +17 -0
  108. package/build/esnext/metrics/ObservableResult.js.map +1 -0
  109. package/build/esnext/metrics-api.d.ts +4 -0
  110. package/build/esnext/metrics-api.js +21 -0
  111. package/build/esnext/metrics-api.js.map +1 -0
  112. package/build/esnext/platform/browser/globalThis.d.ts +10 -0
  113. package/build/esnext/platform/browser/globalThis.js +35 -0
  114. package/build/esnext/platform/browser/globalThis.js.map +1 -0
  115. package/build/esnext/platform/browser/index.d.ts +2 -0
  116. package/build/esnext/platform/browser/index.js +17 -0
  117. package/build/esnext/platform/browser/index.js.map +1 -0
  118. package/build/esnext/platform/index.d.ts +2 -0
  119. package/build/esnext/platform/index.js +17 -0
  120. package/build/esnext/platform/index.js.map +1 -0
  121. package/build/esnext/platform/node/globalThis.d.ts +3 -0
  122. package/build/esnext/platform/node/globalThis.js +19 -0
  123. package/build/esnext/platform/node/globalThis.js.map +1 -0
  124. package/build/esnext/platform/node/index.d.ts +2 -0
  125. package/build/esnext/platform/node/index.js +17 -0
  126. package/build/esnext/platform/node/index.js.map +1 -0
  127. package/build/esnext/propagation/NoopTextMapPropagator.d.ts +13 -0
  128. package/build/esnext/propagation/NoopTextMapPropagator.js +30 -0
  129. package/build/esnext/propagation/NoopTextMapPropagator.js.map +1 -0
  130. package/build/esnext/propagation/TextMapPropagator.d.ts +84 -0
  131. package/build/esnext/propagation/TextMapPropagator.js +38 -0
  132. package/build/esnext/propagation/TextMapPropagator.js.map +1 -0
  133. package/build/esnext/propagation-api.d.ts +4 -0
  134. package/build/esnext/propagation-api.js +21 -0
  135. package/build/esnext/propagation-api.js.map +1 -0
  136. package/build/esnext/trace/NonRecordingSpan.d.ts +25 -0
  137. package/build/esnext/trace/NonRecordingSpan.js +59 -0
  138. package/build/esnext/trace/NonRecordingSpan.js.map +1 -0
  139. package/build/esnext/trace/NoopTracer.d.ts +14 -0
  140. package/build/esnext/trace/NoopTracer.js +71 -0
  141. package/build/esnext/trace/NoopTracer.js.map +1 -0
  142. package/build/esnext/trace/NoopTracerProvider.d.ts +13 -0
  143. package/build/esnext/trace/NoopTracerProvider.js +28 -0
  144. package/build/esnext/trace/NoopTracerProvider.js.map +1 -0
  145. package/build/esnext/trace/ProxyTracer.d.ts +27 -0
  146. package/build/esnext/trace/ProxyTracer.js +51 -0
  147. package/build/esnext/trace/ProxyTracer.js.map +1 -0
  148. package/build/esnext/trace/ProxyTracerProvider.d.ts +25 -0
  149. package/build/esnext/trace/ProxyTracerProvider.js +50 -0
  150. package/build/esnext/trace/ProxyTracerProvider.js.map +1 -0
  151. package/build/esnext/trace/Sampler.d.ts +31 -0
  152. package/build/esnext/trace/Sampler.js +17 -0
  153. package/build/esnext/trace/Sampler.js.map +1 -0
  154. package/build/esnext/trace/SamplingResult.d.ts +49 -0
  155. package/build/esnext/trace/SamplingResult.js +39 -0
  156. package/build/esnext/trace/SamplingResult.js.map +1 -0
  157. package/build/esnext/trace/SpanOptions.d.ts +23 -0
  158. package/build/esnext/trace/SpanOptions.js +17 -0
  159. package/build/esnext/trace/SpanOptions.js.map +1 -0
  160. package/build/esnext/trace/attributes.d.ts +10 -0
  161. package/build/esnext/trace/attributes.js +17 -0
  162. package/build/esnext/trace/attributes.js.map +1 -0
  163. package/build/esnext/trace/context-utils.d.ts +41 -0
  164. package/build/esnext/trace/context-utils.js +73 -0
  165. package/build/esnext/trace/context-utils.js.map +1 -0
  166. package/build/esnext/trace/internal/tracestate-impl.d.ts +22 -0
  167. package/build/esnext/trace/internal/tracestate-impl.js +99 -0
  168. package/build/esnext/trace/internal/tracestate-impl.js.map +1 -0
  169. package/build/esnext/trace/internal/tracestate-validators.d.ts +15 -0
  170. package/build/esnext/trace/internal/tracestate-validators.js +41 -0
  171. package/build/esnext/trace/internal/tracestate-validators.js.map +1 -0
  172. package/build/esnext/trace/internal/utils.d.ts +3 -0
  173. package/build/esnext/trace/internal/utils.js +20 -0
  174. package/build/esnext/trace/internal/utils.js.map +1 -0
  175. package/build/esnext/trace/invalid-span-constants.d.ts +5 -0
  176. package/build/esnext/trace/invalid-span-constants.js +24 -0
  177. package/build/esnext/trace/invalid-span-constants.js.map +1 -0
  178. package/build/esnext/trace/link.d.ts +26 -0
  179. package/build/esnext/trace/link.js +17 -0
  180. package/build/esnext/trace/link.js.map +1 -0
  181. package/build/esnext/trace/span.d.ts +101 -0
  182. package/build/esnext/trace/span.js +17 -0
  183. package/build/esnext/trace/span.js.map +1 -0
  184. package/build/esnext/trace/span_context.d.ts +53 -0
  185. package/build/esnext/trace/span_context.js +17 -0
  186. package/build/esnext/trace/span_context.js.map +1 -0
  187. package/build/esnext/trace/span_kind.d.ts +27 -0
  188. package/build/esnext/trace/span_kind.js +43 -0
  189. package/build/esnext/trace/span_kind.js.map +1 -0
  190. package/build/esnext/trace/spancontext-utils.d.ts +17 -0
  191. package/build/esnext/trace/spancontext-utils.js +42 -0
  192. package/build/esnext/trace/spancontext-utils.js.map +1 -0
  193. package/build/esnext/trace/status.d.ts +25 -0
  194. package/build/esnext/trace/status.js +20 -0
  195. package/build/esnext/trace/status.js.map +1 -0
  196. package/build/esnext/trace/trace_flags.d.ts +7 -0
  197. package/build/esnext/trace/trace_flags.js +23 -0
  198. package/build/esnext/trace/trace_flags.js.map +1 -0
  199. package/build/esnext/trace/trace_state.d.ts +38 -0
  200. package/build/esnext/trace/trace_state.js +17 -0
  201. package/build/esnext/trace/trace_state.js.map +1 -0
  202. package/build/esnext/trace/tracer.d.ts +71 -0
  203. package/build/esnext/trace/tracer.js +17 -0
  204. package/build/esnext/trace/tracer.js.map +1 -0
  205. package/build/esnext/trace/tracer_options.d.ts +10 -0
  206. package/build/esnext/trace/tracer_options.js +17 -0
  207. package/build/esnext/trace/tracer_options.js.map +1 -0
  208. package/build/esnext/trace/tracer_provider.d.ts +21 -0
  209. package/build/esnext/trace/tracer_provider.js +17 -0
  210. package/build/esnext/trace/tracer_provider.js.map +1 -0
  211. package/build/esnext/trace-api.d.ts +4 -0
  212. package/build/esnext/trace-api.js +21 -0
  213. package/build/esnext/trace-api.js.map +1 -0
  214. package/build/esnext/version.d.ts +2 -0
  215. package/build/esnext/version.js +18 -0
  216. package/build/esnext/version.js.map +1 -0
  217. package/build/src/index.d.ts +1 -1
  218. package/build/src/index.js.map +1 -1
  219. package/build/src/metrics/Metric.d.ts +16 -0
  220. package/build/src/metrics/Metric.js.map +1 -1
  221. package/build/src/trace/NonRecordingSpan.d.ts +1 -1
  222. package/build/src/trace/NonRecordingSpan.js +1 -1
  223. package/build/src/trace/NonRecordingSpan.js.map +1 -1
  224. package/build/src/trace/span.d.ts +0 -8
  225. package/build/src/trace/span.js.map +1 -1
  226. package/build/src/version.d.ts +1 -1
  227. package/build/src/version.js +1 -1
  228. package/build/src/version.js.map +1 -1
  229. package/package.json +11 -6
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';
17
+ import { NonRecordingSpan } from './NonRecordingSpan';
18
+ const VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
19
+ const VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
20
+ export function isValidTraceId(traceId) {
21
+ return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
22
+ }
23
+ export function isValidSpanId(spanId) {
24
+ return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
25
+ }
26
+ /**
27
+ * Returns true if this {@link SpanContext} is valid.
28
+ * @return true if this {@link SpanContext} is valid.
29
+ */
30
+ export function isSpanContextValid(spanContext) {
31
+ return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));
32
+ }
33
+ /**
34
+ * Wrap the given {@link SpanContext} in a new non-recording {@link Span}
35
+ *
36
+ * @param spanContext span context to be wrapped
37
+ * @returns a new non-recording {@link Span} with the provided context
38
+ */
39
+ export function wrapSpanContext(spanContext) {
40
+ return new NonRecordingSpan(spanContext);
41
+ }
42
+ //# sourceMappingURL=spancontext-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spancontext-utils.js","sourceRoot":"","sources":["../../../src/trace/spancontext-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAE7C,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,OAAO,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,eAAe,CAAC;AAC1E,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,MAAM,KAAK,cAAc,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,WAAwB;IACzD,OAAO,CACL,cAAc,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,CACzE,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,WAAwB;IACtD,OAAO,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { Span } from './span';\nimport { SpanContext } from './span_context';\n\nconst VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;\nconst VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;\n\nexport function isValidTraceId(traceId: string): boolean {\n return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;\n}\n\nexport function isValidSpanId(spanId: string): boolean {\n return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;\n}\n\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n */\nexport function isSpanContextValid(spanContext: SpanContext): boolean {\n return (\n isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId)\n );\n}\n\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nexport function wrapSpanContext(spanContext: SpanContext): Span {\n return new NonRecordingSpan(spanContext);\n}\n"]}
@@ -0,0 +1,25 @@
1
+ export interface SpanStatus {
2
+ /** The status code of this message. */
3
+ code: SpanStatusCode;
4
+ /** A developer-facing error message. */
5
+ message?: string;
6
+ }
7
+ /**
8
+ * An enumeration of status codes.
9
+ */
10
+ export declare enum SpanStatusCode {
11
+ /**
12
+ * The default status.
13
+ */
14
+ UNSET = 0,
15
+ /**
16
+ * The operation has been validated by an Application developer or
17
+ * Operator to have completed successfully.
18
+ */
19
+ OK = 1,
20
+ /**
21
+ * The operation contains an error.
22
+ */
23
+ ERROR = 2
24
+ }
25
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * An enumeration of status codes.
3
+ */
4
+ export var SpanStatusCode;
5
+ (function (SpanStatusCode) {
6
+ /**
7
+ * The default status.
8
+ */
9
+ SpanStatusCode[SpanStatusCode["UNSET"] = 0] = "UNSET";
10
+ /**
11
+ * The operation has been validated by an Application developer or
12
+ * Operator to have completed successfully.
13
+ */
14
+ SpanStatusCode[SpanStatusCode["OK"] = 1] = "OK";
15
+ /**
16
+ * The operation contains an error.
17
+ */
18
+ SpanStatusCode[SpanStatusCode["ERROR"] = 2] = "ERROR";
19
+ })(SpanStatusCode || (SpanStatusCode = {}));
20
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/trace/status.ts"],"names":[],"mappings":"AAsBA;;GAEG;AACH,MAAM,CAAN,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB;;OAEG;IACH,qDAAS,CAAA;IACT;;;OAGG;IACH,+CAAM,CAAA;IACN;;OAEG;IACH,qDAAS,CAAA;AACX,CAAC,EAdW,cAAc,KAAd,cAAc,QAczB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport interface SpanStatus {\n /** The status code of this message. */\n code: SpanStatusCode;\n /** A developer-facing error message. */\n message?: string;\n}\n\n/**\n * An enumeration of status codes.\n */\nexport enum SpanStatusCode {\n /**\n * The default status.\n */\n UNSET = 0,\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n OK = 1,\n /**\n * The operation contains an error.\n */\n ERROR = 2,\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export declare enum TraceFlags {
2
+ /** Represents no flag set. */
3
+ NONE = 0,
4
+ /** Bit to represent whether trace is sampled in trace flags. */
5
+ SAMPLED = 1
6
+ }
7
+ //# sourceMappingURL=trace_flags.d.ts.map
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export var TraceFlags;
17
+ (function (TraceFlags) {
18
+ /** Represents no flag set. */
19
+ TraceFlags[TraceFlags["NONE"] = 0] = "NONE";
20
+ /** Bit to represent whether trace is sampled in trace flags. */
21
+ TraceFlags[TraceFlags["SAMPLED"] = 1] = "SAMPLED";
22
+ })(TraceFlags || (TraceFlags = {}));
23
+ //# sourceMappingURL=trace_flags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace_flags.js","sourceRoot":"","sources":["../../../src/trace/trace_flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,8BAA8B;IAC9B,2CAAU,CAAA;IACV,gEAAgE;IAChE,iDAAkB,CAAA;AACpB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nexport enum TraceFlags {\n /** Represents no flag set. */\n NONE = 0x0,\n /** Bit to represent whether trace is sampled in trace flags. */\n SAMPLED = 0x1 << 0,\n}\n"]}
@@ -0,0 +1,38 @@
1
+ export interface TraceState {
2
+ /**
3
+ * Create a new TraceState which inherits from this TraceState and has the
4
+ * given key set.
5
+ * The new entry will always be added in the front of the list of states.
6
+ *
7
+ * @param key key of the TraceState entry.
8
+ * @param value value of the TraceState entry.
9
+ */
10
+ set(key: string, value: string): TraceState;
11
+ /**
12
+ * Return a new TraceState which inherits from this TraceState but does not
13
+ * contain the given key.
14
+ *
15
+ * @param key the key for the TraceState entry to be removed.
16
+ */
17
+ unset(key: string): TraceState;
18
+ /**
19
+ * Returns the value to which the specified key is mapped, or `undefined` if
20
+ * this map contains no mapping for the key.
21
+ *
22
+ * @param key with which the specified value is to be associated.
23
+ * @returns the value to which the specified key is mapped, or `undefined` if
24
+ * this map contains no mapping for the key.
25
+ */
26
+ get(key: string): string | undefined;
27
+ /**
28
+ * Serializes the TraceState to a `list` as defined below. The `list` is a
29
+ * series of `list-members` separated by commas `,`, and a list-member is a
30
+ * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs
31
+ * surrounding `list-members` are ignored. There can be a maximum of 32
32
+ * `list-members` in a `list`.
33
+ *
34
+ * @returns the serialized string.
35
+ */
36
+ serialize(): string;
37
+ }
38
+ //# sourceMappingURL=trace_state.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=trace_state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace_state.js","sourceRoot":"","sources":["../../../src/trace/trace_state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface TraceState {\n /**\n * Create a new TraceState which inherits from this TraceState and has the\n * given key set.\n * The new entry will always be added in the front of the list of states.\n *\n * @param key key of the TraceState entry.\n * @param value value of the TraceState entry.\n */\n set(key: string, value: string): TraceState;\n\n /**\n * Return a new TraceState which inherits from this TraceState but does not\n * contain the given key.\n *\n * @param key the key for the TraceState entry to be removed.\n */\n unset(key: string): TraceState;\n\n /**\n * Returns the value to which the specified key is mapped, or `undefined` if\n * this map contains no mapping for the key.\n *\n * @param key with which the specified value is to be associated.\n * @returns the value to which the specified key is mapped, or `undefined` if\n * this map contains no mapping for the key.\n */\n get(key: string): string | undefined;\n\n // TODO: Consider to add support for merging an object as well by also\n // accepting a single internalTraceState argument similar to the constructor.\n\n /**\n * Serializes the TraceState to a `list` as defined below. The `list` is a\n * series of `list-members` separated by commas `,`, and a list-member is a\n * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs\n * surrounding `list-members` are ignored. There can be a maximum of 32\n * `list-members` in a `list`.\n *\n * @returns the serialized string.\n */\n serialize(): string;\n}\n"]}
@@ -0,0 +1,71 @@
1
+ import { Context } from '../context/types';
2
+ import { Span } from './span';
3
+ import { SpanOptions } from './SpanOptions';
4
+ /**
5
+ * Tracer provides an interface for creating {@link Span}s.
6
+ */
7
+ export interface Tracer {
8
+ /**
9
+ * Starts a new {@link Span}. Start the span without setting it on context.
10
+ *
11
+ * This method do NOT modify the current Context.
12
+ *
13
+ * @param name The name of the span
14
+ * @param [options] SpanOptions used for span creation
15
+ * @param [context] Context to use to extract parent
16
+ * @returns Span The newly created span
17
+ * @example
18
+ * const span = tracer.startSpan('op');
19
+ * span.setAttribute('key', 'value');
20
+ * span.end();
21
+ */
22
+ startSpan(name: string, options?: SpanOptions, context?: Context): Span;
23
+ /**
24
+ * Starts a new {@link Span} and calls the given function passing it the
25
+ * created span as first argument.
26
+ * Additionally the new span gets set in context and this context is activated
27
+ * for the duration of the function call.
28
+ *
29
+ * @param name The name of the span
30
+ * @param [options] SpanOptions used for span creation
31
+ * @param [context] Context to use to extract parent
32
+ * @param fn function called in the context of the span and receives the newly created span as an argument
33
+ * @returns return value of fn
34
+ * @example
35
+ * const something = tracer.startActiveSpan('op', span => {
36
+ * try {
37
+ * do some work
38
+ * span.setStatus({code: SpanStatusCode.OK});
39
+ * return something;
40
+ * } catch (err) {
41
+ * span.setStatus({
42
+ * code: SpanStatusCode.ERROR,
43
+ * message: err.message,
44
+ * });
45
+ * throw err;
46
+ * } finally {
47
+ * span.end();
48
+ * }
49
+ * });
50
+ *
51
+ * @example
52
+ * const span = tracer.startActiveSpan('op', span => {
53
+ * try {
54
+ * do some work
55
+ * return span;
56
+ * } catch (err) {
57
+ * span.setStatus({
58
+ * code: SpanStatusCode.ERROR,
59
+ * message: err.message,
60
+ * });
61
+ * throw err;
62
+ * }
63
+ * });
64
+ * do some more work
65
+ * span.end();
66
+ */
67
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;
68
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;
69
+ startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, context: Context, fn: F): ReturnType<F>;
70
+ }
71
+ //# sourceMappingURL=tracer.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=tracer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../../src/trace/tracer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Context } from '../context/types';\nimport { Span } from './span';\nimport { SpanOptions } from './SpanOptions';\n\n/**\n * Tracer provides an interface for creating {@link Span}s.\n */\nexport interface Tracer {\n /**\n * Starts a new {@link Span}. Start the span without setting it on context.\n *\n * This method do NOT modify the current Context.\n *\n * @param name The name of the span\n * @param [options] SpanOptions used for span creation\n * @param [context] Context to use to extract parent\n * @returns Span The newly created span\n * @example\n * const span = tracer.startSpan('op');\n * span.setAttribute('key', 'value');\n * span.end();\n */\n startSpan(name: string, options?: SpanOptions, context?: Context): Span;\n\n /**\n * Starts a new {@link Span} and calls the given function passing it the\n * created span as first argument.\n * Additionally the new span gets set in context and this context is activated\n * for the duration of the function call.\n *\n * @param name The name of the span\n * @param [options] SpanOptions used for span creation\n * @param [context] Context to use to extract parent\n * @param fn function called in the context of the span and receives the newly created span as an argument\n * @returns return value of fn\n * @example\n * const something = tracer.startActiveSpan('op', span => {\n * try {\n * do some work\n * span.setStatus({code: SpanStatusCode.OK});\n * return something;\n * } catch (err) {\n * span.setStatus({\n * code: SpanStatusCode.ERROR,\n * message: err.message,\n * });\n * throw err;\n * } finally {\n * span.end();\n * }\n * });\n *\n * @example\n * const span = tracer.startActiveSpan('op', span => {\n * try {\n * do some work\n * return span;\n * } catch (err) {\n * span.setStatus({\n * code: SpanStatusCode.ERROR,\n * message: err.message,\n * });\n * throw err;\n * }\n * });\n * do some more work\n * span.end();\n */\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n fn: F\n ): ReturnType<F>;\n startActiveSpan<F extends (span: Span) => unknown>(\n name: string,\n options: SpanOptions,\n context: Context,\n fn: F\n ): ReturnType<F>;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * An interface describes additional metadata of a tracer.
3
+ */
4
+ export interface TracerOptions {
5
+ /**
6
+ * The schemaUrl of the tracer or instrumentation library
7
+ */
8
+ schemaUrl?: string;
9
+ }
10
+ //# sourceMappingURL=tracer_options.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=tracer_options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracer_options.js","sourceRoot":"","sources":["../../../src/trace/tracer_options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * An interface describes additional metadata of a tracer.\n */\nexport interface TracerOptions {\n /**\n * The schemaUrl of the tracer or instrumentation library\n */\n schemaUrl?: string;\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import { Tracer } from './tracer';
2
+ import { TracerOptions } from './tracer_options';
3
+ /**
4
+ * A registry for creating named {@link Tracer}s.
5
+ */
6
+ export interface TracerProvider {
7
+ /**
8
+ * Returns a Tracer, creating one if one with the given name and version is
9
+ * not already created.
10
+ *
11
+ * This function may return different Tracer types (e.g.
12
+ * {@link NoopTracerProvider} vs. a functional tracer).
13
+ *
14
+ * @param name The name of the tracer or instrumentation library.
15
+ * @param version The version of the tracer or instrumentation library.
16
+ * @param options The options of the tracer or instrumentation library.
17
+ * @returns Tracer A Tracer with the given name and version
18
+ */
19
+ getTracer(name: string, version?: string, options?: TracerOptions): Tracer;
20
+ }
21
+ //# sourceMappingURL=tracer_provider.d.ts.map
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=tracer_provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tracer_provider.js","sourceRoot":"","sources":["../../../src/trace/tracer_provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Tracer } from './tracer';\nimport { TracerOptions } from './tracer_options';\n\n/**\n * A registry for creating named {@link Tracer}s.\n */\nexport interface TracerProvider {\n /**\n * Returns a Tracer, creating one if one with the given name and version is\n * not already created.\n *\n * This function may return different Tracer types (e.g.\n * {@link NoopTracerProvider} vs. a functional tracer).\n *\n * @param name The name of the tracer or instrumentation library.\n * @param version The version of the tracer or instrumentation library.\n * @param options The options of the tracer or instrumentation library.\n * @returns Tracer A Tracer with the given name and version\n */\n getTracer(name: string, version?: string, options?: TracerOptions): Tracer;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { TraceAPI } from './api/trace';
2
+ /** Entrypoint for trace API */
3
+ export declare const trace: TraceAPI;
4
+ //# sourceMappingURL=trace-api.d.ts.map
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ // Split module-level variable definition into separate files to allow
17
+ // tree-shaking on each api instance.
18
+ import { TraceAPI } from './api/trace';
19
+ /** Entrypoint for trace API */
20
+ export const trace = TraceAPI.getInstance();
21
+ //# sourceMappingURL=trace-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trace-api.js","sourceRoot":"","sources":["../../src/trace-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,+BAA+B;AAC/B,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { TraceAPI } from './api/trace';\n/** Entrypoint for trace API */\nexport const trace = TraceAPI.getInstance();\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const VERSION = "1.7.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ // this is autogenerated file, see scripts/version-update.js
17
+ export const VERSION = '1.7.0';
18
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.7.0';\n"]}
@@ -12,7 +12,7 @@ export type { DiagAPI } from './api/diag';
12
12
  export { createNoopMeter } from './metrics/NoopMeter';
13
13
  export { MeterOptions, Meter } from './metrics/Meter';
14
14
  export { MeterProvider } from './metrics/MeterProvider';
15
- export { ValueType, Counter, Histogram, MetricOptions, Observable, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter, BatchObservableCallback, MetricAttributes, MetricAttributeValue, ObservableCallback, } from './metrics/Metric';
15
+ export { ValueType, Counter, Histogram, MetricOptions, Observable, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter, BatchObservableCallback, MetricAdvice, MetricAttributes, MetricAttributeValue, ObservableCallback, } from './metrics/Metric';
16
16
  export { BatchObservableResult, ObservableResult, } from './metrics/ObservableResult';
17
17
  export type { MetricsAPI } from './api/metrics';
18
18
  export { TextMapPropagator, TextMapSetter, TextMapGetter, defaultTextMapGetter, defaultTextMapSetter, } from './propagation/TextMapPropagator';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,yCAAiE;AAAxD,uHAAA,8BAA8B,OAAA;AAKvC,eAAe;AACf,6CAAmE;AAA1D,2GAAA,gBAAgB,OAAA;AAAE,uGAAA,YAAY,OAAA;AAIvC,YAAY;AACZ,sDAAyD;AAAhD,kHAAA,iBAAiB,OAAA;AAC1B,sCAMsB;AAHpB,qGAAA,YAAY,OAAA;AAMd,eAAe;AACf,iDAAsD;AAA7C,4GAAA,eAAe,OAAA;AAGxB,2CAc0B;AAbxB,mGAAA,SAAS,OAAA;AAoBX,mBAAmB;AACnB,qEAMyC;AAFvC,yHAAA,oBAAoB,OAAA;AACpB,yHAAA,oBAAoB,OAAA;AAOtB,mDAAmE;AAA1D,0GAAA,WAAW,OAAA;AACpB,mEAAkE;AAAzD,0HAAA,mBAAmB,OAAA;AAE5B,yDAA0E;AAAjE,kHAAA,gBAAgB,OAAA;AAEzB,+CAA6C;AAApC,qGAAA,QAAQ,OAAA;AAGjB,yCAA4D;AAAvC,wGAAA,cAAc,OAAA;AACnC,mDAAiD;AAAxC,yGAAA,UAAU,OAAA;AAEnB,gDAA0D;AAAjD,yGAAA,gBAAgB,OAAA;AAIzB,+DAImC;AAHjC,uHAAA,kBAAkB,OAAA;AAClB,mHAAA,cAAc,OAAA;AACd,kHAAA,aAAa,OAAA;AAEf,yEAIwC;AAHtC,wHAAA,cAAc,OAAA;AACd,yHAAA,eAAe,OAAA;AACf,8HAAA,oBAAoB,OAAA;AAItB,sEAAsE;AACtE,qCAAqC;AACrC,+CAAwC;AAO/B,wFAPA,qBAAO,OAOA;AANhB,yCAAkC;AAMhB,qFANT,eAAI,OAMS;AALtB,+CAAwC;AAKhB,wFALf,qBAAO,OAKe;AAJ/B,uDAAgD;AAIf,4FAJxB,6BAAW,OAIwB;AAH5C,2CAAoC;AAGU,sFAHrC,iBAAK,OAGqC;AACnD,kBAAkB;AAClB,kBAAe;IACb,OAAO,EAAP,qBAAO;IACP,IAAI,EAAJ,eAAI;IACJ,OAAO,EAAP,qBAAO;IACP,WAAW,EAAX,6BAAW;IACX,KAAK,EAAL,iBAAK;CACN,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { BaggageEntry, BaggageEntryMetadata, Baggage } from './baggage/types';\nexport { baggageEntryMetadataFromString } from './baggage/utils';\nexport { Exception } from './common/Exception';\nexport { HrTime, TimeInput } from './common/Time';\nexport { Attributes, AttributeValue } from './common/Attributes';\n\n// Context APIs\nexport { createContextKey, ROOT_CONTEXT } from './context/context';\nexport { Context, ContextManager } from './context/types';\nexport type { ContextAPI } from './api/context';\n\n// Diag APIs\nexport { DiagConsoleLogger } from './diag/consoleLogger';\nexport {\n DiagLogFunction,\n DiagLogger,\n DiagLogLevel,\n ComponentLoggerOptions,\n DiagLoggerOptions,\n} from './diag/types';\nexport type { DiagAPI } from './api/diag';\n\n// Metrics APIs\nexport { createNoopMeter } from './metrics/NoopMeter';\nexport { MeterOptions, Meter } from './metrics/Meter';\nexport { MeterProvider } from './metrics/MeterProvider';\nexport {\n ValueType,\n Counter,\n Histogram,\n MetricOptions,\n Observable,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n UpDownCounter,\n BatchObservableCallback,\n MetricAttributes,\n MetricAttributeValue,\n ObservableCallback,\n} from './metrics/Metric';\nexport {\n BatchObservableResult,\n ObservableResult,\n} from './metrics/ObservableResult';\nexport type { MetricsAPI } from './api/metrics';\n\n// Propagation APIs\nexport {\n TextMapPropagator,\n TextMapSetter,\n TextMapGetter,\n defaultTextMapGetter,\n defaultTextMapSetter,\n} from './propagation/TextMapPropagator';\nexport type { PropagationAPI } from './api/propagation';\n\n// Trace APIs\nexport { SpanAttributes, SpanAttributeValue } from './trace/attributes';\nexport { Link } from './trace/link';\nexport { ProxyTracer, TracerDelegator } from './trace/ProxyTracer';\nexport { ProxyTracerProvider } from './trace/ProxyTracerProvider';\nexport { Sampler } from './trace/Sampler';\nexport { SamplingDecision, SamplingResult } from './trace/SamplingResult';\nexport { SpanContext } from './trace/span_context';\nexport { SpanKind } from './trace/span_kind';\nexport { Span } from './trace/span';\nexport { SpanOptions } from './trace/SpanOptions';\nexport { SpanStatus, SpanStatusCode } from './trace/status';\nexport { TraceFlags } from './trace/trace_flags';\nexport { TraceState } from './trace/trace_state';\nexport { createTraceState } from './trace/internal/utils';\nexport { TracerProvider } from './trace/tracer_provider';\nexport { Tracer } from './trace/tracer';\nexport { TracerOptions } from './trace/tracer_options';\nexport {\n isSpanContextValid,\n isValidTraceId,\n isValidSpanId,\n} from './trace/spancontext-utils';\nexport {\n INVALID_SPANID,\n INVALID_TRACEID,\n INVALID_SPAN_CONTEXT,\n} from './trace/invalid-span-constants';\nexport type { TraceAPI } from './api/trace';\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { context } from './context-api';\nimport { diag } from './diag-api';\nimport { metrics } from './metrics-api';\nimport { propagation } from './propagation-api';\nimport { trace } from './trace-api';\n\n// Named export.\nexport { context, diag, metrics, propagation, trace };\n// Default export.\nexport default {\n context,\n diag,\n metrics,\n propagation,\n trace,\n};\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,yCAAiE;AAAxD,uHAAA,8BAA8B,OAAA;AAKvC,eAAe;AACf,6CAAmE;AAA1D,2GAAA,gBAAgB,OAAA;AAAE,uGAAA,YAAY,OAAA;AAIvC,YAAY;AACZ,sDAAyD;AAAhD,kHAAA,iBAAiB,OAAA;AAC1B,sCAMsB;AAHpB,qGAAA,YAAY,OAAA;AAMd,eAAe;AACf,iDAAsD;AAA7C,4GAAA,eAAe,OAAA;AAGxB,2CAe0B;AAdxB,mGAAA,SAAS,OAAA;AAqBX,mBAAmB;AACnB,qEAMyC;AAFvC,yHAAA,oBAAoB,OAAA;AACpB,yHAAA,oBAAoB,OAAA;AAOtB,mDAAmE;AAA1D,0GAAA,WAAW,OAAA;AACpB,mEAAkE;AAAzD,0HAAA,mBAAmB,OAAA;AAE5B,yDAA0E;AAAjE,kHAAA,gBAAgB,OAAA;AAEzB,+CAA6C;AAApC,qGAAA,QAAQ,OAAA;AAGjB,yCAA4D;AAAvC,wGAAA,cAAc,OAAA;AACnC,mDAAiD;AAAxC,yGAAA,UAAU,OAAA;AAEnB,gDAA0D;AAAjD,yGAAA,gBAAgB,OAAA;AAIzB,+DAImC;AAHjC,uHAAA,kBAAkB,OAAA;AAClB,mHAAA,cAAc,OAAA;AACd,kHAAA,aAAa,OAAA;AAEf,yEAIwC;AAHtC,wHAAA,cAAc,OAAA;AACd,yHAAA,eAAe,OAAA;AACf,8HAAA,oBAAoB,OAAA;AAItB,sEAAsE;AACtE,qCAAqC;AACrC,+CAAwC;AAO/B,wFAPA,qBAAO,OAOA;AANhB,yCAAkC;AAMhB,qFANT,eAAI,OAMS;AALtB,+CAAwC;AAKhB,wFALf,qBAAO,OAKe;AAJ/B,uDAAgD;AAIf,4FAJxB,6BAAW,OAIwB;AAH5C,2CAAoC;AAGU,sFAHrC,iBAAK,OAGqC;AACnD,kBAAkB;AAClB,kBAAe;IACb,OAAO,EAAP,qBAAO;IACP,IAAI,EAAJ,eAAI;IACJ,OAAO,EAAP,qBAAO;IACP,WAAW,EAAX,6BAAW;IACX,KAAK,EAAL,iBAAK;CACN,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { BaggageEntry, BaggageEntryMetadata, Baggage } from './baggage/types';\nexport { baggageEntryMetadataFromString } from './baggage/utils';\nexport { Exception } from './common/Exception';\nexport { HrTime, TimeInput } from './common/Time';\nexport { Attributes, AttributeValue } from './common/Attributes';\n\n// Context APIs\nexport { createContextKey, ROOT_CONTEXT } from './context/context';\nexport { Context, ContextManager } from './context/types';\nexport type { ContextAPI } from './api/context';\n\n// Diag APIs\nexport { DiagConsoleLogger } from './diag/consoleLogger';\nexport {\n DiagLogFunction,\n DiagLogger,\n DiagLogLevel,\n ComponentLoggerOptions,\n DiagLoggerOptions,\n} from './diag/types';\nexport type { DiagAPI } from './api/diag';\n\n// Metrics APIs\nexport { createNoopMeter } from './metrics/NoopMeter';\nexport { MeterOptions, Meter } from './metrics/Meter';\nexport { MeterProvider } from './metrics/MeterProvider';\nexport {\n ValueType,\n Counter,\n Histogram,\n MetricOptions,\n Observable,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n UpDownCounter,\n BatchObservableCallback,\n MetricAdvice,\n MetricAttributes,\n MetricAttributeValue,\n ObservableCallback,\n} from './metrics/Metric';\nexport {\n BatchObservableResult,\n ObservableResult,\n} from './metrics/ObservableResult';\nexport type { MetricsAPI } from './api/metrics';\n\n// Propagation APIs\nexport {\n TextMapPropagator,\n TextMapSetter,\n TextMapGetter,\n defaultTextMapGetter,\n defaultTextMapSetter,\n} from './propagation/TextMapPropagator';\nexport type { PropagationAPI } from './api/propagation';\n\n// Trace APIs\nexport { SpanAttributes, SpanAttributeValue } from './trace/attributes';\nexport { Link } from './trace/link';\nexport { ProxyTracer, TracerDelegator } from './trace/ProxyTracer';\nexport { ProxyTracerProvider } from './trace/ProxyTracerProvider';\nexport { Sampler } from './trace/Sampler';\nexport { SamplingDecision, SamplingResult } from './trace/SamplingResult';\nexport { SpanContext } from './trace/span_context';\nexport { SpanKind } from './trace/span_kind';\nexport { Span } from './trace/span';\nexport { SpanOptions } from './trace/SpanOptions';\nexport { SpanStatus, SpanStatusCode } from './trace/status';\nexport { TraceFlags } from './trace/trace_flags';\nexport { TraceState } from './trace/trace_state';\nexport { createTraceState } from './trace/internal/utils';\nexport { TracerProvider } from './trace/tracer_provider';\nexport { Tracer } from './trace/tracer';\nexport { TracerOptions } from './trace/tracer_options';\nexport {\n isSpanContextValid,\n isValidTraceId,\n isValidSpanId,\n} from './trace/spancontext-utils';\nexport {\n INVALID_SPANID,\n INVALID_TRACEID,\n INVALID_SPAN_CONTEXT,\n} from './trace/invalid-span-constants';\nexport type { TraceAPI } from './api/trace';\n\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { context } from './context-api';\nimport { diag } from './diag-api';\nimport { metrics } from './metrics-api';\nimport { propagation } from './propagation-api';\nimport { trace } from './trace-api';\n\n// Named export.\nexport { context, diag, metrics, propagation, trace };\n// Default export.\nexport default {\n context,\n diag,\n metrics,\n propagation,\n trace,\n};\n"]}
@@ -1,6 +1,17 @@
1
1
  import { Attributes, AttributeValue } from '../common/Attributes';
2
2
  import { Context } from '../context/types';
3
3
  import { BatchObservableResult, ObservableResult } from './ObservableResult';
4
+ /**
5
+ * Advisory options influencing aggregation configuration parameters.
6
+ * @experimental
7
+ */
8
+ export interface MetricAdvice {
9
+ /**
10
+ * Hint the explicit bucket boundaries for SDK if the metric is been
11
+ * aggregated with a HistogramAggregator.
12
+ */
13
+ explicitBucketBoundaries?: number[];
14
+ }
4
15
  /**
5
16
  * Options needed for metric creation
6
17
  */
@@ -20,6 +31,11 @@ export interface MetricOptions {
20
31
  * @default {@link ValueType.DOUBLE}
21
32
  */
22
33
  valueType?: ValueType;
34
+ /**
35
+ * The advice influencing aggregation configuration parameters.
36
+ * @experimental
37
+ */
38
+ advice?: MetricAdvice;
23
39
  }
24
40
  /** The Type of value. It describes how the data is reported. */
25
41
  export declare enum ValueType {
@@ -1 +1 @@
1
- {"version":3,"file":"Metric.js","sourceRoot":"","sources":["../../../src/metrics/Metric.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA6BH,gEAAgE;AAChE,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,uCAAG,CAAA;IACH,6CAAM,CAAA;AACR,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Attributes, AttributeValue } from '../common/Attributes';\nimport { Context } from '../context/types';\nimport { BatchObservableResult, ObservableResult } from './ObservableResult';\n\n/**\n * Options needed for metric creation\n */\nexport interface MetricOptions {\n /**\n * The description of the Metric.\n * @default ''\n */\n description?: string;\n\n /**\n * The unit of the Metric values.\n * @default ''\n */\n unit?: string;\n\n /**\n * Indicates the type of the recorded value.\n * @default {@link ValueType.DOUBLE}\n */\n valueType?: ValueType;\n}\n\n/** The Type of value. It describes how the data is reported. */\nexport enum ValueType {\n INT,\n DOUBLE,\n}\n\n/**\n * Counter is the most common synchronous instrument. This instrument supports\n * an `Add(increment)` function for reporting a sum, and is restricted to\n * non-negative increments. The default aggregation is Sum, as for any additive\n * instrument.\n *\n * Example uses for Counter:\n * <ol>\n * <li> count the number of bytes received. </li>\n * <li> count the number of requests completed. </li>\n * <li> count the number of accounts created. </li>\n * <li> count the number of checkpoints run. </li>\n * <li> count the number of 5xx errors. </li>\n * <ol>\n */\nexport interface Counter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Increment value of counter by the input. Inputs must not be negative.\n */\n add(value: number, attributes?: AttributesTypes, context?: Context): void;\n}\n\nexport interface UpDownCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Increment value of counter by the input. Inputs may be negative.\n */\n add(value: number, attributes?: AttributesTypes, context?: Context): void;\n}\n\nexport interface Histogram<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Records a measurement. Value of the measurement must not be negative.\n */\n record(value: number, attributes?: AttributesTypes, context?: Context): void;\n}\n\n/**\n * @deprecated please use {@link Attributes}\n */\nexport type MetricAttributes = Attributes;\n\n/**\n * @deprecated please use {@link AttributeValue}\n */\nexport type MetricAttributeValue = AttributeValue;\n\n/**\n * The observable callback for Observable instruments.\n */\nexport type ObservableCallback<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = (\n observableResult: ObservableResult<AttributesTypes>\n) => void | Promise<void>;\n\n/**\n * The observable callback for a batch of Observable instruments.\n */\nexport type BatchObservableCallback<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = (\n observableResult: BatchObservableResult<AttributesTypes>\n) => void | Promise<void>;\n\nexport interface Observable<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Sets up a function that will be called whenever a metric collection is initiated.\n *\n * If the function is already in the list of callbacks for this Observable, the function is not added a second time.\n */\n addCallback(callback: ObservableCallback<AttributesTypes>): void;\n\n /**\n * Removes a callback previously registered with {@link Observable.addCallback}.\n */\n removeCallback(callback: ObservableCallback<AttributesTypes>): void;\n}\n\nexport type ObservableCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = Observable<AttributesTypes>;\nexport type ObservableUpDownCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = Observable<AttributesTypes>;\nexport type ObservableGauge<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = Observable<AttributesTypes>;\n"]}
1
+ {"version":3,"file":"Metric.js","sourceRoot":"","sources":["../../../src/metrics/Metric.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA+CH,gEAAgE;AAChE,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,uCAAG,CAAA;IACH,6CAAM,CAAA;AACR,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Attributes, AttributeValue } from '../common/Attributes';\nimport { Context } from '../context/types';\nimport { BatchObservableResult, ObservableResult } from './ObservableResult';\n\n/**\n * Advisory options influencing aggregation configuration parameters.\n * @experimental\n */\nexport interface MetricAdvice {\n /**\n * Hint the explicit bucket boundaries for SDK if the metric is been\n * aggregated with a HistogramAggregator.\n */\n explicitBucketBoundaries?: number[];\n}\n\n/**\n * Options needed for metric creation\n */\nexport interface MetricOptions {\n /**\n * The description of the Metric.\n * @default ''\n */\n description?: string;\n\n /**\n * The unit of the Metric values.\n * @default ''\n */\n unit?: string;\n\n /**\n * Indicates the type of the recorded value.\n * @default {@link ValueType.DOUBLE}\n */\n valueType?: ValueType;\n\n /**\n * The advice influencing aggregation configuration parameters.\n * @experimental\n */\n advice?: MetricAdvice;\n}\n\n/** The Type of value. It describes how the data is reported. */\nexport enum ValueType {\n INT,\n DOUBLE,\n}\n\n/**\n * Counter is the most common synchronous instrument. This instrument supports\n * an `Add(increment)` function for reporting a sum, and is restricted to\n * non-negative increments. The default aggregation is Sum, as for any additive\n * instrument.\n *\n * Example uses for Counter:\n * <ol>\n * <li> count the number of bytes received. </li>\n * <li> count the number of requests completed. </li>\n * <li> count the number of accounts created. </li>\n * <li> count the number of checkpoints run. </li>\n * <li> count the number of 5xx errors. </li>\n * <ol>\n */\nexport interface Counter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Increment value of counter by the input. Inputs must not be negative.\n */\n add(value: number, attributes?: AttributesTypes, context?: Context): void;\n}\n\nexport interface UpDownCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Increment value of counter by the input. Inputs may be negative.\n */\n add(value: number, attributes?: AttributesTypes, context?: Context): void;\n}\n\nexport interface Histogram<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Records a measurement. Value of the measurement must not be negative.\n */\n record(value: number, attributes?: AttributesTypes, context?: Context): void;\n}\n\n/**\n * @deprecated please use {@link Attributes}\n */\nexport type MetricAttributes = Attributes;\n\n/**\n * @deprecated please use {@link AttributeValue}\n */\nexport type MetricAttributeValue = AttributeValue;\n\n/**\n * The observable callback for Observable instruments.\n */\nexport type ObservableCallback<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = (\n observableResult: ObservableResult<AttributesTypes>\n) => void | Promise<void>;\n\n/**\n * The observable callback for a batch of Observable instruments.\n */\nexport type BatchObservableCallback<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = (\n observableResult: BatchObservableResult<AttributesTypes>\n) => void | Promise<void>;\n\nexport interface Observable<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Sets up a function that will be called whenever a metric collection is initiated.\n *\n * If the function is already in the list of callbacks for this Observable, the function is not added a second time.\n */\n addCallback(callback: ObservableCallback<AttributesTypes>): void;\n\n /**\n * Removes a callback previously registered with {@link Observable.addCallback}.\n */\n removeCallback(callback: ObservableCallback<AttributesTypes>): void;\n}\n\nexport type ObservableCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = Observable<AttributesTypes>;\nexport type ObservableUpDownCounter<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = Observable<AttributesTypes>;\nexport type ObservableGauge<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> = Observable<AttributesTypes>;\n"]}
@@ -20,6 +20,6 @@ export declare class NonRecordingSpan implements Span {
20
20
  updateName(_name: string): this;
21
21
  end(_endTime?: TimeInput): void;
22
22
  isRecording(): boolean;
23
- recordException(_exception: Exception, _attributesOrStartTime?: SpanAttributes | TimeInput, _time?: TimeInput): void;
23
+ recordException(_exception: Exception, _time?: TimeInput): void;
24
24
  }
25
25
  //# sourceMappingURL=NonRecordingSpan.d.ts.map
@@ -57,7 +57,7 @@ class NonRecordingSpan {
57
57
  return false;
58
58
  }
59
59
  // By default does nothing
60
- recordException(_exception, _attributesOrStartTime, _time) { }
60
+ recordException(_exception, _time) { }
61
61
  }
62
62
  exports.NonRecordingSpan = NonRecordingSpan;
63
63
  //# sourceMappingURL=NonRecordingSpan.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NonRecordingSpan.js","sourceRoot":"","sources":["../../../src/trace/NonRecordingSpan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,qEAAgE;AAKhE;;;;GAIG;AACH,MAAa,gBAAgB;IAC3B,YACmB,eAA4B,6CAAoB;QAAhD,iBAAY,GAAZ,YAAY,CAAoC;IAChE,CAAC;IAEJ,yBAAyB;IACzB,WAAW;QACT,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,0BAA0B;IAC1B,YAAY,CAAC,IAAY,EAAE,MAAe;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,aAAa,CAAC,WAA2B;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,QAAQ,CAAC,KAAa,EAAE,WAA4B;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,SAAS,CAAC,OAAmB;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,UAAU,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,GAAG,CAAC,QAAoB,IAAS,CAAC;IAElC,yDAAyD;IACzD,WAAW;QACT,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0BAA0B;IAC1B,eAAe,CACb,UAAqB,EACrB,sBAAmD,EACnD,KAAiB,IACV,CAAC;CACX;AAjDD,4CAiDC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Exception } from '../common/Exception';\nimport { TimeInput } from '../common/Time';\nimport { SpanAttributes } from './attributes';\nimport { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\nimport { Span } from './span';\nimport { SpanContext } from './span_context';\nimport { SpanStatus } from './status';\n\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nexport class NonRecordingSpan implements Span {\n constructor(\n private readonly _spanContext: SpanContext = INVALID_SPAN_CONTEXT\n ) {}\n\n // Returns a SpanContext.\n spanContext(): SpanContext {\n return this._spanContext;\n }\n\n // By default does nothing\n setAttribute(_key: string, _value: unknown): this {\n return this;\n }\n\n // By default does nothing\n setAttributes(_attributes: SpanAttributes): this {\n return this;\n }\n\n // By default does nothing\n addEvent(_name: string, _attributes?: SpanAttributes): this {\n return this;\n }\n\n // By default does nothing\n setStatus(_status: SpanStatus): this {\n return this;\n }\n\n // By default does nothing\n updateName(_name: string): this {\n return this;\n }\n\n // By default does nothing\n end(_endTime?: TimeInput): void {}\n\n // isRecording always returns false for NonRecordingSpan.\n isRecording(): boolean {\n return false;\n }\n\n // By default does nothing\n recordException(\n _exception: Exception,\n _attributesOrStartTime?: SpanAttributes | TimeInput,\n _time?: TimeInput\n ): void {}\n}\n"]}
1
+ {"version":3,"file":"NonRecordingSpan.js","sourceRoot":"","sources":["../../../src/trace/NonRecordingSpan.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAKH,qEAAgE;AAKhE;;;;GAIG;AACH,MAAa,gBAAgB;IAC3B,YACmB,eAA4B,6CAAoB;QAAhD,iBAAY,GAAZ,YAAY,CAAoC;IAChE,CAAC;IAEJ,yBAAyB;IACzB,WAAW;QACT,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,0BAA0B;IAC1B,YAAY,CAAC,IAAY,EAAE,MAAe;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,aAAa,CAAC,WAA2B;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,QAAQ,CAAC,KAAa,EAAE,WAA4B;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,SAAS,CAAC,OAAmB;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,UAAU,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,0BAA0B;IAC1B,GAAG,CAAC,QAAoB,IAAS,CAAC;IAElC,yDAAyD;IACzD,WAAW;QACT,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0BAA0B;IAC1B,eAAe,CAAC,UAAqB,EAAE,KAAiB,IAAS,CAAC;CACnE;AA7CD,4CA6CC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Exception } from '../common/Exception';\nimport { TimeInput } from '../common/Time';\nimport { SpanAttributes } from './attributes';\nimport { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\nimport { Span } from './span';\nimport { SpanContext } from './span_context';\nimport { SpanStatus } from './status';\n\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nexport class NonRecordingSpan implements Span {\n constructor(\n private readonly _spanContext: SpanContext = INVALID_SPAN_CONTEXT\n ) {}\n\n // Returns a SpanContext.\n spanContext(): SpanContext {\n return this._spanContext;\n }\n\n // By default does nothing\n setAttribute(_key: string, _value: unknown): this {\n return this;\n }\n\n // By default does nothing\n setAttributes(_attributes: SpanAttributes): this {\n return this;\n }\n\n // By default does nothing\n addEvent(_name: string, _attributes?: SpanAttributes): this {\n return this;\n }\n\n // By default does nothing\n setStatus(_status: SpanStatus): this {\n return this;\n }\n\n // By default does nothing\n updateName(_name: string): this {\n return this;\n }\n\n // By default does nothing\n end(_endTime?: TimeInput): void {}\n\n // isRecording always returns false for NonRecordingSpan.\n isRecording(): boolean {\n return false;\n }\n\n // By default does nothing\n recordException(_exception: Exception, _time?: TimeInput): void {}\n}\n"]}
@@ -97,13 +97,5 @@ export interface Span {
97
97
  * use the current time.
98
98
  */
99
99
  recordException(exception: Exception, time?: TimeInput): void;
100
- /**
101
- * Sets exception as a span event
102
- * @param exception the exception the only accepted values are string or Error
103
- * @param [attributes] the attributes that will be added to the error event.
104
- * @param [time] the time to set as Span's event time. If not provided,
105
- * use the current time.
106
- */
107
- recordException(exception: Exception, attributes?: SpanAttributes, time?: TimeInput): void;
108
100
  }
109
101
  //# sourceMappingURL=span.d.ts.map