@opentelemetry/api 1.6.0 → 1.8.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 (246) hide show
  1. package/build/esm/experimental/index.d.ts +3 -0
  2. package/build/esm/experimental/index.js +17 -0
  3. package/build/esm/experimental/index.js.map +1 -0
  4. package/build/esm/experimental/trace/SugaredOptions.d.ts +13 -0
  5. package/build/esm/experimental/trace/SugaredOptions.js +17 -0
  6. package/build/esm/experimental/trace/SugaredOptions.js.map +1 -0
  7. package/build/esm/experimental/trace/SugaredTracer.d.ts +64 -0
  8. package/build/esm/experimental/trace/SugaredTracer.js +92 -0
  9. package/build/esm/experimental/trace/SugaredTracer.js.map +1 -0
  10. package/build/esm/index.d.ts +1 -1
  11. package/build/esm/index.js.map +1 -1
  12. package/build/esm/metrics/Metric.d.ts +16 -0
  13. package/build/esm/metrics/Metric.js.map +1 -1
  14. package/build/esm/version.d.ts +1 -1
  15. package/build/esm/version.js +1 -1
  16. package/build/esm/version.js.map +1 -1
  17. package/build/esnext/api/context.d.ts +41 -0
  18. package/build/esnext/api/context.js +77 -0
  19. package/build/esnext/api/context.js.map +1 -0
  20. package/build/esnext/api/diag.d.ts +30 -0
  21. package/build/esnext/api/diag.js +89 -0
  22. package/build/esnext/api/diag.js.map +1 -0
  23. package/build/esnext/api/metrics.d.ts +28 -0
  24. package/build/esnext/api/metrics.js +57 -0
  25. package/build/esnext/api/metrics.js.map +1 -0
  26. package/build/esnext/api/propagation.d.ts +49 -0
  27. package/build/esnext/api/propagation.js +85 -0
  28. package/build/esnext/api/propagation.js.map +1 -0
  29. package/build/esnext/api/trace.d.ts +40 -0
  30. package/build/esnext/api/trace.js +75 -0
  31. package/build/esnext/api/trace.js.map +1 -0
  32. package/build/esnext/baggage/context-helpers.d.ts +29 -0
  33. package/build/esnext/baggage/context-helpers.js +56 -0
  34. package/build/esnext/baggage/context-helpers.js.map +1 -0
  35. package/build/esnext/baggage/internal/baggage-impl.d.ts +12 -0
  36. package/build/esnext/baggage/internal/baggage-impl.js +51 -0
  37. package/build/esnext/baggage/internal/baggage-impl.js.map +1 -0
  38. package/build/esnext/baggage/internal/symbol.d.ts +5 -0
  39. package/build/esnext/baggage/internal/symbol.js +20 -0
  40. package/build/esnext/baggage/internal/symbol.js.map +1 -0
  41. package/build/esnext/baggage/types.d.ts +60 -0
  42. package/build/esnext/baggage/types.js +17 -0
  43. package/build/esnext/baggage/types.js.map +1 -0
  44. package/build/esnext/baggage/utils.d.ts +15 -0
  45. package/build/esnext/baggage/utils.js +46 -0
  46. package/build/esnext/baggage/utils.js.map +1 -0
  47. package/build/esnext/common/Attributes.d.ts +15 -0
  48. package/build/esnext/common/Attributes.js +17 -0
  49. package/build/esnext/common/Attributes.js.map +1 -0
  50. package/build/esnext/common/Exception.d.ts +26 -0
  51. package/build/esnext/common/Exception.js +17 -0
  52. package/build/esnext/common/Exception.js.map +1 -0
  53. package/build/esnext/common/Time.d.ts +20 -0
  54. package/build/esnext/common/Time.js +2 -0
  55. package/build/esnext/common/Time.js.map +1 -0
  56. package/build/esnext/context/NoopContextManager.d.ts +9 -0
  57. package/build/esnext/context/NoopContextManager.js +34 -0
  58. package/build/esnext/context/NoopContextManager.js.map +1 -0
  59. package/build/esnext/context/context.d.ts +6 -0
  60. package/build/esnext/context/context.js +51 -0
  61. package/build/esnext/context/context.js.map +1 -0
  62. package/build/esnext/context/types.d.ts +52 -0
  63. package/build/esnext/context/types.js +17 -0
  64. package/build/esnext/context/types.js.map +1 -0
  65. package/build/esnext/context-api.d.ts +4 -0
  66. package/build/esnext/context-api.js +21 -0
  67. package/build/esnext/context-api.js.map +1 -0
  68. package/build/esnext/diag/ComponentLogger.d.ts +20 -0
  69. package/build/esnext/diag/ComponentLogger.js +55 -0
  70. package/build/esnext/diag/ComponentLogger.js.map +1 -0
  71. package/build/esnext/diag/consoleLogger.d.ts +38 -0
  72. package/build/esnext/diag/consoleLogger.js +53 -0
  73. package/build/esnext/diag/consoleLogger.js.map +1 -0
  74. package/build/esnext/diag/internal/logLevelLogger.d.ts +3 -0
  75. package/build/esnext/diag/internal/logLevelLogger.js +41 -0
  76. package/build/esnext/diag/internal/logLevelLogger.js.map +1 -0
  77. package/build/esnext/diag/internal/noopLogger.d.ts +8 -0
  78. package/build/esnext/diag/internal/noopLogger.js +31 -0
  79. package/build/esnext/diag/internal/noopLogger.js.map +1 -0
  80. package/build/esnext/diag/types.d.ts +100 -0
  81. package/build/esnext/diag/types.js +41 -0
  82. package/build/esnext/diag/types.js.map +1 -0
  83. package/build/esnext/diag-api.d.ts +9 -0
  84. package/build/esnext/diag-api.js +26 -0
  85. package/build/esnext/diag-api.js.map +1 -0
  86. package/build/esnext/experimental/index.d.ts +3 -0
  87. package/build/esnext/experimental/index.js +17 -0
  88. package/build/esnext/experimental/index.js.map +1 -0
  89. package/build/esnext/experimental/trace/SugaredOptions.d.ts +13 -0
  90. package/build/esnext/experimental/trace/SugaredOptions.js +17 -0
  91. package/build/esnext/experimental/trace/SugaredOptions.js.map +1 -0
  92. package/build/esnext/experimental/trace/SugaredTracer.d.ts +64 -0
  93. package/build/esnext/experimental/trace/SugaredTracer.js +88 -0
  94. package/build/esnext/experimental/trace/SugaredTracer.js.map +1 -0
  95. package/build/esnext/index.d.ts +54 -0
  96. package/build/esnext/index.js +53 -0
  97. package/build/esnext/index.js.map +1 -0
  98. package/build/esnext/internal/global-utils.d.ts +18 -0
  99. package/build/esnext/internal/global-utils.js +58 -0
  100. package/build/esnext/internal/global-utils.js.map +1 -0
  101. package/build/esnext/internal/semver.d.ts +34 -0
  102. package/build/esnext/internal/semver.js +118 -0
  103. package/build/esnext/internal/semver.js.map +1 -0
  104. package/build/esnext/metrics/Meter.d.ts +104 -0
  105. package/build/esnext/metrics/Meter.js +17 -0
  106. package/build/esnext/metrics/Meter.js.map +1 -0
  107. package/build/esnext/metrics/MeterProvider.d.ts +17 -0
  108. package/build/esnext/metrics/MeterProvider.js +17 -0
  109. package/build/esnext/metrics/MeterProvider.js.map +1 -0
  110. package/build/esnext/metrics/Metric.d.ts +109 -0
  111. package/build/esnext/metrics/Metric.js +22 -0
  112. package/build/esnext/metrics/Metric.js.map +1 -0
  113. package/build/esnext/metrics/NoopMeter.d.ts +74 -0
  114. package/build/esnext/metrics/NoopMeter.js +103 -0
  115. package/build/esnext/metrics/NoopMeter.js.map +1 -0
  116. package/build/esnext/metrics/NoopMeterProvider.d.ts +11 -0
  117. package/build/esnext/metrics/NoopMeterProvider.js +27 -0
  118. package/build/esnext/metrics/NoopMeterProvider.js.map +1 -0
  119. package/build/esnext/metrics/ObservableResult.d.ts +31 -0
  120. package/build/esnext/metrics/ObservableResult.js +17 -0
  121. package/build/esnext/metrics/ObservableResult.js.map +1 -0
  122. package/build/esnext/metrics-api.d.ts +4 -0
  123. package/build/esnext/metrics-api.js +21 -0
  124. package/build/esnext/metrics-api.js.map +1 -0
  125. package/build/esnext/platform/browser/globalThis.d.ts +10 -0
  126. package/build/esnext/platform/browser/globalThis.js +35 -0
  127. package/build/esnext/platform/browser/globalThis.js.map +1 -0
  128. package/build/esnext/platform/browser/index.d.ts +2 -0
  129. package/build/esnext/platform/browser/index.js +17 -0
  130. package/build/esnext/platform/browser/index.js.map +1 -0
  131. package/build/esnext/platform/index.d.ts +2 -0
  132. package/build/esnext/platform/index.js +17 -0
  133. package/build/esnext/platform/index.js.map +1 -0
  134. package/build/esnext/platform/node/globalThis.d.ts +3 -0
  135. package/build/esnext/platform/node/globalThis.js +19 -0
  136. package/build/esnext/platform/node/globalThis.js.map +1 -0
  137. package/build/esnext/platform/node/index.d.ts +2 -0
  138. package/build/esnext/platform/node/index.js +17 -0
  139. package/build/esnext/platform/node/index.js.map +1 -0
  140. package/build/esnext/propagation/NoopTextMapPropagator.d.ts +13 -0
  141. package/build/esnext/propagation/NoopTextMapPropagator.js +30 -0
  142. package/build/esnext/propagation/NoopTextMapPropagator.js.map +1 -0
  143. package/build/esnext/propagation/TextMapPropagator.d.ts +84 -0
  144. package/build/esnext/propagation/TextMapPropagator.js +38 -0
  145. package/build/esnext/propagation/TextMapPropagator.js.map +1 -0
  146. package/build/esnext/propagation-api.d.ts +4 -0
  147. package/build/esnext/propagation-api.js +21 -0
  148. package/build/esnext/propagation-api.js.map +1 -0
  149. package/build/esnext/trace/NonRecordingSpan.d.ts +25 -0
  150. package/build/esnext/trace/NonRecordingSpan.js +59 -0
  151. package/build/esnext/trace/NonRecordingSpan.js.map +1 -0
  152. package/build/esnext/trace/NoopTracer.d.ts +14 -0
  153. package/build/esnext/trace/NoopTracer.js +71 -0
  154. package/build/esnext/trace/NoopTracer.js.map +1 -0
  155. package/build/esnext/trace/NoopTracerProvider.d.ts +13 -0
  156. package/build/esnext/trace/NoopTracerProvider.js +28 -0
  157. package/build/esnext/trace/NoopTracerProvider.js.map +1 -0
  158. package/build/esnext/trace/ProxyTracer.d.ts +27 -0
  159. package/build/esnext/trace/ProxyTracer.js +51 -0
  160. package/build/esnext/trace/ProxyTracer.js.map +1 -0
  161. package/build/esnext/trace/ProxyTracerProvider.d.ts +25 -0
  162. package/build/esnext/trace/ProxyTracerProvider.js +50 -0
  163. package/build/esnext/trace/ProxyTracerProvider.js.map +1 -0
  164. package/build/esnext/trace/Sampler.d.ts +31 -0
  165. package/build/esnext/trace/Sampler.js +17 -0
  166. package/build/esnext/trace/Sampler.js.map +1 -0
  167. package/build/esnext/trace/SamplingResult.d.ts +49 -0
  168. package/build/esnext/trace/SamplingResult.js +39 -0
  169. package/build/esnext/trace/SamplingResult.js.map +1 -0
  170. package/build/esnext/trace/SpanOptions.d.ts +23 -0
  171. package/build/esnext/trace/SpanOptions.js +17 -0
  172. package/build/esnext/trace/SpanOptions.js.map +1 -0
  173. package/build/esnext/trace/attributes.d.ts +10 -0
  174. package/build/esnext/trace/attributes.js +17 -0
  175. package/build/esnext/trace/attributes.js.map +1 -0
  176. package/build/esnext/trace/context-utils.d.ts +41 -0
  177. package/build/esnext/trace/context-utils.js +73 -0
  178. package/build/esnext/trace/context-utils.js.map +1 -0
  179. package/build/esnext/trace/internal/tracestate-impl.d.ts +22 -0
  180. package/build/esnext/trace/internal/tracestate-impl.js +99 -0
  181. package/build/esnext/trace/internal/tracestate-impl.js.map +1 -0
  182. package/build/esnext/trace/internal/tracestate-validators.d.ts +15 -0
  183. package/build/esnext/trace/internal/tracestate-validators.js +41 -0
  184. package/build/esnext/trace/internal/tracestate-validators.js.map +1 -0
  185. package/build/esnext/trace/internal/utils.d.ts +3 -0
  186. package/build/esnext/trace/internal/utils.js +20 -0
  187. package/build/esnext/trace/internal/utils.js.map +1 -0
  188. package/build/esnext/trace/invalid-span-constants.d.ts +5 -0
  189. package/build/esnext/trace/invalid-span-constants.js +24 -0
  190. package/build/esnext/trace/invalid-span-constants.js.map +1 -0
  191. package/build/esnext/trace/link.d.ts +26 -0
  192. package/build/esnext/trace/link.js +17 -0
  193. package/build/esnext/trace/link.js.map +1 -0
  194. package/build/esnext/trace/span.d.ts +101 -0
  195. package/build/esnext/trace/span.js +17 -0
  196. package/build/esnext/trace/span.js.map +1 -0
  197. package/build/esnext/trace/span_context.d.ts +53 -0
  198. package/build/esnext/trace/span_context.js +17 -0
  199. package/build/esnext/trace/span_context.js.map +1 -0
  200. package/build/esnext/trace/span_kind.d.ts +27 -0
  201. package/build/esnext/trace/span_kind.js +43 -0
  202. package/build/esnext/trace/span_kind.js.map +1 -0
  203. package/build/esnext/trace/spancontext-utils.d.ts +17 -0
  204. package/build/esnext/trace/spancontext-utils.js +42 -0
  205. package/build/esnext/trace/spancontext-utils.js.map +1 -0
  206. package/build/esnext/trace/status.d.ts +25 -0
  207. package/build/esnext/trace/status.js +20 -0
  208. package/build/esnext/trace/status.js.map +1 -0
  209. package/build/esnext/trace/trace_flags.d.ts +7 -0
  210. package/build/esnext/trace/trace_flags.js +23 -0
  211. package/build/esnext/trace/trace_flags.js.map +1 -0
  212. package/build/esnext/trace/trace_state.d.ts +38 -0
  213. package/build/esnext/trace/trace_state.js +17 -0
  214. package/build/esnext/trace/trace_state.js.map +1 -0
  215. package/build/esnext/trace/tracer.d.ts +71 -0
  216. package/build/esnext/trace/tracer.js +17 -0
  217. package/build/esnext/trace/tracer.js.map +1 -0
  218. package/build/esnext/trace/tracer_options.d.ts +10 -0
  219. package/build/esnext/trace/tracer_options.js +17 -0
  220. package/build/esnext/trace/tracer_options.js.map +1 -0
  221. package/build/esnext/trace/tracer_provider.d.ts +21 -0
  222. package/build/esnext/trace/tracer_provider.js +17 -0
  223. package/build/esnext/trace/tracer_provider.js.map +1 -0
  224. package/build/esnext/trace-api.d.ts +4 -0
  225. package/build/esnext/trace-api.js +21 -0
  226. package/build/esnext/trace-api.js.map +1 -0
  227. package/build/esnext/version.d.ts +2 -0
  228. package/build/esnext/version.js +18 -0
  229. package/build/esnext/version.js.map +1 -0
  230. package/build/src/experimental/index.d.ts +3 -0
  231. package/build/src/experimental/index.js +22 -0
  232. package/build/src/experimental/index.js.map +1 -0
  233. package/build/src/experimental/trace/SugaredOptions.d.ts +13 -0
  234. package/build/src/experimental/trace/SugaredOptions.js +18 -0
  235. package/build/src/experimental/trace/SugaredOptions.js.map +1 -0
  236. package/build/src/experimental/trace/SugaredTracer.d.ts +64 -0
  237. package/build/src/experimental/trace/SugaredTracer.js +93 -0
  238. package/build/src/experimental/trace/SugaredTracer.js.map +1 -0
  239. package/build/src/index.d.ts +1 -1
  240. package/build/src/index.js.map +1 -1
  241. package/build/src/metrics/Metric.d.ts +16 -0
  242. package/build/src/metrics/Metric.js.map +1 -1
  243. package/build/src/version.d.ts +1 -1
  244. package/build/src/version.js +1 -1
  245. package/build/src/version.js.map +1 -1
  246. package/package.json +26 -7
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Metric.js","sourceRoot":"","sources":["../../../src/metrics/Metric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA+CH,gEAAgE;AAChE,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,uCAAG,CAAA;IACH,6CAAM,CAAA;AACR,CAAC,EAHW,SAAS,KAAT,SAAS,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"]}
@@ -0,0 +1,74 @@
1
+ import { Meter } from './Meter';
2
+ import { BatchObservableCallback, Counter, Histogram, MetricOptions, ObservableCallback, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter, MetricAttributes, Observable } from './Metric';
3
+ /**
4
+ * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses
5
+ * constant NoopMetrics for all of its methods.
6
+ */
7
+ export declare class NoopMeter implements Meter {
8
+ constructor();
9
+ /**
10
+ * @see {@link Meter.createHistogram}
11
+ */
12
+ createHistogram(_name: string, _options?: MetricOptions): Histogram;
13
+ /**
14
+ * @see {@link Meter.createCounter}
15
+ */
16
+ createCounter(_name: string, _options?: MetricOptions): Counter;
17
+ /**
18
+ * @see {@link Meter.createUpDownCounter}
19
+ */
20
+ createUpDownCounter(_name: string, _options?: MetricOptions): UpDownCounter;
21
+ /**
22
+ * @see {@link Meter.createObservableGauge}
23
+ */
24
+ createObservableGauge(_name: string, _options?: MetricOptions): ObservableGauge;
25
+ /**
26
+ * @see {@link Meter.createObservableCounter}
27
+ */
28
+ createObservableCounter(_name: string, _options?: MetricOptions): ObservableCounter;
29
+ /**
30
+ * @see {@link Meter.createObservableUpDownCounter}
31
+ */
32
+ createObservableUpDownCounter(_name: string, _options?: MetricOptions): ObservableUpDownCounter;
33
+ /**
34
+ * @see {@link Meter.addBatchObservableCallback}
35
+ */
36
+ addBatchObservableCallback(_callback: BatchObservableCallback, _observables: Observable[]): void;
37
+ /**
38
+ * @see {@link Meter.removeBatchObservableCallback}
39
+ */
40
+ removeBatchObservableCallback(_callback: BatchObservableCallback): void;
41
+ }
42
+ export declare class NoopMetric {
43
+ }
44
+ export declare class NoopCounterMetric extends NoopMetric implements Counter {
45
+ add(_value: number, _attributes: MetricAttributes): void;
46
+ }
47
+ export declare class NoopUpDownCounterMetric extends NoopMetric implements UpDownCounter {
48
+ add(_value: number, _attributes: MetricAttributes): void;
49
+ }
50
+ export declare class NoopHistogramMetric extends NoopMetric implements Histogram {
51
+ record(_value: number, _attributes: MetricAttributes): void;
52
+ }
53
+ export declare class NoopObservableMetric {
54
+ addCallback(_callback: ObservableCallback): void;
55
+ removeCallback(_callback: ObservableCallback): void;
56
+ }
57
+ export declare class NoopObservableCounterMetric extends NoopObservableMetric implements ObservableCounter {
58
+ }
59
+ export declare class NoopObservableGaugeMetric extends NoopObservableMetric implements ObservableGauge {
60
+ }
61
+ export declare class NoopObservableUpDownCounterMetric extends NoopObservableMetric implements ObservableUpDownCounter {
62
+ }
63
+ export declare const NOOP_METER: NoopMeter;
64
+ export declare const NOOP_COUNTER_METRIC: NoopCounterMetric;
65
+ export declare const NOOP_HISTOGRAM_METRIC: NoopHistogramMetric;
66
+ export declare const NOOP_UP_DOWN_COUNTER_METRIC: NoopUpDownCounterMetric;
67
+ export declare const NOOP_OBSERVABLE_COUNTER_METRIC: NoopObservableCounterMetric;
68
+ export declare const NOOP_OBSERVABLE_GAUGE_METRIC: NoopObservableGaugeMetric;
69
+ export declare const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC: NoopObservableUpDownCounterMetric;
70
+ /**
71
+ * Create a no-op Meter
72
+ */
73
+ export declare function createNoopMeter(): Meter;
74
+ //# sourceMappingURL=NoopMeter.d.ts.map
@@ -0,0 +1,103 @@
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
+ /**
17
+ * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses
18
+ * constant NoopMetrics for all of its methods.
19
+ */
20
+ export class NoopMeter {
21
+ constructor() { }
22
+ /**
23
+ * @see {@link Meter.createHistogram}
24
+ */
25
+ createHistogram(_name, _options) {
26
+ return NOOP_HISTOGRAM_METRIC;
27
+ }
28
+ /**
29
+ * @see {@link Meter.createCounter}
30
+ */
31
+ createCounter(_name, _options) {
32
+ return NOOP_COUNTER_METRIC;
33
+ }
34
+ /**
35
+ * @see {@link Meter.createUpDownCounter}
36
+ */
37
+ createUpDownCounter(_name, _options) {
38
+ return NOOP_UP_DOWN_COUNTER_METRIC;
39
+ }
40
+ /**
41
+ * @see {@link Meter.createObservableGauge}
42
+ */
43
+ createObservableGauge(_name, _options) {
44
+ return NOOP_OBSERVABLE_GAUGE_METRIC;
45
+ }
46
+ /**
47
+ * @see {@link Meter.createObservableCounter}
48
+ */
49
+ createObservableCounter(_name, _options) {
50
+ return NOOP_OBSERVABLE_COUNTER_METRIC;
51
+ }
52
+ /**
53
+ * @see {@link Meter.createObservableUpDownCounter}
54
+ */
55
+ createObservableUpDownCounter(_name, _options) {
56
+ return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
57
+ }
58
+ /**
59
+ * @see {@link Meter.addBatchObservableCallback}
60
+ */
61
+ addBatchObservableCallback(_callback, _observables) { }
62
+ /**
63
+ * @see {@link Meter.removeBatchObservableCallback}
64
+ */
65
+ removeBatchObservableCallback(_callback) { }
66
+ }
67
+ export class NoopMetric {
68
+ }
69
+ export class NoopCounterMetric extends NoopMetric {
70
+ add(_value, _attributes) { }
71
+ }
72
+ export class NoopUpDownCounterMetric extends NoopMetric {
73
+ add(_value, _attributes) { }
74
+ }
75
+ export class NoopHistogramMetric extends NoopMetric {
76
+ record(_value, _attributes) { }
77
+ }
78
+ export class NoopObservableMetric {
79
+ addCallback(_callback) { }
80
+ removeCallback(_callback) { }
81
+ }
82
+ export class NoopObservableCounterMetric extends NoopObservableMetric {
83
+ }
84
+ export class NoopObservableGaugeMetric extends NoopObservableMetric {
85
+ }
86
+ export class NoopObservableUpDownCounterMetric extends NoopObservableMetric {
87
+ }
88
+ export const NOOP_METER = new NoopMeter();
89
+ // Synchronous instruments
90
+ export const NOOP_COUNTER_METRIC = new NoopCounterMetric();
91
+ export const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
92
+ export const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
93
+ // Asynchronous instruments
94
+ export const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
95
+ export const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
96
+ export const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();
97
+ /**
98
+ * Create a no-op Meter
99
+ */
100
+ export function createNoopMeter() {
101
+ return NOOP_METER;
102
+ }
103
+ //# sourceMappingURL=NoopMeter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopMeter.js","sourceRoot":"","sources":["../../../src/metrics/NoopMeter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH;;;GAGG;AACH,MAAM,OAAO,SAAS;IACpB,gBAAe,CAAC;IAEhB;;OAEG;IACH,eAAe,CAAC,KAAa,EAAE,QAAwB;QACrD,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,KAAa,EAAE,QAAwB;QACnD,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,KAAa,EAAE,QAAwB;QACzD,OAAO,2BAA2B,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,qBAAqB,CACnB,KAAa,EACb,QAAwB;QAExB,OAAO,4BAA4B,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,uBAAuB,CACrB,KAAa,EACb,QAAwB;QAExB,OAAO,8BAA8B,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,6BAA6B,CAC3B,KAAa,EACb,QAAwB;QAExB,OAAO,sCAAsC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,0BAA0B,CACxB,SAAkC,EAClC,YAA0B,IACnB,CAAC;IAEV;;OAEG;IACH,6BAA6B,CAAC,SAAkC,IAAS,CAAC;CAC3E;AAED,MAAM,OAAO,UAAU;CAAG;AAE1B,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAC/C,GAAG,CAAC,MAAc,EAAE,WAA6B,IAAS,CAAC;CAC5D;AAED,MAAM,OAAO,uBACX,SAAQ,UAAU;IAGlB,GAAG,CAAC,MAAc,EAAE,WAA6B,IAAS,CAAC;CAC5D;AAED,MAAM,OAAO,mBAAoB,SAAQ,UAAU;IACjD,MAAM,CAAC,MAAc,EAAE,WAA6B,IAAS,CAAC;CAC/D;AAED,MAAM,OAAO,oBAAoB;IAC/B,WAAW,CAAC,SAA6B,IAAG,CAAC;IAE7C,cAAc,CAAC,SAA6B,IAAG,CAAC;CACjD;AAED,MAAM,OAAO,2BACX,SAAQ,oBAAoB;CACG;AAEjC,MAAM,OAAO,yBACX,SAAQ,oBAAoB;CACC;AAE/B,MAAM,OAAO,iCACX,SAAQ,oBAAoB;CACS;AAEvC,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,SAAS,EAAE,CAAC;AAE1C,0BAA0B;AAC1B,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,iBAAiB,EAAE,CAAC;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,mBAAmB,EAAE,CAAC;AAC/D,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAEzE,2BAA2B;AAC3B,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,2BAA2B,EAAE,CAAC;AAChF,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,yBAAyB,EAAE,CAAC;AAC5E,MAAM,CAAC,MAAM,sCAAsC,GACjD,IAAI,iCAAiC,EAAE,CAAC;AAE1C;;GAEG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,UAAU,CAAC;AACpB,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\nimport { Meter } from './Meter';\nimport {\n BatchObservableCallback,\n Counter,\n Histogram,\n MetricOptions,\n ObservableCallback,\n ObservableCounter,\n ObservableGauge,\n ObservableUpDownCounter,\n UpDownCounter,\n MetricAttributes,\n Observable,\n} from './Metric';\n\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nexport class NoopMeter implements Meter {\n constructor() {}\n\n /**\n * @see {@link Meter.createHistogram}\n */\n createHistogram(_name: string, _options?: MetricOptions): Histogram {\n return NOOP_HISTOGRAM_METRIC;\n }\n\n /**\n * @see {@link Meter.createCounter}\n */\n createCounter(_name: string, _options?: MetricOptions): Counter {\n return NOOP_COUNTER_METRIC;\n }\n\n /**\n * @see {@link Meter.createUpDownCounter}\n */\n createUpDownCounter(_name: string, _options?: MetricOptions): UpDownCounter {\n return NOOP_UP_DOWN_COUNTER_METRIC;\n }\n\n /**\n * @see {@link Meter.createObservableGauge}\n */\n createObservableGauge(\n _name: string,\n _options?: MetricOptions\n ): ObservableGauge {\n return NOOP_OBSERVABLE_GAUGE_METRIC;\n }\n\n /**\n * @see {@link Meter.createObservableCounter}\n */\n createObservableCounter(\n _name: string,\n _options?: MetricOptions\n ): ObservableCounter {\n return NOOP_OBSERVABLE_COUNTER_METRIC;\n }\n\n /**\n * @see {@link Meter.createObservableUpDownCounter}\n */\n createObservableUpDownCounter(\n _name: string,\n _options?: MetricOptions\n ): ObservableUpDownCounter {\n return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n }\n\n /**\n * @see {@link Meter.addBatchObservableCallback}\n */\n addBatchObservableCallback(\n _callback: BatchObservableCallback,\n _observables: Observable[]\n ): void {}\n\n /**\n * @see {@link Meter.removeBatchObservableCallback}\n */\n removeBatchObservableCallback(_callback: BatchObservableCallback): void {}\n}\n\nexport class NoopMetric {}\n\nexport class NoopCounterMetric extends NoopMetric implements Counter {\n add(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopUpDownCounterMetric\n extends NoopMetric\n implements UpDownCounter\n{\n add(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopHistogramMetric extends NoopMetric implements Histogram {\n record(_value: number, _attributes: MetricAttributes): void {}\n}\n\nexport class NoopObservableMetric {\n addCallback(_callback: ObservableCallback) {}\n\n removeCallback(_callback: ObservableCallback) {}\n}\n\nexport class NoopObservableCounterMetric\n extends NoopObservableMetric\n implements ObservableCounter {}\n\nexport class NoopObservableGaugeMetric\n extends NoopObservableMetric\n implements ObservableGauge {}\n\nexport class NoopObservableUpDownCounterMetric\n extends NoopObservableMetric\n implements ObservableUpDownCounter {}\n\nexport const NOOP_METER = new NoopMeter();\n\n// Synchronous instruments\nexport const NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexport const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexport const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n\n// Asynchronous instruments\nexport const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexport const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexport const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC =\n new NoopObservableUpDownCounterMetric();\n\n/**\n * Create a no-op Meter\n */\nexport function createNoopMeter(): Meter {\n return NOOP_METER;\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { Meter, MeterOptions } from './Meter';
2
+ import { MeterProvider } from './MeterProvider';
3
+ /**
4
+ * An implementation of the {@link MeterProvider} which returns an impotent Meter
5
+ * for all calls to `getMeter`
6
+ */
7
+ export declare class NoopMeterProvider implements MeterProvider {
8
+ getMeter(_name: string, _version?: string, _options?: MeterOptions): Meter;
9
+ }
10
+ export declare const NOOP_METER_PROVIDER: NoopMeterProvider;
11
+ //# sourceMappingURL=NoopMeterProvider.d.ts.map
@@ -0,0 +1,27 @@
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 { NOOP_METER } from './NoopMeter';
17
+ /**
18
+ * An implementation of the {@link MeterProvider} which returns an impotent Meter
19
+ * for all calls to `getMeter`
20
+ */
21
+ export class NoopMeterProvider {
22
+ getMeter(_name, _version, _options) {
23
+ return NOOP_METER;
24
+ }
25
+ }
26
+ export const NOOP_METER_PROVIDER = new NoopMeterProvider();
27
+ //# sourceMappingURL=NoopMeterProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopMeterProvider.js","sourceRoot":"","sources":["../../../src/metrics/NoopMeterProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAC5B,QAAQ,CAAC,KAAa,EAAE,QAAiB,EAAE,QAAuB;QAChE,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,iBAAiB,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\nimport { Meter, MeterOptions } from './Meter';\nimport { MeterProvider } from './MeterProvider';\nimport { NOOP_METER } from './NoopMeter';\n\n/**\n * An implementation of the {@link MeterProvider} which returns an impotent Meter\n * for all calls to `getMeter`\n */\nexport class NoopMeterProvider implements MeterProvider {\n getMeter(_name: string, _version?: string, _options?: MeterOptions): Meter {\n return NOOP_METER;\n }\n}\n\nexport const NOOP_METER_PROVIDER = new NoopMeterProvider();\n"]}
@@ -0,0 +1,31 @@
1
+ import { MetricAttributes, Observable } from './Metric';
2
+ /**
3
+ * Interface that is being used in callback function for Observable Metric.
4
+ */
5
+ export interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
6
+ /**
7
+ * Observe a measurement of the value associated with the given attributes.
8
+ *
9
+ * @param value The value to be observed.
10
+ * @param attributes The attributes associated with the value. If more than
11
+ * one values associated with the same attributes values, SDK may pick the
12
+ * last one or simply drop the entire observable result.
13
+ */
14
+ observe(this: ObservableResult<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
15
+ }
16
+ /**
17
+ * Interface that is being used in batch observable callback function.
18
+ */
19
+ export interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
20
+ /**
21
+ * Observe a measurement of the value associated with the given attributes.
22
+ *
23
+ * @param metric The observable metric to be observed.
24
+ * @param value The value to be observed.
25
+ * @param attributes The attributes associated with the value. If more than
26
+ * one values associated with the same attributes values, SDK may pick the
27
+ * last one or simply drop the entire observable result.
28
+ */
29
+ observe(this: BatchObservableResult<AttributesTypes>, metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
30
+ }
31
+ //# sourceMappingURL=ObservableResult.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=ObservableResult.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObservableResult.js","sourceRoot":"","sources":["../../../src/metrics/ObservableResult.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 { MetricAttributes, Observable } from './Metric';\n\n/**\n * Interface that is being used in callback function for Observable Metric.\n */\nexport interface ObservableResult<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Observe a measurement of the value associated with the given attributes.\n *\n * @param value The value to be observed.\n * @param attributes The attributes associated with the value. If more than\n * one values associated with the same attributes values, SDK may pick the\n * last one or simply drop the entire observable result.\n */\n observe(\n this: ObservableResult<AttributesTypes>,\n value: number,\n attributes?: AttributesTypes\n ): void;\n}\n\n/**\n * Interface that is being used in batch observable callback function.\n */\nexport interface BatchObservableResult<\n AttributesTypes extends MetricAttributes = MetricAttributes,\n> {\n /**\n * Observe a measurement of the value associated with the given attributes.\n *\n * @param metric The observable metric to be observed.\n * @param value The value to be observed.\n * @param attributes The attributes associated with the value. If more than\n * one values associated with the same attributes values, SDK may pick the\n * last one or simply drop the entire observable result.\n */\n observe(\n this: BatchObservableResult<AttributesTypes>,\n metric: Observable<AttributesTypes>,\n value: number,\n attributes?: AttributesTypes\n ): void;\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { MetricsAPI } from './api/metrics';
2
+ /** Entrypoint for metrics API */
3
+ export declare const metrics: MetricsAPI;
4
+ //# sourceMappingURL=metrics-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 { MetricsAPI } from './api/metrics';
19
+ /** Entrypoint for metrics API */
20
+ export const metrics = MetricsAPI.getInstance();
21
+ //# sourceMappingURL=metrics-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics-api.js","sourceRoot":"","sources":["../../src/metrics-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,sEAAsE;AACtE,qCAAqC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,iCAAiC;AACjC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,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 { MetricsAPI } from './api/metrics';\n/** Entrypoint for metrics API */\nexport const metrics = MetricsAPI.getInstance();\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * - globalThis (New standard)
3
+ * - self (Will return the current window instance for supported browsers)
4
+ * - window (fallback for older browser implementations)
5
+ * - global (NodeJS implementation)
6
+ * - <object> (When all else fails)
7
+ */
8
+ /** only globals that common to node and browsers are allowed */
9
+ export declare const _globalThis: typeof globalThis;
10
+ //# sourceMappingURL=globalThis.d.ts.map
@@ -0,0 +1,35 @@
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
+ // Updates to this file should also be replicated to @opentelemetry/core too.
17
+ /**
18
+ * - globalThis (New standard)
19
+ * - self (Will return the current window instance for supported browsers)
20
+ * - window (fallback for older browser implementations)
21
+ * - global (NodeJS implementation)
22
+ * - <object> (When all else fails)
23
+ */
24
+ /** only globals that common to node and browsers are allowed */
25
+ // eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef
26
+ export const _globalThis = typeof globalThis === 'object'
27
+ ? globalThis
28
+ : typeof self === 'object'
29
+ ? self
30
+ : typeof window === 'object'
31
+ ? window
32
+ : typeof global === 'object'
33
+ ? global
34
+ : {};
35
+ //# sourceMappingURL=globalThis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/browser/globalThis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,6EAA6E;AAE7E;;;;;;GAMG;AAEH,gEAAgE;AAChE,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GACtB,OAAO,UAAU,KAAK,QAAQ;IAC5B,CAAC,CAAC,UAAU;IACZ,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ;QAC1B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;YAC5B,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;gBAC5B,CAAC,CAAC,MAAM;gBACR,CAAC,CAAE,EAAwB,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// Updates to this file should also be replicated to @opentelemetry/core too.\n\n/**\n * - globalThis (New standard)\n * - self (Will return the current window instance for supported browsers)\n * - window (fallback for older browser implementations)\n * - global (NodeJS implementation)\n * - <object> (When all else fails)\n */\n\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef\nexport const _globalThis: typeof globalThis =\n typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? global\n : ({} as typeof globalThis);\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './globalThis';
2
+ //# sourceMappingURL=index.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 * from './globalThis';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,cAAc,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 * from './globalThis';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './node';
2
+ //# sourceMappingURL=index.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 * from './node';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,QAAQ,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 * from './node';\n"]}
@@ -0,0 +1,3 @@
1
+ /** only globals that common to node and browsers are allowed */
2
+ export declare const _globalThis: typeof globalThis;
3
+ //# sourceMappingURL=globalThis.d.ts.map
@@ -0,0 +1,19 @@
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
+ /** only globals that common to node and browsers are allowed */
17
+ // eslint-disable-next-line node/no-unsupported-features/es-builtins
18
+ export const _globalThis = typeof globalThis === 'object' ? globalThis : global;
19
+ //# sourceMappingURL=globalThis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/node/globalThis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,gEAAgE;AAChE,oEAAoE;AACpE,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,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/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexport const _globalThis = typeof globalThis === 'object' ? globalThis : global;\n"]}
@@ -0,0 +1,2 @@
1
+ export * from './globalThis';
2
+ //# sourceMappingURL=index.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 * from './globalThis';
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,cAAc,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 * from './globalThis';\n"]}
@@ -0,0 +1,13 @@
1
+ import { Context } from '../context/types';
2
+ import { TextMapPropagator } from './TextMapPropagator';
3
+ /**
4
+ * No-op implementations of {@link TextMapPropagator}.
5
+ */
6
+ export declare class NoopTextMapPropagator implements TextMapPropagator {
7
+ /** Noop inject function does nothing */
8
+ inject(_context: Context, _carrier: unknown): void;
9
+ /** Noop extract function does nothing and returns the input context */
10
+ extract(context: Context, _carrier: unknown): Context;
11
+ fields(): string[];
12
+ }
13
+ //# sourceMappingURL=NoopTextMapPropagator.d.ts.map
@@ -0,0 +1,30 @@
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
+ /**
17
+ * No-op implementations of {@link TextMapPropagator}.
18
+ */
19
+ export class NoopTextMapPropagator {
20
+ /** Noop inject function does nothing */
21
+ inject(_context, _carrier) { }
22
+ /** Noop extract function does nothing and returns the input context */
23
+ extract(context, _carrier) {
24
+ return context;
25
+ }
26
+ fields() {
27
+ return [];
28
+ }
29
+ }
30
+ //# sourceMappingURL=NoopTextMapPropagator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NoopTextMapPropagator.js","sourceRoot":"","sources":["../../../src/propagation/NoopTextMapPropagator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAChC,wCAAwC;IACxC,MAAM,CAAC,QAAiB,EAAE,QAAiB,IAAS,CAAC;IACrD,uEAAuE;IACvE,OAAO,CAAC,OAAgB,EAAE,QAAiB;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM;QACJ,OAAO,EAAE,CAAC;IACZ,CAAC;CACF","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 { TextMapPropagator } from './TextMapPropagator';\n\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nexport class NoopTextMapPropagator implements TextMapPropagator {\n /** Noop inject function does nothing */\n inject(_context: Context, _carrier: unknown): void {}\n /** Noop extract function does nothing and returns the input context */\n extract(context: Context, _carrier: unknown): Context {\n return context;\n }\n fields(): string[] {\n return [];\n }\n}\n"]}