alepha 0.15.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/README.md +43 -98
  2. package/dist/api/audits/index.d.ts +240 -240
  3. package/dist/api/audits/index.d.ts.map +1 -1
  4. package/dist/api/audits/index.js +2 -2
  5. package/dist/api/audits/index.js.map +1 -1
  6. package/dist/api/files/index.d.ts +185 -185
  7. package/dist/api/files/index.d.ts.map +1 -1
  8. package/dist/api/files/index.js +2 -2
  9. package/dist/api/files/index.js.map +1 -1
  10. package/dist/api/jobs/index.d.ts +245 -245
  11. package/dist/api/jobs/index.d.ts.map +1 -1
  12. package/dist/api/notifications/index.browser.js +4 -4
  13. package/dist/api/notifications/index.browser.js.map +1 -1
  14. package/dist/api/notifications/index.d.ts +74 -74
  15. package/dist/api/notifications/index.d.ts.map +1 -1
  16. package/dist/api/notifications/index.js +4 -4
  17. package/dist/api/notifications/index.js.map +1 -1
  18. package/dist/api/parameters/index.d.ts +221 -221
  19. package/dist/api/parameters/index.d.ts.map +1 -1
  20. package/dist/api/users/index.d.ts +1632 -1631
  21. package/dist/api/users/index.d.ts.map +1 -1
  22. package/dist/api/users/index.js +26 -34
  23. package/dist/api/users/index.js.map +1 -1
  24. package/dist/api/verifications/index.d.ts +132 -132
  25. package/dist/api/verifications/index.d.ts.map +1 -1
  26. package/dist/batch/index.d.ts +122 -122
  27. package/dist/batch/index.d.ts.map +1 -1
  28. package/dist/bucket/index.d.ts +163 -163
  29. package/dist/bucket/index.d.ts.map +1 -1
  30. package/dist/cache/core/index.d.ts +46 -46
  31. package/dist/cache/core/index.d.ts.map +1 -1
  32. package/dist/cache/redis/index.d.ts.map +1 -1
  33. package/dist/cache/redis/index.js +2 -2
  34. package/dist/cache/redis/index.js.map +1 -1
  35. package/dist/cli/index.d.ts +5933 -201
  36. package/dist/cli/index.d.ts.map +1 -1
  37. package/dist/cli/index.js +609 -169
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/command/index.d.ts +296 -296
  40. package/dist/command/index.d.ts.map +1 -1
  41. package/dist/command/index.js +19 -19
  42. package/dist/command/index.js.map +1 -1
  43. package/dist/core/index.browser.js +268 -79
  44. package/dist/core/index.browser.js.map +1 -1
  45. package/dist/core/index.d.ts +768 -694
  46. package/dist/core/index.d.ts.map +1 -1
  47. package/dist/core/index.js +268 -79
  48. package/dist/core/index.js.map +1 -1
  49. package/dist/core/index.native.js +268 -79
  50. package/dist/core/index.native.js.map +1 -1
  51. package/dist/datetime/index.d.ts +44 -44
  52. package/dist/datetime/index.d.ts.map +1 -1
  53. package/dist/email/index.d.ts +25 -25
  54. package/dist/email/index.d.ts.map +1 -1
  55. package/dist/fake/index.d.ts +5409 -5409
  56. package/dist/fake/index.d.ts.map +1 -1
  57. package/dist/fake/index.js +22 -22
  58. package/dist/fake/index.js.map +1 -1
  59. package/dist/file/index.d.ts +435 -435
  60. package/dist/file/index.d.ts.map +1 -1
  61. package/dist/lock/core/index.d.ts +208 -208
  62. package/dist/lock/core/index.d.ts.map +1 -1
  63. package/dist/lock/redis/index.d.ts.map +1 -1
  64. package/dist/logger/index.d.ts +24 -24
  65. package/dist/logger/index.d.ts.map +1 -1
  66. package/dist/logger/index.js +1 -5
  67. package/dist/logger/index.js.map +1 -1
  68. package/dist/mcp/index.d.ts +216 -198
  69. package/dist/mcp/index.d.ts.map +1 -1
  70. package/dist/mcp/index.js +28 -4
  71. package/dist/mcp/index.js.map +1 -1
  72. package/dist/orm/index.browser.js +9 -9
  73. package/dist/orm/index.browser.js.map +1 -1
  74. package/dist/orm/index.bun.js +83 -76
  75. package/dist/orm/index.bun.js.map +1 -1
  76. package/dist/orm/index.d.ts +961 -960
  77. package/dist/orm/index.d.ts.map +1 -1
  78. package/dist/orm/index.js +88 -81
  79. package/dist/orm/index.js.map +1 -1
  80. package/dist/queue/core/index.d.ts +244 -244
  81. package/dist/queue/core/index.d.ts.map +1 -1
  82. package/dist/queue/redis/index.d.ts.map +1 -1
  83. package/dist/redis/index.d.ts +105 -105
  84. package/dist/redis/index.d.ts.map +1 -1
  85. package/dist/retry/index.d.ts +69 -69
  86. package/dist/retry/index.d.ts.map +1 -1
  87. package/dist/router/index.d.ts +6 -6
  88. package/dist/router/index.d.ts.map +1 -1
  89. package/dist/scheduler/index.d.ts +108 -26
  90. package/dist/scheduler/index.d.ts.map +1 -1
  91. package/dist/scheduler/index.js +393 -1
  92. package/dist/scheduler/index.js.map +1 -1
  93. package/dist/security/index.d.ts +532 -209
  94. package/dist/security/index.d.ts.map +1 -1
  95. package/dist/security/index.js +1422 -11
  96. package/dist/security/index.js.map +1 -1
  97. package/dist/server/auth/index.d.ts +1296 -271
  98. package/dist/server/auth/index.d.ts.map +1 -1
  99. package/dist/server/auth/index.js +1249 -18
  100. package/dist/server/auth/index.js.map +1 -1
  101. package/dist/server/cache/index.d.ts +56 -56
  102. package/dist/server/cache/index.d.ts.map +1 -1
  103. package/dist/server/compress/index.d.ts +3 -3
  104. package/dist/server/compress/index.d.ts.map +1 -1
  105. package/dist/server/cookies/index.d.ts +6 -6
  106. package/dist/server/cookies/index.d.ts.map +1 -1
  107. package/dist/server/core/index.d.ts +196 -186
  108. package/dist/server/core/index.d.ts.map +1 -1
  109. package/dist/server/core/index.js +43 -27
  110. package/dist/server/core/index.js.map +1 -1
  111. package/dist/server/cors/index.d.ts +11 -11
  112. package/dist/server/cors/index.d.ts.map +1 -1
  113. package/dist/server/health/index.d.ts.map +1 -1
  114. package/dist/server/helmet/index.d.ts +2 -2
  115. package/dist/server/helmet/index.d.ts.map +1 -1
  116. package/dist/server/links/index.browser.js +9 -1
  117. package/dist/server/links/index.browser.js.map +1 -1
  118. package/dist/server/links/index.d.ts +83 -83
  119. package/dist/server/links/index.d.ts.map +1 -1
  120. package/dist/server/links/index.js +13 -5
  121. package/dist/server/links/index.js.map +1 -1
  122. package/dist/server/metrics/index.d.ts +514 -1
  123. package/dist/server/metrics/index.d.ts.map +1 -1
  124. package/dist/server/metrics/index.js +4462 -4
  125. package/dist/server/metrics/index.js.map +1 -1
  126. package/dist/server/multipart/index.d.ts +6 -6
  127. package/dist/server/multipart/index.d.ts.map +1 -1
  128. package/dist/server/proxy/index.d.ts +102 -102
  129. package/dist/server/proxy/index.d.ts.map +1 -1
  130. package/dist/server/rate-limit/index.d.ts +16 -16
  131. package/dist/server/rate-limit/index.d.ts.map +1 -1
  132. package/dist/server/static/index.d.ts +44 -44
  133. package/dist/server/static/index.d.ts.map +1 -1
  134. package/dist/server/swagger/index.d.ts +47 -47
  135. package/dist/server/swagger/index.d.ts.map +1 -1
  136. package/dist/sms/index.d.ts +11 -11
  137. package/dist/sms/index.d.ts.map +1 -1
  138. package/dist/sms/index.js +3 -3
  139. package/dist/sms/index.js.map +1 -1
  140. package/dist/thread/index.d.ts +71 -71
  141. package/dist/thread/index.d.ts.map +1 -1
  142. package/dist/thread/index.js +2 -2
  143. package/dist/thread/index.js.map +1 -1
  144. package/dist/topic/core/index.d.ts +318 -318
  145. package/dist/topic/core/index.d.ts.map +1 -1
  146. package/dist/topic/redis/index.d.ts +6 -6
  147. package/dist/topic/redis/index.d.ts.map +1 -1
  148. package/dist/vite/index.d.ts +2324 -1719
  149. package/dist/vite/index.d.ts.map +1 -1
  150. package/dist/vite/index.js +123 -475
  151. package/dist/vite/index.js.map +1 -1
  152. package/dist/websocket/index.browser.js +3 -3
  153. package/dist/websocket/index.browser.js.map +1 -1
  154. package/dist/websocket/index.d.ts +275 -275
  155. package/dist/websocket/index.d.ts.map +1 -1
  156. package/dist/websocket/index.js +3 -3
  157. package/dist/websocket/index.js.map +1 -1
  158. package/package.json +9 -9
  159. package/src/api/users/services/SessionService.ts +0 -10
  160. package/src/cli/apps/AlephaCli.ts +2 -2
  161. package/src/cli/apps/AlephaPackageBuilderCli.ts +9 -1
  162. package/src/cli/assets/apiHelloControllerTs.ts +2 -1
  163. package/src/cli/assets/biomeJson.ts +2 -1
  164. package/src/cli/assets/claudeMd.ts +9 -4
  165. package/src/cli/assets/dummySpecTs.ts +2 -1
  166. package/src/cli/assets/editorconfig.ts +2 -1
  167. package/src/cli/assets/mainBrowserTs.ts +2 -1
  168. package/src/cli/assets/mainCss.ts +24 -0
  169. package/src/cli/assets/tsconfigJson.ts +2 -1
  170. package/src/cli/assets/webAppRouterTs.ts +2 -1
  171. package/src/cli/assets/webHelloComponentTsx.ts +6 -2
  172. package/src/cli/atoms/appEntryOptions.ts +13 -0
  173. package/src/cli/atoms/buildOptions.ts +1 -1
  174. package/src/cli/atoms/changelogOptions.ts +1 -1
  175. package/src/cli/commands/build.ts +63 -47
  176. package/src/cli/commands/dev.ts +16 -33
  177. package/src/cli/commands/gen/env.ts +1 -1
  178. package/src/cli/commands/init.ts +17 -8
  179. package/src/cli/commands/lint.ts +1 -1
  180. package/src/cli/defineConfig.ts +9 -0
  181. package/src/cli/index.ts +2 -1
  182. package/src/cli/providers/AppEntryProvider.ts +131 -0
  183. package/src/cli/providers/ViteBuildProvider.ts +82 -0
  184. package/src/cli/providers/ViteDevServerProvider.ts +350 -0
  185. package/src/cli/providers/ViteTemplateProvider.ts +27 -0
  186. package/src/cli/services/AlephaCliUtils.ts +33 -2
  187. package/src/cli/services/PackageManagerUtils.ts +13 -6
  188. package/src/cli/services/ProjectScaffolder.ts +72 -49
  189. package/src/core/Alepha.ts +2 -8
  190. package/src/core/primitives/$module.ts +12 -0
  191. package/src/core/providers/KeylessJsonSchemaCodec.spec.ts +257 -0
  192. package/src/core/providers/KeylessJsonSchemaCodec.ts +396 -14
  193. package/src/core/providers/SchemaValidator.spec.ts +236 -0
  194. package/src/logger/providers/PrettyFormatterProvider.ts +0 -9
  195. package/src/mcp/errors/McpError.ts +30 -0
  196. package/src/mcp/index.ts +3 -0
  197. package/src/mcp/transports/SseMcpTransport.ts +16 -6
  198. package/src/orm/providers/DrizzleKitProvider.ts +3 -5
  199. package/src/orm/services/Repository.ts +11 -0
  200. package/src/server/core/index.ts +1 -1
  201. package/src/server/core/providers/BunHttpServerProvider.ts +1 -1
  202. package/src/server/core/providers/NodeHttpServerProvider.spec.ts +125 -0
  203. package/src/server/core/providers/NodeHttpServerProvider.ts +71 -22
  204. package/src/server/core/providers/ServerLoggerProvider.ts +2 -2
  205. package/src/server/core/providers/ServerProvider.ts +9 -12
  206. package/src/server/links/atoms/apiLinksAtom.ts +7 -0
  207. package/src/server/links/index.browser.ts +2 -0
  208. package/src/server/links/index.ts +2 -0
  209. package/src/vite/index.ts +3 -2
  210. package/src/vite/tasks/buildClient.ts +0 -1
  211. package/src/vite/tasks/buildServer.ts +68 -21
  212. package/src/vite/tasks/copyAssets.ts +5 -4
  213. package/src/vite/tasks/generateSitemap.ts +64 -23
  214. package/src/vite/tasks/index.ts +0 -2
  215. package/src/vite/tasks/prerenderPages.ts +49 -24
  216. package/src/cli/assets/indexHtml.ts +0 -15
  217. package/src/cli/commands/format.ts +0 -23
  218. package/src/vite/helpers/boot.ts +0 -117
  219. package/src/vite/plugins/viteAlephaDev.ts +0 -177
  220. package/src/vite/tasks/devServer.ts +0 -71
  221. package/src/vite/tasks/runAlepha.ts +0 -270
  222. /package/dist/orm/{chunk-DtkW-qnP.js → chunk-DH6iiROE.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/server/metrics/providers/ServerMetricsProvider.ts","../../../src/server/metrics/index.ts"],"sourcesContent":["import { $hook, $inject, Alepha } from \"alepha\";\nimport { $route } from \"alepha/server\";\nimport { collectDefaultMetrics, Histogram, Registry } from \"prom-client\";\n\nexport class ServerMetricsProvider {\n protected readonly register: Registry = new Registry();\n protected readonly alepha = $inject(Alepha);\n protected httpRequestDuration?: Histogram<string>;\n\n public readonly options: ServerMetricsProviderOptions = {};\n\n public readonly metrics = $route({\n method: \"GET\",\n path: \"/metrics\",\n silent: true,\n handler: () => this.register.metrics(),\n });\n\n protected readonly onStart = $hook({\n on: \"start\",\n handler: () => {\n collectDefaultMetrics({\n register: this.register,\n ...this.options,\n });\n this.httpRequestDuration = new Histogram({\n name: \"http_request_duration_seconds\",\n help: \"Duration of HTTP requests in seconds\",\n labelNames: [\"method\", \"path\", \"code\"],\n registers: [this.register],\n });\n },\n });\n\n protected readonly onRequest = $hook({\n on: \"server:onRequest\",\n priority: \"first\",\n handler: ({ request }) => {\n const end = this.httpRequestDuration?.startTimer();\n request.metadata.metricsTimer = end;\n },\n });\n\n protected readonly onResponse = $hook({\n on: \"server:onResponse\",\n priority: \"last\",\n handler: ({ request, response, route }) => {\n const timerEnd = request.metadata.metricsTimer as\n | MetricsTimerEnd\n | undefined;\n\n if (timerEnd) {\n timerEnd({\n method: request.method,\n path: route.path,\n code: response.status,\n });\n }\n },\n });\n}\n\nexport interface ServerMetricsProviderOptions {\n prefix?: string;\n gcDurationBuckets?: number[];\n eventLoopMonitoringPrecision?: number;\n labels?: object;\n}\n\ntype MetricsTimerEnd = (labels?: Record<string, string | number>) => number;\n","import { $module } from \"alepha\";\nimport { AlephaServer } from \"alepha/server\";\nimport { ServerMetricsProvider } from \"./providers/ServerMetricsProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./providers/ServerMetricsProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * This module provides prometheus metrics for the Alepha server.\n * Metrics are exposed at the `/metrics` endpoint.\n *\n * @see {@link ServerMetricsProvider}\n * @module alepha.server.metrics\n */\nexport const AlephaServerMetrics = $module({\n name: \"alepha.server.metrics\",\n services: [AlephaServer, ServerMetricsProvider],\n});\n"],"mappings":";;;;;AAIA,IAAa,wBAAb,MAAmC;CACjC,AAAmB,WAAqB,IAAI,UAAU;CACtD,AAAmB,SAAS,QAAQ,OAAO;CAC3C,AAAU;CAEV,AAAgB,UAAwC,EAAE;CAE1D,AAAgB,UAAU,OAAO;EAC/B,QAAQ;EACR,MAAM;EACN,QAAQ;EACR,eAAe,KAAK,SAAS,SAAS;EACvC,CAAC;CAEF,AAAmB,UAAU,MAAM;EACjC,IAAI;EACJ,eAAe;AACb,yBAAsB;IACpB,UAAU,KAAK;IACf,GAAG,KAAK;IACT,CAAC;AACF,QAAK,sBAAsB,IAAI,UAAU;IACvC,MAAM;IACN,MAAM;IACN,YAAY;KAAC;KAAU;KAAQ;KAAO;IACtC,WAAW,CAAC,KAAK,SAAS;IAC3B,CAAC;;EAEL,CAAC;CAEF,AAAmB,YAAY,MAAM;EACnC,IAAI;EACJ,UAAU;EACV,UAAU,EAAE,cAAc;GACxB,MAAM,MAAM,KAAK,qBAAqB,YAAY;AAClD,WAAQ,SAAS,eAAe;;EAEnC,CAAC;CAEF,AAAmB,aAAa,MAAM;EACpC,IAAI;EACJ,UAAU;EACV,UAAU,EAAE,SAAS,UAAU,YAAY;GACzC,MAAM,WAAW,QAAQ,SAAS;AAIlC,OAAI,SACF,UAAS;IACP,QAAQ,QAAQ;IAChB,MAAM,MAAM;IACZ,MAAM,SAAS;IAChB,CAAC;;EAGP,CAAC;;;;;;;;;;;;AC1CJ,MAAa,sBAAsB,QAAQ;CACzC,MAAM;CACN,UAAU,CAAC,cAAc,sBAAsB;CAChD,CAAC"}
1
+ {"version":3,"file":"index.js","names":["util","util","util","util","__spreadArray","__read","__read","__spreadArray","API_NAME","__read","diag","__read","__spreadArray","API_NAME","API_NAME","API_NAME","fs","fs","process","Registry","Histogram"],"sources":["../../../../../node_modules/prom-client/lib/util.js","../../../../../node_modules/prom-client/lib/registry.js","../../../../../node_modules/prom-client/lib/validation.js","../../../../../node_modules/prom-client/lib/metric.js","../../../../../node_modules/prom-client/lib/exemplar.js","../../../../../node_modules/prom-client/lib/counter.js","../../../../../node_modules/prom-client/lib/gauge.js","../../../../../node_modules/prom-client/lib/histogram.js","../../../../../node_modules/bintrees/lib/treebase.js","../../../../../node_modules/bintrees/lib/rbtree.js","../../../../../node_modules/bintrees/lib/bintree.js","../../../../../node_modules/bintrees/index.js","../../../../../node_modules/tdigest/tdigest.js","../../../../../node_modules/prom-client/lib/timeWindowQuantiles.js","../../../../../node_modules/prom-client/lib/summary.js","../../../../../node_modules/prom-client/lib/pushgateway.js","../../../../../node_modules/prom-client/lib/bucketGenerators.js","../../../../../node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js","../../../../../node_modules/@opentelemetry/api/build/esm/platform/node/index.js","../../../../../node_modules/@opentelemetry/api/build/esm/platform/index.js","../../../../../node_modules/@opentelemetry/api/build/esm/version.js","../../../../../node_modules/@opentelemetry/api/build/esm/internal/semver.js","../../../../../node_modules/@opentelemetry/api/build/esm/internal/global-utils.js","../../../../../node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js","../../../../../node_modules/@opentelemetry/api/build/esm/diag/types.js","../../../../../node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js","../../../../../node_modules/@opentelemetry/api/build/esm/api/diag.js","../../../../../node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js","../../../../../node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js","../../../../../node_modules/@opentelemetry/api/build/esm/baggage/utils.js","../../../../../node_modules/@opentelemetry/api/build/esm/context/context.js","../../../../../node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js","../../../../../node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js","../../../../../node_modules/@opentelemetry/api/build/esm/metrics/Metric.js","../../../../../node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js","../../../../../node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js","../../../../../node_modules/@opentelemetry/api/build/esm/api/context.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/context-utils.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/span_kind.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/status.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js","../../../../../node_modules/@opentelemetry/api/build/esm/context-api.js","../../../../../node_modules/@opentelemetry/api/build/esm/diag-api.js","../../../../../node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js","../../../../../node_modules/@opentelemetry/api/build/esm/api/metrics.js","../../../../../node_modules/@opentelemetry/api/build/esm/metrics-api.js","../../../../../node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js","../../../../../node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js","../../../../../node_modules/@opentelemetry/api/build/esm/api/propagation.js","../../../../../node_modules/@opentelemetry/api/build/esm/propagation-api.js","../../../../../node_modules/@opentelemetry/api/build/esm/api/trace.js","../../../../../node_modules/@opentelemetry/api/build/esm/trace-api.js","../../../../../node_modules/@opentelemetry/api/build/esm/index.js","../../../../../node_modules/prom-client/lib/metrics/processCpuTotal.js","../../../../../node_modules/prom-client/lib/metrics/processStartTime.js","../../../../../node_modules/prom-client/lib/metrics/osMemoryHeapLinux.js","../../../../../node_modules/prom-client/lib/metrics/helpers/safeMemoryUsage.js","../../../../../node_modules/prom-client/lib/metrics/osMemoryHeap.js","../../../../../node_modules/prom-client/lib/metrics/processOpenFileDescriptors.js","../../../../../node_modules/prom-client/lib/metrics/processMaxFileDescriptors.js","../../../../../node_modules/prom-client/lib/metrics/eventLoopLag.js","../../../../../node_modules/prom-client/lib/metrics/helpers/processMetricsHelpers.js","../../../../../node_modules/prom-client/lib/metrics/processHandles.js","../../../../../node_modules/prom-client/lib/metrics/processRequests.js","../../../../../node_modules/prom-client/lib/metrics/processResources.js","../../../../../node_modules/prom-client/lib/metrics/heapSizeAndUsed.js","../../../../../node_modules/prom-client/lib/metrics/heapSpacesSizeAndUsed.js","../../../../../node_modules/prom-client/lib/metrics/version.js","../../../../../node_modules/prom-client/lib/metrics/gc.js","../../../../../node_modules/prom-client/lib/defaultMetrics.js","../../../../../node_modules/prom-client/lib/metricAggregators.js","../../../../../node_modules/prom-client/lib/cluster.js","../../../../../node_modules/prom-client/index.js","../../../src/server/metrics/providers/ServerMetricsProvider.ts","../../../src/server/metrics/index.ts"],"sourcesContent":["'use strict';\n\nexports.getValueAsString = function getValueString(value) {\n\tif (Number.isNaN(value)) {\n\t\treturn 'Nan';\n\t} else if (!Number.isFinite(value)) {\n\t\tif (value < 0) {\n\t\t\treturn '-Inf';\n\t\t} else {\n\t\t\treturn '+Inf';\n\t\t}\n\t} else {\n\t\treturn `${value}`;\n\t}\n};\n\nexports.removeLabels = function removeLabels(\n\thashMap,\n\tlabels,\n\tsortedLabelNames,\n) {\n\tconst hash = hashObject(labels, sortedLabelNames);\n\tdelete hashMap[hash];\n};\n\nexports.setValue = function setValue(hashMap, value, labels) {\n\tconst hash = hashObject(labels);\n\thashMap[hash] = {\n\t\tvalue: typeof value === 'number' ? value : 0,\n\t\tlabels: labels || {},\n\t};\n\treturn hashMap;\n};\n\nexports.setValueDelta = function setValueDelta(\n\thashMap,\n\tdeltaValue,\n\tlabels,\n\thash = '',\n) {\n\tconst value = typeof deltaValue === 'number' ? deltaValue : 0;\n\tif (hashMap[hash]) {\n\t\thashMap[hash].value += value;\n\t} else {\n\t\thashMap[hash] = { value, labels };\n\t}\n\treturn hashMap;\n};\n\nexports.getLabels = function (labelNames, args) {\n\tif (typeof args[0] === 'object') {\n\t\treturn args[0];\n\t}\n\n\tif (labelNames.length !== args.length) {\n\t\tthrow new Error(\n\t\t\t`Invalid number of arguments (${args.length}): \"${args.join(\n\t\t\t\t', ',\n\t\t\t)}\" for label names (${labelNames.length}): \"${labelNames.join(', ')}\".`,\n\t\t);\n\t}\n\n\tconst acc = {};\n\tfor (let i = 0; i < labelNames.length; i++) {\n\t\tacc[labelNames[i]] = args[i];\n\t}\n\treturn acc;\n};\n\nfunction fastHashObject(keys, labels) {\n\tif (keys.length === 0) {\n\t\treturn '';\n\t}\n\n\tlet hash = '';\n\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tconst key = keys[i];\n\t\tconst value = labels[key];\n\t\tif (value === undefined) continue;\n\n\t\thash += `${key}:${value},`;\n\t}\n\n\treturn hash;\n}\n\nfunction hashObject(labels, labelNames) {\n\t// We don't actually need a hash here. We just need a string that\n\t// is unique for each possible labels object and consistent across\n\t// calls with equivalent labels objects.\n\n\tif (labelNames) {\n\t\treturn fastHashObject(labelNames, labels);\n\t}\n\n\tconst keys = Object.keys(labels);\n\tif (keys.length > 1) {\n\t\tkeys.sort(); // need consistency across calls\n\t}\n\n\treturn fastHashObject(keys, labels);\n}\nexports.hashObject = hashObject;\n\nexports.isObject = function isObject(obj) {\n\treturn obj !== null && typeof obj === 'object';\n};\n\nexports.nowTimestamp = function nowTimestamp() {\n\treturn Date.now() / 1000;\n};\n\nclass Grouper extends Map {\n\t/**\n\t * Adds the `value` to the `key`'s array of values.\n\t * @param {*} key Key to set.\n\t * @param {*} value Value to add to `key`'s array.\n\t * @returns {undefined} undefined.\n\t */\n\tadd(key, value) {\n\t\tif (this.has(key)) {\n\t\t\tthis.get(key).push(value);\n\t\t} else {\n\t\t\tthis.set(key, [value]);\n\t\t}\n\t}\n}\n\nexports.Grouper = Grouper;\n","'use strict';\n\nconst { getValueAsString } = require('./util');\n\nclass Registry {\n\tstatic get PROMETHEUS_CONTENT_TYPE() {\n\t\treturn 'text/plain; version=0.0.4; charset=utf-8';\n\t}\n\n\tstatic get OPENMETRICS_CONTENT_TYPE() {\n\t\treturn 'application/openmetrics-text; version=1.0.0; charset=utf-8';\n\t}\n\n\tconstructor(regContentType = Registry.PROMETHEUS_CONTENT_TYPE) {\n\t\tthis._metrics = {};\n\t\tthis._collectors = [];\n\t\tthis._defaultLabels = {};\n\t\tif (\n\t\t\tregContentType !== Registry.PROMETHEUS_CONTENT_TYPE &&\n\t\t\tregContentType !== Registry.OPENMETRICS_CONTENT_TYPE\n\t\t) {\n\t\t\tthrow new TypeError(`Content type ${regContentType} is unsupported`);\n\t\t}\n\t\tthis._contentType = regContentType;\n\t}\n\n\tgetMetricsAsArray() {\n\t\treturn Object.values(this._metrics);\n\t}\n\n\tasync getMetricsAsString(metrics) {\n\t\tconst metric =\n\t\t\ttypeof metrics.getForPromString === 'function'\n\t\t\t\t? await metrics.getForPromString()\n\t\t\t\t: await metrics.get();\n\n\t\tconst name = escapeString(metric.name);\n\t\tconst help = `# HELP ${name} ${escapeString(metric.help)}`;\n\t\tconst type = `# TYPE ${name} ${metric.type}`;\n\t\tconst values = [help, type];\n\n\t\tconst defaultLabels =\n\t\t\tObject.keys(this._defaultLabels).length > 0 ? this._defaultLabels : null;\n\n\t\tconst isOpenMetrics =\n\t\t\tthis.contentType === Registry.OPENMETRICS_CONTENT_TYPE;\n\n\t\tfor (const val of metric.values || []) {\n\t\t\tlet { metricName = name, labels = {} } = val;\n\t\t\tconst { sharedLabels = {} } = val;\n\t\t\tif (isOpenMetrics && metric.type === 'counter') {\n\t\t\t\tmetricName = `${metricName}_total`;\n\t\t\t}\n\n\t\t\tif (defaultLabels) {\n\t\t\t\tlabels = { ...labels, ...defaultLabels, ...labels };\n\t\t\t}\n\n\t\t\t// We have to flatten these separately to avoid duplicate labels appearing\n\t\t\t// between the base labels and the shared labels\n\t\t\tconst formattedLabels = formatLabels(labels, sharedLabels);\n\n\t\t\tconst flattenedShared = flattenSharedLabels(sharedLabels);\n\t\t\tconst labelParts = [...formattedLabels, flattenedShared].filter(Boolean);\n\t\t\tconst labelsString = labelParts.length ? `{${labelParts.join(',')}}` : '';\n\t\t\tlet fullMetricLine = `${metricName}${labelsString} ${getValueAsString(\n\t\t\t\tval.value,\n\t\t\t)}`;\n\n\t\t\tconst { exemplar } = val;\n\t\t\tif (exemplar && isOpenMetrics) {\n\t\t\t\tconst formattedExemplars = formatLabels(exemplar.labelSet);\n\t\t\t\tfullMetricLine += ` # {${formattedExemplars.join(\n\t\t\t\t\t',',\n\t\t\t\t)}} ${getValueAsString(exemplar.value)} ${exemplar.timestamp}`;\n\t\t\t}\n\t\t\tvalues.push(fullMetricLine);\n\t\t}\n\n\t\treturn values.join('\\n');\n\t}\n\n\tasync metrics() {\n\t\tconst isOpenMetrics =\n\t\t\tthis.contentType === Registry.OPENMETRICS_CONTENT_TYPE;\n\n\t\tconst promises = this.getMetricsAsArray().map(metric => {\n\t\t\tif (isOpenMetrics && metric.type === 'counter') {\n\t\t\t\tmetric.name = standardizeCounterName(metric.name);\n\t\t\t}\n\t\t\treturn this.getMetricsAsString(metric);\n\t\t});\n\n\t\tconst resolves = await Promise.all(promises);\n\n\t\treturn isOpenMetrics\n\t\t\t? `${resolves.join('\\n')}\\n# EOF\\n`\n\t\t\t: `${resolves.join('\\n\\n')}\\n`;\n\t}\n\n\tregisterMetric(metric) {\n\t\tif (this._metrics[metric.name] && this._metrics[metric.name] !== metric) {\n\t\t\tthrow new Error(\n\t\t\t\t`A metric with the name ${metric.name} has already been registered.`,\n\t\t\t);\n\t\t}\n\n\t\tthis._metrics[metric.name] = metric;\n\t}\n\n\tclear() {\n\t\tthis._metrics = {};\n\t\tthis._defaultLabels = {};\n\t}\n\n\tasync getMetricsAsJSON() {\n\t\tconst metrics = [];\n\t\tconst defaultLabelNames = Object.keys(this._defaultLabels);\n\n\t\tconst promises = [];\n\n\t\tfor (const metric of this.getMetricsAsArray()) {\n\t\t\tpromises.push(metric.get());\n\t\t}\n\n\t\tconst resolves = await Promise.all(promises);\n\n\t\tfor (const item of resolves) {\n\t\t\tif (item.values && defaultLabelNames.length > 0) {\n\t\t\t\tfor (const val of item.values) {\n\t\t\t\t\t// Make a copy before mutating\n\t\t\t\t\tval.labels = Object.assign({}, val.labels);\n\n\t\t\t\t\tfor (const labelName of defaultLabelNames) {\n\t\t\t\t\t\tval.labels[labelName] =\n\t\t\t\t\t\t\tval.labels[labelName] || this._defaultLabels[labelName];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tmetrics.push(item);\n\t\t}\n\n\t\treturn metrics;\n\t}\n\n\tremoveSingleMetric(name) {\n\t\tdelete this._metrics[name];\n\t}\n\n\tgetSingleMetricAsString(name) {\n\t\treturn this.getMetricsAsString(this._metrics[name]);\n\t}\n\n\tgetSingleMetric(name) {\n\t\treturn this._metrics[name];\n\t}\n\n\tsetDefaultLabels(labels) {\n\t\tthis._defaultLabels = labels;\n\t}\n\n\tresetMetrics() {\n\t\tfor (const metric in this._metrics) {\n\t\t\tthis._metrics[metric].reset();\n\t\t}\n\t}\n\n\tget contentType() {\n\t\treturn this._contentType;\n\t}\n\n\tsetContentType(metricsContentType) {\n\t\tif (\n\t\t\tmetricsContentType === Registry.OPENMETRICS_CONTENT_TYPE ||\n\t\t\tmetricsContentType === Registry.PROMETHEUS_CONTENT_TYPE\n\t\t) {\n\t\t\tthis._contentType = metricsContentType;\n\t\t} else {\n\t\t\tthrow new Error(`Content type ${metricsContentType} is unsupported`);\n\t\t}\n\t}\n\n\tstatic merge(registers) {\n\t\tconst regType = registers[0].contentType;\n\t\tfor (const reg of registers) {\n\t\t\tif (reg.contentType !== regType) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Registers can only be merged if they have the same content type',\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tconst mergedRegistry = new Registry(regType);\n\n\t\tconst metricsToMerge = registers.reduce(\n\t\t\t(acc, reg) => acc.concat(reg.getMetricsAsArray()),\n\t\t\t[],\n\t\t);\n\n\t\tmetricsToMerge.forEach(mergedRegistry.registerMetric, mergedRegistry);\n\t\treturn mergedRegistry;\n\t}\n}\n\nfunction formatLabels(labels, exclude) {\n\tconst { hasOwnProperty } = Object.prototype;\n\tconst formatted = [];\n\tfor (const [name, value] of Object.entries(labels)) {\n\t\tif (!exclude || !hasOwnProperty.call(exclude, name)) {\n\t\t\tformatted.push(`${name}=\"${escapeLabelValue(value)}\"`);\n\t\t}\n\t}\n\treturn formatted;\n}\n\nconst sharedLabelCache = new WeakMap();\nfunction flattenSharedLabels(labels) {\n\tconst cached = sharedLabelCache.get(labels);\n\tif (cached) {\n\t\treturn cached;\n\t}\n\n\tconst formattedLabels = formatLabels(labels);\n\tconst flattened = formattedLabels.join(',');\n\tsharedLabelCache.set(labels, flattened);\n\treturn flattened;\n}\nfunction escapeLabelValue(str) {\n\tif (typeof str !== 'string') {\n\t\treturn str;\n\t}\n\treturn escapeString(str).replace(/\"/g, '\\\\\"');\n}\nfunction escapeString(str) {\n\treturn str.replace(/\\\\/g, '\\\\\\\\').replace(/\\n/g, '\\\\n');\n}\nfunction standardizeCounterName(name) {\n\treturn name.replace(/_total$/, '');\n}\n\nmodule.exports = Registry;\nmodule.exports.globalRegistry = new Registry();\n","'use strict';\n\nconst util = require('util');\n\n// These are from https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels\nconst metricRegexp = /^[a-zA-Z_:][a-zA-Z0-9_:]*$/;\nconst labelRegexp = /^[a-zA-Z_][a-zA-Z0-9_]*$/;\n\nexports.validateMetricName = function (name) {\n\treturn metricRegexp.test(name);\n};\n\nexports.validateLabelName = function (names = []) {\n\treturn names.every(name => labelRegexp.test(name));\n};\n\nexports.validateLabel = function validateLabel(savedLabels, labels) {\n\tfor (const label in labels) {\n\t\tif (!savedLabels.includes(label)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Added label \"${label}\" is not included in initial labelset: ${util.inspect(\n\t\t\t\t\tsavedLabels,\n\t\t\t\t)}`,\n\t\t\t);\n\t\t}\n\t}\n};\n","'use strict';\n\nconst Registry = require('./registry');\nconst { isObject } = require('./util');\nconst { validateMetricName, validateLabelName } = require('./validation');\n\n/**\n * @abstract\n */\nclass Metric {\n\tconstructor(config, defaults = {}) {\n\t\tif (!isObject(config)) {\n\t\t\tthrow new TypeError('constructor expected a config object');\n\t\t}\n\t\tObject.assign(\n\t\t\tthis,\n\t\t\t{\n\t\t\t\tlabelNames: [],\n\t\t\t\tregisters: [Registry.globalRegistry],\n\t\t\t\taggregator: 'sum',\n\t\t\t\tenableExemplars: false,\n\t\t\t},\n\t\t\tdefaults,\n\t\t\tconfig,\n\t\t);\n\t\tif (!this.registers) {\n\t\t\t// in case config.registers is `undefined`\n\t\t\tthis.registers = [Registry.globalRegistry];\n\t\t}\n\t\tif (!this.help) {\n\t\t\tthrow new Error('Missing mandatory help parameter');\n\t\t}\n\t\tif (!this.name) {\n\t\t\tthrow new Error('Missing mandatory name parameter');\n\t\t}\n\t\tif (!validateMetricName(this.name)) {\n\t\t\tthrow new Error('Invalid metric name');\n\t\t}\n\t\tif (!validateLabelName(this.labelNames)) {\n\t\t\tthrow new Error('Invalid label name');\n\t\t}\n\n\t\tif (this.collect && typeof this.collect !== 'function') {\n\t\t\tthrow new Error('Optional \"collect\" parameter must be a function');\n\t\t}\n\n\t\tif (this.labelNames) {\n\t\t\tthis.sortedLabelNames = [...this.labelNames].sort();\n\t\t} else {\n\t\t\tthis.sortedLabelNames = [];\n\t\t}\n\n\t\tthis.reset();\n\n\t\tfor (const register of this.registers) {\n\t\t\tif (\n\t\t\t\tthis.enableExemplars &&\n\t\t\t\tregister.contentType === Registry.PROMETHEUS_CONTENT_TYPE\n\t\t\t) {\n\t\t\t\tthrow new TypeError(\n\t\t\t\t\t'Exemplars are supported only on OpenMetrics registries',\n\t\t\t\t);\n\t\t\t}\n\t\t\tregister.registerMetric(this);\n\t\t}\n\t}\n\n\treset() {\n\t\t/* abstract */\n\t}\n}\n\nmodule.exports = { Metric };\n","'use strict';\n\n/**\n * Class representing an OpenMetrics exemplar.\n *\n * @property {object} labelSet\n * @property {number} value\n * @property {number} [timestamp]\n * */\nclass Exemplar {\n\tconstructor(labelSet = {}, value = null) {\n\t\tthis.labelSet = labelSet;\n\t\tthis.value = value;\n\t}\n\n\t/**\n\t * Validation for the label set format.\n\t * https://github.com/OpenObservability/OpenMetrics/blob/d99b705f611b75fec8f450b05e344e02eea6921d/specification/OpenMetrics.md#exemplars\n\t *\n\t * @param {object} labelSet - Exemplar labels.\n\t * @throws {RangeError}\n\t * @return {void}\n\t */\n\tvalidateExemplarLabelSet(labelSet) {\n\t\tlet res = '';\n\t\tfor (const [labelName, labelValue] of Object.entries(labelSet)) {\n\t\t\tres += `${labelName}${labelValue}`;\n\t\t}\n\t\tif (res.length > 128) {\n\t\t\tthrow new RangeError(\n\t\t\t\t'Label set size must be smaller than 128 UTF-8 chars',\n\t\t\t);\n\t\t}\n\t}\n}\n\nmodule.exports = Exemplar;\n","/**\n * Counter metric\n */\n'use strict';\n\nconst util = require('util');\nconst {\n\thashObject,\n\tisObject,\n\tgetLabels,\n\tremoveLabels,\n\tnowTimestamp,\n} = require('./util');\nconst { validateLabel } = require('./validation');\nconst { Metric } = require('./metric');\nconst Exemplar = require('./exemplar');\n\nclass Counter extends Metric {\n\tconstructor(config) {\n\t\tsuper(config);\n\t\tthis.type = 'counter';\n\t\tthis.defaultLabels = {};\n\t\tthis.defaultValue = 1;\n\t\tthis.defaultExemplarLabelSet = {};\n\t\tif (config.enableExemplars) {\n\t\t\tthis.enableExemplars = true;\n\t\t\tthis.inc = this.incWithExemplar;\n\t\t} else {\n\t\t\tthis.inc = this.incWithoutExemplar;\n\t\t}\n\t}\n\n\t/**\n\t * Increment counter\n\t * @param {object} labels - What label you want to be incremented\n\t * @param {Number} value - Value to increment, if omitted increment with 1\n\t * @returns {object} results - object with information about the inc operation\n\t * @returns {string} results.labelHash - hash representation of the labels\n\t */\n\tincWithoutExemplar(labels, value) {\n\t\tlet hash = '';\n\t\tif (isObject(labels)) {\n\t\t\thash = hashObject(labels, this.sortedLabelNames);\n\t\t\tvalidateLabel(this.labelNames, labels);\n\t\t} else {\n\t\t\tvalue = labels;\n\t\t\tlabels = {};\n\t\t}\n\n\t\tif (value && !Number.isFinite(value)) {\n\t\t\tthrow new TypeError(`Value is not a valid number: ${util.format(value)}`);\n\t\t}\n\t\tif (value < 0) {\n\t\t\tthrow new Error('It is not possible to decrease a counter');\n\t\t}\n\n\t\tif (value === null || value === undefined) value = 1;\n\n\t\tsetValue(this.hashMap, value, labels, hash);\n\n\t\treturn { labelHash: hash };\n\t}\n\n\t/**\n\t * Increment counter with exemplar, same as inc but accepts labels for an\n\t * exemplar.\n\t * If no label is provided the current exemplar labels are kept unchanged\n\t * (defaults to empty set).\n\t *\n\t * @param {object} incOpts - Object with options about what metric to increase\n\t * @param {object} incOpts.labels - What label you want to be incremented,\n\t * defaults to null (metric with no labels)\n\t * @param {Number} incOpts.value - Value to increment, defaults to 1\n\t * @param {object} incOpts.exemplarLabels - Key-value labels for the\n\t * exemplar, defaults to empty set {}\n\t * @returns {void}\n\t */\n\tincWithExemplar({\n\t\tlabels = this.defaultLabels,\n\t\tvalue = this.defaultValue,\n\t\texemplarLabels = this.defaultExemplarLabelSet,\n\t} = {}) {\n\t\tconst res = this.incWithoutExemplar(labels, value);\n\t\tthis.updateExemplar(exemplarLabels, value, res.labelHash);\n\t}\n\n\tupdateExemplar(exemplarLabels, value, hash) {\n\t\tif (exemplarLabels === this.defaultExemplarLabelSet) return;\n\t\tif (!isObject(this.hashMap[hash].exemplar)) {\n\t\t\tthis.hashMap[hash].exemplar = new Exemplar();\n\t\t}\n\t\tthis.hashMap[hash].exemplar.validateExemplarLabelSet(exemplarLabels);\n\t\tthis.hashMap[hash].exemplar.labelSet = exemplarLabels;\n\t\tthis.hashMap[hash].exemplar.value = value ? value : 1;\n\t\tthis.hashMap[hash].exemplar.timestamp = nowTimestamp();\n\t}\n\n\t/**\n\t * Reset counter\n\t * @returns {void}\n\t */\n\treset() {\n\t\tthis.hashMap = {};\n\t\tif (this.labelNames.length === 0) {\n\t\t\tsetValue(this.hashMap, 0);\n\t\t}\n\t}\n\n\tasync get() {\n\t\tif (this.collect) {\n\t\t\tconst v = this.collect();\n\t\t\tif (v instanceof Promise) await v;\n\t\t}\n\n\t\treturn {\n\t\t\thelp: this.help,\n\t\t\tname: this.name,\n\t\t\ttype: this.type,\n\t\t\tvalues: Object.values(this.hashMap),\n\t\t\taggregator: this.aggregator,\n\t\t};\n\t}\n\n\tlabels(...args) {\n\t\tconst labels = getLabels(this.labelNames, args) || {};\n\t\treturn {\n\t\t\tinc: this.inc.bind(this, labels),\n\t\t};\n\t}\n\n\tremove(...args) {\n\t\tconst labels = getLabels(this.labelNames, args) || {};\n\t\tvalidateLabel(this.labelNames, labels);\n\t\treturn removeLabels.call(this, this.hashMap, labels, this.sortedLabelNames);\n\t}\n}\n\nfunction setValue(hashMap, value, labels = {}, hash = '') {\n\tif (hashMap[hash]) {\n\t\thashMap[hash].value += value;\n\t} else {\n\t\thashMap[hash] = { value, labels };\n\t}\n\treturn hashMap;\n}\n\nmodule.exports = Counter;\n","/**\n * Gauge metric\n */\n'use strict';\n\nconst util = require('util');\n\nconst {\n\tsetValue,\n\tsetValueDelta,\n\tgetLabels,\n\thashObject,\n\tisObject,\n\tremoveLabels,\n} = require('./util');\nconst { validateLabel } = require('./validation');\nconst { Metric } = require('./metric');\n\nclass Gauge extends Metric {\n\tconstructor(config) {\n\t\tsuper(config);\n\t\tthis.type = 'gauge';\n\t}\n\n\t/**\n\t * Set a gauge to a value\n\t * @param {object} labels - Object with labels and their values\n\t * @param {Number} value - Value to set the gauge to, must be positive\n\t * @returns {void}\n\t */\n\tset(labels, value) {\n\t\tvalue = getValueArg(labels, value);\n\t\tlabels = getLabelArg(labels);\n\t\tset(this, labels, value);\n\t}\n\n\t/**\n\t * Reset gauge\n\t * @returns {void}\n\t */\n\treset() {\n\t\tthis.hashMap = {};\n\t\tif (this.labelNames.length === 0) {\n\t\t\tsetValue(this.hashMap, 0, {});\n\t\t}\n\t}\n\n\t/**\n\t * Increment a gauge value\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @param {Number} value - Value to increment - if omitted, increment with 1\n\t * @returns {void}\n\t */\n\tinc(labels, value) {\n\t\tvalue = getValueArg(labels, value);\n\t\tlabels = getLabelArg(labels);\n\t\tif (value === undefined) value = 1;\n\t\tsetDelta(this, labels, value);\n\t}\n\n\t/**\n\t * Decrement a gauge value\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @param {Number} value - Value to decrement - if omitted, decrement with 1\n\t * @returns {void}\n\t */\n\tdec(labels, value) {\n\t\tvalue = getValueArg(labels, value);\n\t\tlabels = getLabelArg(labels);\n\t\tif (value === undefined) value = 1;\n\t\tsetDelta(this, labels, -value);\n\t}\n\n\t/**\n\t * Set the gauge to current unix epoch\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @returns {void}\n\t */\n\tsetToCurrentTime(labels) {\n\t\tconst now = Date.now() / 1000;\n\t\tif (labels === undefined) {\n\t\t\tthis.set(now);\n\t\t} else {\n\t\t\tthis.set(labels, now);\n\t\t}\n\t}\n\n\t/**\n\t * Start a timer\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @returns {function} - Invoke this function to set the duration in seconds since you started the timer.\n\t * @example\n\t * var done = gauge.startTimer();\n\t * makeXHRRequest(function(err, response) {\n\t *\tdone(); //Duration of the request will be saved\n\t * });\n\t */\n\tstartTimer(labels) {\n\t\tconst start = process.hrtime();\n\t\treturn endLabels => {\n\t\t\tconst delta = process.hrtime(start);\n\t\t\tconst value = delta[0] + delta[1] / 1e9;\n\t\t\tthis.set(Object.assign({}, labels, endLabels), value);\n\t\t\treturn value;\n\t\t};\n\t}\n\n\tasync get() {\n\t\tif (this.collect) {\n\t\t\tconst v = this.collect();\n\t\t\tif (v instanceof Promise) await v;\n\t\t}\n\t\treturn {\n\t\t\thelp: this.help,\n\t\t\tname: this.name,\n\t\t\ttype: this.type,\n\t\t\tvalues: Object.values(this.hashMap),\n\t\t\taggregator: this.aggregator,\n\t\t};\n\t}\n\n\t_getValue(labels) {\n\t\tconst hash = hashObject(labels || {}, this.sortedLabelNames);\n\t\treturn this.hashMap[hash] ? this.hashMap[hash].value : 0;\n\t}\n\n\tlabels(...args) {\n\t\tconst labels = getLabels(this.labelNames, args);\n\t\tvalidateLabel(this.labelNames, labels);\n\t\treturn {\n\t\t\tinc: this.inc.bind(this, labels),\n\t\t\tdec: this.dec.bind(this, labels),\n\t\t\tset: this.set.bind(this, labels),\n\t\t\tsetToCurrentTime: this.setToCurrentTime.bind(this, labels),\n\t\t\tstartTimer: this.startTimer.bind(this, labels),\n\t\t};\n\t}\n\n\tremove(...args) {\n\t\tconst labels = getLabels(this.labelNames, args);\n\t\tvalidateLabel(this.labelNames, labels);\n\t\tremoveLabels.call(this, this.hashMap, labels, this.sortedLabelNames);\n\t}\n}\n\nfunction set(gauge, labels, value) {\n\tif (typeof value !== 'number') {\n\t\tthrow new TypeError(`Value is not a valid number: ${util.format(value)}`);\n\t}\n\n\tvalidateLabel(gauge.labelNames, labels);\n\tsetValue(gauge.hashMap, value, labels);\n}\n\nfunction setDelta(gauge, labels, delta) {\n\tif (typeof delta !== 'number') {\n\t\tthrow new TypeError(`Delta is not a valid number: ${util.format(delta)}`);\n\t}\n\n\tvalidateLabel(gauge.labelNames, labels);\n\tconst hash = hashObject(labels, gauge.sortedLabelNames);\n\tsetValueDelta(gauge.hashMap, delta, labels, hash);\n}\n\nfunction getLabelArg(labels) {\n\treturn isObject(labels) ? labels : {};\n}\n\nfunction getValueArg(labels, value) {\n\treturn isObject(labels) ? value : labels;\n}\n\nmodule.exports = Gauge;\n","/**\n * Histogram\n */\n'use strict';\n\nconst util = require('util');\nconst {\n\tgetLabels,\n\thashObject,\n\tisObject,\n\tremoveLabels,\n\tnowTimestamp,\n} = require('./util');\nconst { validateLabel } = require('./validation');\nconst { Metric } = require('./metric');\nconst Exemplar = require('./exemplar');\n\nclass Histogram extends Metric {\n\tconstructor(config) {\n\t\tsuper(config, {\n\t\t\tbuckets: [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10],\n\t\t});\n\n\t\tthis.type = 'histogram';\n\t\tthis.defaultLabels = {};\n\t\tthis.defaultExemplarLabelSet = {};\n\t\tthis.enableExemplars = false;\n\n\t\tfor (const label of this.labelNames) {\n\t\t\tif (label === 'le') {\n\t\t\t\tthrow new Error('le is a reserved label keyword');\n\t\t\t}\n\t\t}\n\n\t\tthis.upperBounds = this.buckets;\n\t\tthis.bucketValues = this.upperBounds.reduce((acc, upperBound) => {\n\t\t\tacc[upperBound] = 0;\n\t\t\treturn acc;\n\t\t}, {});\n\n\t\tif (config.enableExemplars) {\n\t\t\tthis.enableExemplars = true;\n\t\t\tthis.bucketExemplars = this.upperBounds.reduce((acc, upperBound) => {\n\t\t\t\tacc[upperBound] = null;\n\t\t\t\treturn acc;\n\t\t\t}, {});\n\t\t\tObject.freeze(this.bucketExemplars);\n\t\t\tthis.observe = this.observeWithExemplar;\n\t\t} else {\n\t\t\tthis.observe = this.observeWithoutExemplar;\n\t\t}\n\n\t\tObject.freeze(this.bucketValues);\n\t\tObject.freeze(this.upperBounds);\n\n\t\tif (this.labelNames.length === 0) {\n\t\t\tthis.hashMap = {\n\t\t\t\t[hashObject({})]: createBaseValues(\n\t\t\t\t\t{},\n\t\t\t\t\tthis.bucketValues,\n\t\t\t\t\tthis.bucketExemplars,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Observe a value in histogram\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @param {Number} value - Value to observe in the histogram\n\t * @returns {void}\n\t */\n\tobserveWithoutExemplar(labels, value) {\n\t\tobserve.call(this, labels === 0 ? 0 : labels || {})(value);\n\t}\n\n\tobserveWithExemplar({\n\t\tlabels = this.defaultLabels,\n\t\tvalue,\n\t\texemplarLabels = this.defaultExemplarLabelSet,\n\t} = {}) {\n\t\tobserve.call(this, labels === 0 ? 0 : labels || {})(value);\n\t\tthis.updateExemplar(labels, value, exemplarLabels);\n\t}\n\n\tupdateExemplar(labels, value, exemplarLabels) {\n\t\tif (Object.keys(exemplarLabels).length === 0) return;\n\t\tconst hash = hashObject(labels, this.sortedLabelNames);\n\t\tconst bound = findBound(this.upperBounds, value);\n\t\tconst { bucketExemplars } = this.hashMap[hash];\n\t\tlet exemplar = bucketExemplars[bound];\n\t\tif (!isObject(exemplar)) {\n\t\t\texemplar = new Exemplar();\n\t\t\tbucketExemplars[bound] = exemplar;\n\t\t}\n\t\texemplar.validateExemplarLabelSet(exemplarLabels);\n\t\texemplar.labelSet = exemplarLabels;\n\t\texemplar.value = value;\n\t\texemplar.timestamp = nowTimestamp();\n\t}\n\n\tasync get() {\n\t\tconst data = await this.getForPromString();\n\t\tdata.values = data.values.map(splayLabels);\n\t\treturn data;\n\t}\n\n\tasync getForPromString() {\n\t\tif (this.collect) {\n\t\t\tconst v = this.collect();\n\t\t\tif (v instanceof Promise) await v;\n\t\t}\n\t\tconst data = Object.values(this.hashMap);\n\t\tconst values = data\n\t\t\t.map(extractBucketValuesForExport(this))\n\t\t\t.reduce(addSumAndCountForExport(this), []);\n\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\thelp: this.help,\n\t\t\ttype: this.type,\n\t\t\tvalues,\n\t\t\taggregator: this.aggregator,\n\t\t};\n\t}\n\n\treset() {\n\t\tthis.hashMap = {};\n\t}\n\n\t/**\n\t * Initialize the metrics for the given combination of labels to zero\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @returns {void}\n\t */\n\tzero(labels) {\n\t\tconst hash = hashObject(labels, this.sortedLabelNames);\n\t\tthis.hashMap[hash] = createBaseValues(\n\t\t\tlabels,\n\t\t\tthis.bucketValues,\n\t\t\tthis.bucketExemplars,\n\t\t);\n\t}\n\n\t/**\n\t * Start a timer that could be used to logging durations\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @param {object} exemplarLabels - Object with labels for exemplar where key is the label key and value is label value. Can only be one level deep\n\t * @returns {function} - Function to invoke when you want to stop the timer and observe the duration in seconds\n\t * @example\n\t * var end = histogram.startTimer();\n\t * makeExpensiveXHRRequest(function(err, res) {\n\t * \tconst duration = end(); //Observe the duration of expensiveXHRRequest and returns duration in seconds\n\t * \tconsole.log('Duration', duration);\n\t * });\n\t */\n\tstartTimer(labels, exemplarLabels) {\n\t\treturn this.enableExemplars\n\t\t\t? startTimerWithExemplar.call(this, labels, exemplarLabels)()\n\t\t\t: startTimer.call(this, labels)();\n\t}\n\n\tlabels(...args) {\n\t\tconst labels = getLabels(this.labelNames, args);\n\t\tvalidateLabel(this.labelNames, labels);\n\t\treturn {\n\t\t\tobserve: observe.call(this, labels),\n\t\t\tstartTimer: startTimer.call(this, labels),\n\t\t};\n\t}\n\n\tremove(...args) {\n\t\tconst labels = getLabels(this.labelNames, args);\n\t\tvalidateLabel(this.labelNames, labels);\n\t\tremoveLabels.call(this, this.hashMap, labels, this.sortedLabelNames);\n\t}\n}\n\nfunction startTimer(startLabels) {\n\treturn () => {\n\t\tconst start = process.hrtime();\n\t\treturn endLabels => {\n\t\t\tconst delta = process.hrtime(start);\n\t\t\tconst value = delta[0] + delta[1] / 1e9;\n\t\t\tthis.observe(Object.assign({}, startLabels, endLabels), value);\n\t\t\treturn value;\n\t\t};\n\t};\n}\n\nfunction startTimerWithExemplar(startLabels, startExemplarLabels) {\n\treturn () => {\n\t\tconst start = process.hrtime();\n\t\treturn (endLabels, endExemplarLabels) => {\n\t\t\tconst delta = process.hrtime(start);\n\t\t\tconst value = delta[0] + delta[1] / 1e9;\n\t\t\tthis.observe({\n\t\t\t\tlabels: Object.assign({}, startLabels, endLabels),\n\t\t\t\tvalue,\n\t\t\t\texemplarLabels: Object.assign(\n\t\t\t\t\t{},\n\t\t\t\t\tstartExemplarLabels,\n\t\t\t\t\tendExemplarLabels,\n\t\t\t\t),\n\t\t\t});\n\t\t\treturn value;\n\t\t};\n\t};\n}\n\nfunction setValuePair(labels, value, metricName, exemplar, sharedLabels = {}) {\n\treturn {\n\t\tlabels,\n\t\tsharedLabels,\n\t\tvalue,\n\t\tmetricName,\n\t\texemplar,\n\t};\n}\n\nfunction findBound(upperBounds, value) {\n\tfor (let i = 0; i < upperBounds.length; i++) {\n\t\tconst bound = upperBounds[i];\n\t\tif (value <= bound) {\n\t\t\treturn bound;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction observe(labels) {\n\treturn value => {\n\t\tconst labelValuePair = convertLabelsAndValues(labels, value);\n\n\t\tvalidateLabel(this.labelNames, labelValuePair.labels);\n\t\tif (!Number.isFinite(labelValuePair.value)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Value is not a valid number: ${util.format(labelValuePair.value)}`,\n\t\t\t);\n\t\t}\n\n\t\tconst hash = hashObject(labelValuePair.labels, this.sortedLabelNames);\n\t\tlet valueFromMap = this.hashMap[hash];\n\t\tif (!valueFromMap) {\n\t\t\tvalueFromMap = createBaseValues(\n\t\t\t\tlabelValuePair.labels,\n\t\t\t\tthis.bucketValues,\n\t\t\t\tthis.bucketExemplars,\n\t\t\t);\n\t\t}\n\n\t\tconst b = findBound(this.upperBounds, labelValuePair.value);\n\n\t\tvalueFromMap.sum += labelValuePair.value;\n\t\tvalueFromMap.count += 1;\n\n\t\tif (Object.prototype.hasOwnProperty.call(valueFromMap.bucketValues, b)) {\n\t\t\tvalueFromMap.bucketValues[b] += 1;\n\t\t}\n\n\t\tthis.hashMap[hash] = valueFromMap;\n\t};\n}\n\nfunction createBaseValues(labels, bucketValues, bucketExemplars) {\n\tconst result = {\n\t\tlabels,\n\t\tbucketValues: { ...bucketValues },\n\t\tsum: 0,\n\t\tcount: 0,\n\t};\n\tif (bucketExemplars) {\n\t\tresult.bucketExemplars = { ...bucketExemplars };\n\t}\n\treturn result;\n}\n\nfunction convertLabelsAndValues(labels, value) {\n\treturn isObject(labels)\n\t\t? {\n\t\t\t\tlabels,\n\t\t\t\tvalue,\n\t\t\t}\n\t\t: {\n\t\t\t\tvalue: labels,\n\t\t\t\tlabels: {},\n\t\t\t};\n}\n\nfunction extractBucketValuesForExport(histogram) {\n\tconst name = `${histogram.name}_bucket`;\n\treturn bucketData => {\n\t\tlet acc = 0;\n\t\tconst buckets = histogram.upperBounds.map(upperBound => {\n\t\t\tacc += bucketData.bucketValues[upperBound];\n\t\t\treturn setValuePair(\n\t\t\t\t{ le: upperBound },\n\t\t\t\tacc,\n\t\t\t\tname,\n\t\t\t\tbucketData.bucketExemplars\n\t\t\t\t\t? bucketData.bucketExemplars[upperBound]\n\t\t\t\t\t: null,\n\t\t\t\tbucketData.labels,\n\t\t\t);\n\t\t});\n\t\treturn { buckets, data: bucketData };\n\t};\n}\n\nfunction addSumAndCountForExport(histogram) {\n\treturn (acc, d) => {\n\t\tacc.push(...d.buckets);\n\n\t\tconst infLabel = { le: '+Inf' };\n\t\tacc.push(\n\t\t\tsetValuePair(\n\t\t\t\tinfLabel,\n\t\t\t\td.data.count,\n\t\t\t\t`${histogram.name}_bucket`,\n\t\t\t\td.data.bucketExemplars ? d.data.bucketExemplars['-1'] : null,\n\t\t\t\td.data.labels,\n\t\t\t),\n\t\t\tsetValuePair(\n\t\t\t\t{},\n\t\t\t\td.data.sum,\n\t\t\t\t`${histogram.name}_sum`,\n\t\t\t\tundefined,\n\t\t\t\td.data.labels,\n\t\t\t),\n\t\t\tsetValuePair(\n\t\t\t\t{},\n\t\t\t\td.data.count,\n\t\t\t\t`${histogram.name}_count`,\n\t\t\t\tundefined,\n\t\t\t\td.data.labels,\n\t\t\t),\n\t\t);\n\t\treturn acc;\n\t};\n}\n\nfunction splayLabels(bucket) {\n\tconst { sharedLabels, labels, ...newBucket } = bucket;\n\tfor (const label of Object.keys(sharedLabels)) {\n\t\tlabels[label] = sharedLabels[label];\n\t}\n\tnewBucket.labels = labels;\n\treturn newBucket;\n}\n\nmodule.exports = Histogram;\n","\nfunction TreeBase() {}\n\n// removes all nodes from the tree\nTreeBase.prototype.clear = function() {\n this._root = null;\n this.size = 0;\n};\n\n// returns node data if found, null otherwise\nTreeBase.prototype.find = function(data) {\n var res = this._root;\n\n while(res !== null) {\n var c = this._comparator(data, res.data);\n if(c === 0) {\n return res.data;\n }\n else {\n res = res.get_child(c > 0);\n }\n }\n\n return null;\n};\n\n// returns iterator to node if found, null otherwise\nTreeBase.prototype.findIter = function(data) {\n var res = this._root;\n var iter = this.iterator();\n\n while(res !== null) {\n var c = this._comparator(data, res.data);\n if(c === 0) {\n iter._cursor = res;\n return iter;\n }\n else {\n iter._ancestors.push(res);\n res = res.get_child(c > 0);\n }\n }\n\n return null;\n};\n\n// Returns an iterator to the tree node at or immediately after the item\nTreeBase.prototype.lowerBound = function(item) {\n var cur = this._root;\n var iter = this.iterator();\n var cmp = this._comparator;\n\n while(cur !== null) {\n var c = cmp(item, cur.data);\n if(c === 0) {\n iter._cursor = cur;\n return iter;\n }\n iter._ancestors.push(cur);\n cur = cur.get_child(c > 0);\n }\n\n for(var i=iter._ancestors.length - 1; i >= 0; --i) {\n cur = iter._ancestors[i];\n if(cmp(item, cur.data) < 0) {\n iter._cursor = cur;\n iter._ancestors.length = i;\n return iter;\n }\n }\n\n iter._ancestors.length = 0;\n return iter;\n};\n\n// Returns an iterator to the tree node immediately after the item\nTreeBase.prototype.upperBound = function(item) {\n var iter = this.lowerBound(item);\n var cmp = this._comparator;\n\n while(iter.data() !== null && cmp(iter.data(), item) === 0) {\n iter.next();\n }\n\n return iter;\n};\n\n// returns null if tree is empty\nTreeBase.prototype.min = function() {\n var res = this._root;\n if(res === null) {\n return null;\n }\n\n while(res.left !== null) {\n res = res.left;\n }\n\n return res.data;\n};\n\n// returns null if tree is empty\nTreeBase.prototype.max = function() {\n var res = this._root;\n if(res === null) {\n return null;\n }\n\n while(res.right !== null) {\n res = res.right;\n }\n\n return res.data;\n};\n\n// returns a null iterator\n// call next() or prev() to point to an element\nTreeBase.prototype.iterator = function() {\n return new Iterator(this);\n};\n\n// calls cb on each node's data, in order\nTreeBase.prototype.each = function(cb) {\n var it=this.iterator(), data;\n while((data = it.next()) !== null) {\n if(cb(data) === false) {\n return;\n }\n }\n};\n\n// calls cb on each node's data, in reverse order\nTreeBase.prototype.reach = function(cb) {\n var it=this.iterator(), data;\n while((data = it.prev()) !== null) {\n if(cb(data) === false) {\n return;\n }\n }\n};\n\n\nfunction Iterator(tree) {\n this._tree = tree;\n this._ancestors = [];\n this._cursor = null;\n}\n\nIterator.prototype.data = function() {\n return this._cursor !== null ? this._cursor.data : null;\n};\n\n// if null-iterator, returns first node\n// otherwise, returns next node\nIterator.prototype.next = function() {\n if(this._cursor === null) {\n var root = this._tree._root;\n if(root !== null) {\n this._minNode(root);\n }\n }\n else {\n if(this._cursor.right === null) {\n // no greater node in subtree, go up to parent\n // if coming from a right child, continue up the stack\n var save;\n do {\n save = this._cursor;\n if(this._ancestors.length) {\n this._cursor = this._ancestors.pop();\n }\n else {\n this._cursor = null;\n break;\n }\n } while(this._cursor.right === save);\n }\n else {\n // get the next node from the subtree\n this._ancestors.push(this._cursor);\n this._minNode(this._cursor.right);\n }\n }\n return this._cursor !== null ? this._cursor.data : null;\n};\n\n// if null-iterator, returns last node\n// otherwise, returns previous node\nIterator.prototype.prev = function() {\n if(this._cursor === null) {\n var root = this._tree._root;\n if(root !== null) {\n this._maxNode(root);\n }\n }\n else {\n if(this._cursor.left === null) {\n var save;\n do {\n save = this._cursor;\n if(this._ancestors.length) {\n this._cursor = this._ancestors.pop();\n }\n else {\n this._cursor = null;\n break;\n }\n } while(this._cursor.left === save);\n }\n else {\n this._ancestors.push(this._cursor);\n this._maxNode(this._cursor.left);\n }\n }\n return this._cursor !== null ? this._cursor.data : null;\n};\n\nIterator.prototype._minNode = function(start) {\n while(start.left !== null) {\n this._ancestors.push(start);\n start = start.left;\n }\n this._cursor = start;\n};\n\nIterator.prototype._maxNode = function(start) {\n while(start.right !== null) {\n this._ancestors.push(start);\n start = start.right;\n }\n this._cursor = start;\n};\n\nmodule.exports = TreeBase;\n\n","\nvar TreeBase = require('./treebase');\n\nfunction Node(data) {\n this.data = data;\n this.left = null;\n this.right = null;\n this.red = true;\n}\n\nNode.prototype.get_child = function(dir) {\n return dir ? this.right : this.left;\n};\n\nNode.prototype.set_child = function(dir, val) {\n if(dir) {\n this.right = val;\n }\n else {\n this.left = val;\n }\n};\n\nfunction RBTree(comparator) {\n this._root = null;\n this._comparator = comparator;\n this.size = 0;\n}\n\nRBTree.prototype = new TreeBase();\n\n// returns true if inserted, false if duplicate\nRBTree.prototype.insert = function(data) {\n var ret = false;\n\n if(this._root === null) {\n // empty tree\n this._root = new Node(data);\n ret = true;\n this.size++;\n }\n else {\n var head = new Node(undefined); // fake tree root\n\n var dir = 0;\n var last = 0;\n\n // setup\n var gp = null; // grandparent\n var ggp = head; // grand-grand-parent\n var p = null; // parent\n var node = this._root;\n ggp.right = this._root;\n\n // search down\n while(true) {\n if(node === null) {\n // insert new node at the bottom\n node = new Node(data);\n p.set_child(dir, node);\n ret = true;\n this.size++;\n }\n else if(is_red(node.left) && is_red(node.right)) {\n // color flip\n node.red = true;\n node.left.red = false;\n node.right.red = false;\n }\n\n // fix red violation\n if(is_red(node) && is_red(p)) {\n var dir2 = ggp.right === gp;\n\n if(node === p.get_child(last)) {\n ggp.set_child(dir2, single_rotate(gp, !last));\n }\n else {\n ggp.set_child(dir2, double_rotate(gp, !last));\n }\n }\n\n var cmp = this._comparator(node.data, data);\n\n // stop if found\n if(cmp === 0) {\n break;\n }\n\n last = dir;\n dir = cmp < 0;\n\n // update helpers\n if(gp !== null) {\n ggp = gp;\n }\n gp = p;\n p = node;\n node = node.get_child(dir);\n }\n\n // update root\n this._root = head.right;\n }\n\n // make root black\n this._root.red = false;\n\n return ret;\n};\n\n// returns true if removed, false if not found\nRBTree.prototype.remove = function(data) {\n if(this._root === null) {\n return false;\n }\n\n var head = new Node(undefined); // fake tree root\n var node = head;\n node.right = this._root;\n var p = null; // parent\n var gp = null; // grand parent\n var found = null; // found item\n var dir = 1;\n\n while(node.get_child(dir) !== null) {\n var last = dir;\n\n // update helpers\n gp = p;\n p = node;\n node = node.get_child(dir);\n\n var cmp = this._comparator(data, node.data);\n\n dir = cmp > 0;\n\n // save found node\n if(cmp === 0) {\n found = node;\n }\n\n // push the red node down\n if(!is_red(node) && !is_red(node.get_child(dir))) {\n if(is_red(node.get_child(!dir))) {\n var sr = single_rotate(node, dir);\n p.set_child(last, sr);\n p = sr;\n }\n else if(!is_red(node.get_child(!dir))) {\n var sibling = p.get_child(!last);\n if(sibling !== null) {\n if(!is_red(sibling.get_child(!last)) && !is_red(sibling.get_child(last))) {\n // color flip\n p.red = false;\n sibling.red = true;\n node.red = true;\n }\n else {\n var dir2 = gp.right === p;\n\n if(is_red(sibling.get_child(last))) {\n gp.set_child(dir2, double_rotate(p, last));\n }\n else if(is_red(sibling.get_child(!last))) {\n gp.set_child(dir2, single_rotate(p, last));\n }\n\n // ensure correct coloring\n var gpc = gp.get_child(dir2);\n gpc.red = true;\n node.red = true;\n gpc.left.red = false;\n gpc.right.red = false;\n }\n }\n }\n }\n }\n\n // replace and remove if found\n if(found !== null) {\n found.data = node.data;\n p.set_child(p.right === node, node.get_child(node.left === null));\n this.size--;\n }\n\n // update root and make it black\n this._root = head.right;\n if(this._root !== null) {\n this._root.red = false;\n }\n\n return found !== null;\n};\n\nfunction is_red(node) {\n return node !== null && node.red;\n}\n\nfunction single_rotate(root, dir) {\n var save = root.get_child(!dir);\n\n root.set_child(!dir, save.get_child(dir));\n save.set_child(dir, root);\n\n root.red = true;\n save.red = false;\n\n return save;\n}\n\nfunction double_rotate(root, dir) {\n root.set_child(!dir, single_rotate(root.get_child(!dir), !dir));\n return single_rotate(root, dir);\n}\n\nmodule.exports = RBTree;\n","\nvar TreeBase = require('./treebase');\n\nfunction Node(data) {\n this.data = data;\n this.left = null;\n this.right = null;\n}\n\nNode.prototype.get_child = function(dir) {\n return dir ? this.right : this.left;\n};\n\nNode.prototype.set_child = function(dir, val) {\n if(dir) {\n this.right = val;\n }\n else {\n this.left = val;\n }\n};\n\nfunction BinTree(comparator) {\n this._root = null;\n this._comparator = comparator;\n this.size = 0;\n}\n\nBinTree.prototype = new TreeBase();\n\n// returns true if inserted, false if duplicate\nBinTree.prototype.insert = function(data) {\n if(this._root === null) {\n // empty tree\n this._root = new Node(data);\n this.size++;\n return true;\n }\n\n var dir = 0;\n\n // setup\n var p = null; // parent\n var node = this._root;\n\n // search down\n while(true) {\n if(node === null) {\n // insert new node at the bottom\n node = new Node(data);\n p.set_child(dir, node);\n ret = true;\n this.size++;\n return true;\n }\n\n // stop if found\n if(this._comparator(node.data, data) === 0) {\n return false;\n }\n\n dir = this._comparator(node.data, data) < 0;\n\n // update helpers\n p = node;\n node = node.get_child(dir);\n }\n};\n\n// returns true if removed, false if not found\nBinTree.prototype.remove = function(data) {\n if(this._root === null) {\n return false;\n }\n\n var head = new Node(undefined); // fake tree root\n var node = head;\n node.right = this._root;\n var p = null; // parent\n var found = null; // found item\n var dir = 1;\n\n while(node.get_child(dir) !== null) {\n p = node;\n node = node.get_child(dir);\n var cmp = this._comparator(data, node.data);\n dir = cmp > 0;\n\n if(cmp === 0) {\n found = node;\n }\n }\n\n if(found !== null) {\n found.data = node.data;\n p.set_child(p.right === node, node.get_child(node.left === null));\n\n this._root = head.right;\n this.size--;\n return true;\n }\n else {\n return false;\n }\n};\n\nmodule.exports = BinTree;\n\n","module.exports = {\n RBTree: require('./lib/rbtree'),\n BinTree: require('./lib/bintree')\n};\n","//\n// TDigest:\n//\n// approximate distribution percentiles from a stream of reals\n//\nvar RBTree = require('bintrees').RBTree;\n\nfunction TDigest(delta, K, CX) {\n // allocate a TDigest structure.\n //\n // delta is the compression factor, the max fraction of mass that\n // can be owned by one centroid (bigger, up to 1.0, means more\n // compression). delta=false switches off TDigest behavior and treats\n // the distribution as discrete, with no merging and exact values\n // reported.\n //\n // K is a size threshold that triggers recompression as the TDigest\n // grows during input. (Set it to 0 to disable automatic recompression)\n //\n // CX specifies how often to update cached cumulative totals used\n // for quantile estimation during ingest (see cumulate()). Set to\n // 0 to use exact quantiles for each new point.\n //\n this.discrete = (delta === false);\n this.delta = delta || 0.01;\n this.K = (K === undefined) ? 25 : K;\n this.CX = (CX === undefined) ? 1.1 : CX;\n this.centroids = new RBTree(compare_centroid_means);\n this.nreset = 0;\n this.reset();\n}\n\nTDigest.prototype.reset = function() {\n // prepare to digest new points.\n //\n this.centroids.clear();\n this.n = 0;\n this.nreset += 1;\n this.last_cumulate = 0;\n};\n\nTDigest.prototype.size = function() {\n return this.centroids.size;\n};\n\nTDigest.prototype.toArray = function(everything) {\n // return {mean,n} of centroids as an array ordered by mean.\n //\n var result = [];\n if (everything) {\n this._cumulate(true); // be sure cumns are exact\n this.centroids.each(function(c) { result.push(c); });\n } else {\n this.centroids.each(function(c) { result.push({mean:c.mean, n:c.n}); });\n }\n return result;\n};\n\nTDigest.prototype.summary = function() {\n var approx = (this.discrete) ? \"exact \" : \"approximating \";\n var s = [approx + this.n + \" samples using \" + this.size() + \" centroids\",\n \"min = \"+this.percentile(0),\n \"Q1 = \"+this.percentile(0.25),\n \"Q2 = \"+this.percentile(0.5),\n \"Q3 = \"+this.percentile(0.75),\n \"max = \"+this.percentile(1.0)];\n return s.join('\\n');\n};\n\nfunction compare_centroid_means(a, b) {\n // order two centroids by mean.\n //\n return (a.mean > b.mean) ? 1 : (a.mean < b.mean) ? -1 : 0;\n}\n\nfunction compare_centroid_mean_cumns(a, b) {\n // order two centroids by mean_cumn.\n //\n return (a.mean_cumn - b.mean_cumn);\n}\n\nTDigest.prototype.push = function(x, n) {\n // incorporate value or array of values x, having count n into the\n // TDigest. n defaults to 1.\n //\n n = n || 1;\n x = Array.isArray(x) ? x : [x];\n for (var i = 0 ; i < x.length ; i++) {\n this._digest(x[i], n);\n }\n};\n\nTDigest.prototype.push_centroid = function(c) {\n // incorporate centroid or array of centroids c\n //\n c = Array.isArray(c) ? c : [c];\n for (var i = 0 ; i < c.length ; i++) {\n this._digest(c[i].mean, c[i].n);\n }\n};\n\nTDigest.prototype._cumulate = function(exact) {\n // update cumulative counts for each centroid\n //\n // exact: falsey means only cumulate after sufficient\n // growth. During ingest, these counts are used as quantile\n // estimates, and they work well even when somewhat out of\n // date. (this is a departure from the publication, you may set CX\n // to 0 to disable).\n //\n if (this.n === this.last_cumulate ||\n !exact && this.CX && this.CX > (this.n / this.last_cumulate)) {\n return;\n }\n var cumn = 0;\n this.centroids.each(function(c) {\n c.mean_cumn = cumn + c.n / 2; // half of n at the mean\n cumn = c.cumn = cumn + c.n;\n });\n this.n = this.last_cumulate = cumn;\n};\n\nTDigest.prototype.find_nearest = function(x) {\n // find the centroid closest to x. The assumption of\n // unique means and a unique nearest centroid departs from the\n // paper, see _digest() below\n //\n if (this.size() === 0) {\n return null;\n }\n var iter = this.centroids.lowerBound({mean:x}); // x <= iter || iter==null\n var c = (iter.data() === null) ? iter.prev() : iter.data();\n if (c.mean === x || this.discrete) {\n return c; // c is either x or a neighbor (discrete: no distance func)\n }\n var prev = iter.prev();\n if (prev && Math.abs(prev.mean - x) < Math.abs(c.mean - x)) {\n return prev;\n } else {\n return c;\n }\n};\n\nTDigest.prototype._new_centroid = function(x, n, cumn) {\n // create and insert a new centroid into the digest (don't update\n // cumulatives).\n //\n var c = {mean:x, n:n, cumn:cumn};\n this.centroids.insert(c);\n this.n += n;\n return c;\n};\n\nTDigest.prototype._addweight = function(nearest, x, n) {\n // add weight at location x to nearest centroid. adding x to\n // nearest will not shift its relative position in the tree and\n // require reinsertion.\n //\n if (x !== nearest.mean) {\n nearest.mean += n * (x - nearest.mean) / (nearest.n + n);\n }\n nearest.cumn += n;\n nearest.mean_cumn += n / 2;\n nearest.n += n;\n this.n += n;\n};\n\nTDigest.prototype._digest = function(x, n) {\n // incorporate value x, having count n into the TDigest.\n //\n var min = this.centroids.min();\n var max = this.centroids.max();\n var nearest = this.find_nearest(x);\n if (nearest && nearest.mean === x) {\n // accumulate exact matches into the centroid without\n // limit. this is a departure from the paper, made so\n // centroids remain unique and code can be simple.\n this._addweight(nearest, x, n);\n } else if (nearest === min) {\n this._new_centroid(x, n, 0); // new point around min boundary\n } else if (nearest === max ) {\n this._new_centroid(x, n, this.n); // new point around max boundary\n } else if (this.discrete) {\n this._new_centroid(x, n, nearest.cumn); // never merge\n } else {\n // conider a merge based on nearest centroid's capacity. if\n // there's not room for all of n, don't bother merging any of\n // it into nearest, as we'll have to make a new centroid\n // anyway for the remainder (departure from the paper).\n var p = nearest.mean_cumn / this.n;\n var max_n = Math.floor(4 * this.n * this.delta * p * (1 - p));\n if (max_n - nearest.n >= n) {\n this._addweight(nearest, x, n);\n } else {\n this._new_centroid(x, n, nearest.cumn);\n }\n }\n this._cumulate(false);\n if (!this.discrete && this.K && this.size() > this.K / this.delta) {\n // re-process the centroids and hope for some compression.\n this.compress();\n }\n};\n\nTDigest.prototype.bound_mean = function(x) {\n // find centroids lower and upper such that lower.mean < x <\n // upper.mean or lower.mean === x === upper.mean. Don't call\n // this for x out of bounds.\n //\n var iter = this.centroids.upperBound({mean:x}); // x < iter\n var lower = iter.prev(); // lower <= x\n var upper = (lower.mean === x) ? lower : iter.next();\n return [lower, upper];\n};\n\nTDigest.prototype.p_rank = function(x_or_xlist) {\n // return approximate percentile-ranks (0..1) for data value x.\n // or list of x. calculated according to\n // https://en.wikipedia.org/wiki/Percentile_rank\n //\n // (Note that in continuous mode, boundary sample values will\n // report half their centroid weight inward from 0/1 as the\n // percentile-rank. X values outside the observed range return\n // 0/1)\n //\n // this triggers cumulate() if cumn's are out of date.\n //\n var xs = Array.isArray(x_or_xlist) ? x_or_xlist : [x_or_xlist];\n var ps = xs.map(this._p_rank, this);\n return Array.isArray(x_or_xlist) ? ps : ps[0];\n};\n\nTDigest.prototype._p_rank = function(x) {\n if (this.size() === 0) {\n return undefined;\n } else if (x < this.centroids.min().mean) {\n return 0.0;\n } else if (x > this.centroids.max().mean) {\n return 1.0;\n }\n // find centroids that bracket x and interpolate x's cumn from\n // their cumn's.\n this._cumulate(true); // be sure cumns are exact\n var bound = this.bound_mean(x);\n var lower = bound[0], upper = bound[1];\n if (this.discrete) {\n return lower.cumn / this.n;\n } else {\n var cumn = lower.mean_cumn;\n if (lower !== upper) {\n cumn += (x - lower.mean) * (upper.mean_cumn - lower.mean_cumn) / (upper.mean - lower.mean);\n }\n return cumn / this.n;\n }\n};\n\nTDigest.prototype.bound_mean_cumn = function(cumn) {\n // find centroids lower and upper such that lower.mean_cumn < x <\n // upper.mean_cumn or lower.mean_cumn === x === upper.mean_cumn. Don't call\n // this for cumn out of bounds.\n //\n // XXX because mean and mean_cumn give rise to the same sort order\n // (up to identical means), use the mean rbtree for our search.\n this.centroids._comparator = compare_centroid_mean_cumns;\n var iter = this.centroids.upperBound({mean_cumn:cumn}); // cumn < iter\n this.centroids._comparator = compare_centroid_means;\n var lower = iter.prev(); // lower <= cumn\n var upper = (lower && lower.mean_cumn === cumn) ? lower : iter.next();\n return [lower, upper];\n};\n\nTDigest.prototype.percentile = function(p_or_plist) {\n // for percentage p (0..1), or for each p in a list of ps, return\n // the smallest data value q at which at least p percent of the\n // observations <= q.\n //\n // for discrete distributions, this selects q using the Nearest\n // Rank Method\n // (https://en.wikipedia.org/wiki/Percentile#The_Nearest_Rank_method)\n // (in scipy, same as percentile(...., interpolation='higher')\n //\n // for continuous distributions, interpolates data values between\n // count-weighted bracketing means.\n //\n // this triggers cumulate() if cumn's are out of date.\n //\n var ps = Array.isArray(p_or_plist) ? p_or_plist : [p_or_plist];\n var qs = ps.map(this._percentile, this);\n return Array.isArray(p_or_plist) ? qs : qs[0];\n};\n\nTDigest.prototype._percentile = function(p) {\n if (this.size() === 0) {\n return undefined;\n }\n this._cumulate(true); // be sure cumns are exact\n var h = this.n * p;\n var bound = this.bound_mean_cumn(h);\n var lower = bound[0], upper = bound[1];\n\n if (upper === lower || lower === null || upper === null) {\n return (lower || upper).mean;\n } else if (!this.discrete) {\n return lower.mean + (h - lower.mean_cumn) * (upper.mean - lower.mean) / (upper.mean_cumn - lower.mean_cumn);\n } else if (h <= lower.cumn) {\n return lower.mean;\n } else {\n return upper.mean;\n }\n};\n\nfunction pop_random(choices) {\n // remove and return an item randomly chosen from the array of choices\n // (mutates choices)\n //\n var idx = Math.floor(Math.random() * choices.length);\n return choices.splice(idx, 1)[0];\n}\n\nTDigest.prototype.compress = function() {\n // TDigests experience worst case compression (none) when input\n // increases monotonically. Improve on any bad luck by\n // reconsuming digest centroids as if they were weighted points\n // while shuffling their order (and hope for the best).\n //\n if (this.compressing) {\n return;\n }\n var points = this.toArray();\n this.reset();\n this.compressing = true;\n while (points.length > 0) {\n this.push_centroid(pop_random(points));\n }\n this._cumulate(true);\n this.compressing = false;\n};\n\nfunction Digest(config) {\n // allocate a distribution digest structure. This is an extension\n // of a TDigest structure that starts in exact histogram (discrete)\n // mode, and automatically switches to TDigest mode for large\n // samples that appear to be from a continuous distribution.\n //\n this.config = config || {};\n this.mode = this.config.mode || 'auto'; // disc, cont, auto\n TDigest.call(this, this.mode === 'cont' ? config.delta : false);\n this.digest_ratio = this.config.ratio || 0.9;\n this.digest_thresh = this.config.thresh || 1000;\n this.n_unique = 0;\n}\nDigest.prototype = Object.create(TDigest.prototype);\nDigest.prototype.constructor = Digest;\n\nDigest.prototype.push = function(x_or_xlist) {\n TDigest.prototype.push.call(this, x_or_xlist);\n this.check_continuous();\n};\n\nDigest.prototype._new_centroid = function(x, n, cumn) {\n this.n_unique += 1;\n TDigest.prototype._new_centroid.call(this, x, n, cumn);\n};\n\nDigest.prototype._addweight = function(nearest, x, n) {\n if (nearest.n === 1) {\n this.n_unique -= 1;\n }\n TDigest.prototype._addweight.call(this, nearest, x, n);\n};\n\nDigest.prototype.check_continuous = function() {\n // while in 'auto' mode, if there are many unique elements, assume\n // they are from a continuous distribution and switch to 'cont'\n // mode (tdigest behavior). Return true on transition from\n // disctete to continuous.\n if (this.mode !== 'auto' || this.size() < this.digest_thresh) {\n return false;\n }\n if (this.n_unique / this.size() > this.digest_ratio) {\n this.mode = 'cont';\n this.discrete = false;\n this.delta = this.config.delta || 0.01;\n this.compress();\n return true;\n }\n return false;\n};\n\nmodule.exports = {\n 'TDigest': TDigest,\n 'Digest': Digest\n};\n","'use strict';\n\nconst { TDigest } = require('tdigest');\n\nclass TimeWindowQuantiles {\n\tconstructor(maxAgeSeconds, ageBuckets) {\n\t\tthis.maxAgeSeconds = maxAgeSeconds || 0;\n\t\tthis.ageBuckets = ageBuckets || 0;\n\n\t\tthis.shouldRotate = maxAgeSeconds && ageBuckets;\n\n\t\tthis.ringBuffer = Array(ageBuckets).fill(new TDigest());\n\t\tthis.currentBuffer = 0;\n\n\t\tthis.lastRotateTimestampMillis = Date.now();\n\t\tthis.durationBetweenRotatesMillis =\n\t\t\t(maxAgeSeconds * 1000) / ageBuckets || Infinity;\n\t}\n\n\tsize() {\n\t\tconst bucket = rotate.call(this);\n\t\treturn bucket.size();\n\t}\n\n\tpercentile(quantile) {\n\t\tconst bucket = rotate.call(this);\n\t\treturn bucket.percentile(quantile);\n\t}\n\n\tpush(value) {\n\t\trotate.call(this);\n\t\tthis.ringBuffer.forEach(bucket => {\n\t\t\tbucket.push(value);\n\t\t});\n\t}\n\n\treset() {\n\t\tthis.ringBuffer.forEach(bucket => {\n\t\t\tbucket.reset();\n\t\t});\n\t}\n\n\tcompress() {\n\t\tthis.ringBuffer.forEach(bucket => {\n\t\t\tbucket.compress();\n\t\t});\n\t}\n}\n\nfunction rotate() {\n\tlet timeSinceLastRotateMillis = Date.now() - this.lastRotateTimestampMillis;\n\twhile (\n\t\ttimeSinceLastRotateMillis > this.durationBetweenRotatesMillis &&\n\t\tthis.shouldRotate\n\t) {\n\t\tthis.ringBuffer[this.currentBuffer] = new TDigest();\n\n\t\tif (++this.currentBuffer >= this.ringBuffer.length) {\n\t\t\tthis.currentBuffer = 0;\n\t\t}\n\t\ttimeSinceLastRotateMillis -= this.durationBetweenRotatesMillis;\n\t\tthis.lastRotateTimestampMillis += this.durationBetweenRotatesMillis;\n\t}\n\treturn this.ringBuffer[this.currentBuffer];\n}\n\nmodule.exports = TimeWindowQuantiles;\n","/**\n * Summary\n */\n'use strict';\n\nconst util = require('util');\nconst { getLabels, hashObject, removeLabels } = require('./util');\nconst { validateLabel } = require('./validation');\nconst { Metric } = require('./metric');\nconst timeWindowQuantiles = require('./timeWindowQuantiles');\n\nconst DEFAULT_COMPRESS_COUNT = 1000; // every 1000 measurements\n\nclass Summary extends Metric {\n\tconstructor(config) {\n\t\tsuper(config, {\n\t\t\tpercentiles: [0.01, 0.05, 0.5, 0.9, 0.95, 0.99, 0.999],\n\t\t\tcompressCount: DEFAULT_COMPRESS_COUNT,\n\t\t\thashMap: {},\n\t\t});\n\n\t\tthis.type = 'summary';\n\n\t\tfor (const label of this.labelNames) {\n\t\t\tif (label === 'quantile')\n\t\t\t\tthrow new Error('quantile is a reserved label keyword');\n\t\t}\n\n\t\tif (this.labelNames.length === 0) {\n\t\t\tthis.hashMap = {\n\t\t\t\t[hashObject({})]: {\n\t\t\t\t\tlabels: {},\n\t\t\t\t\ttd: new timeWindowQuantiles(this.maxAgeSeconds, this.ageBuckets),\n\t\t\t\t\tcount: 0,\n\t\t\t\t\tsum: 0,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\t/**\n\t * Observe a value\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @param {Number} value - Value to observe\n\t * @returns {void}\n\t */\n\tobserve(labels, value) {\n\t\tobserve.call(this, labels === 0 ? 0 : labels || {})(value);\n\t}\n\n\tasync get() {\n\t\tif (this.collect) {\n\t\t\tconst v = this.collect();\n\t\t\tif (v instanceof Promise) await v;\n\t\t}\n\t\tconst hashKeys = Object.keys(this.hashMap);\n\t\tconst values = [];\n\n\t\thashKeys.forEach(hashKey => {\n\t\t\tconst s = this.hashMap[hashKey];\n\t\t\tif (s) {\n\t\t\t\tif (this.pruneAgedBuckets && s.td.size() === 0) {\n\t\t\t\t\tdelete this.hashMap[hashKey];\n\t\t\t\t} else {\n\t\t\t\t\textractSummariesForExport(s, this.percentiles).forEach(v => {\n\t\t\t\t\t\tvalues.push(v);\n\t\t\t\t\t});\n\t\t\t\t\tvalues.push(getSumForExport(s, this));\n\t\t\t\t\tvalues.push(getCountForExport(s, this));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\thelp: this.help,\n\t\t\ttype: this.type,\n\t\t\tvalues,\n\t\t\taggregator: this.aggregator,\n\t\t};\n\t}\n\n\treset() {\n\t\tconst data = Object.values(this.hashMap);\n\t\tdata.forEach(s => {\n\t\t\ts.td.reset();\n\t\t\ts.count = 0;\n\t\t\ts.sum = 0;\n\t\t});\n\t}\n\n\t/**\n\t * Start a timer that could be used to logging durations\n\t * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep\n\t * @returns {function} - Function to invoke when you want to stop the timer and observe the duration in seconds\n\t * @example\n\t * var end = summary.startTimer();\n\t * makeExpensiveXHRRequest(function(err, res) {\n\t *\tend(); //Observe the duration of expensiveXHRRequest\n\t * });\n\t */\n\tstartTimer(labels) {\n\t\treturn startTimer.call(this, labels)();\n\t}\n\n\tlabels(...args) {\n\t\tconst labels = getLabels(this.labelNames, args);\n\t\tvalidateLabel(this.labelNames, labels);\n\t\treturn {\n\t\t\tobserve: observe.call(this, labels),\n\t\t\tstartTimer: startTimer.call(this, labels),\n\t\t};\n\t}\n\n\tremove(...args) {\n\t\tconst labels = getLabels(this.labelNames, args);\n\t\tvalidateLabel(this.labelNames, labels);\n\t\tremoveLabels.call(this, this.hashMap, labels, this.sortedLabelNames);\n\t}\n}\n\nfunction extractSummariesForExport(summaryOfLabels, percentiles) {\n\tsummaryOfLabels.td.compress();\n\n\treturn percentiles.map(percentile => {\n\t\tconst percentileValue = summaryOfLabels.td.percentile(percentile);\n\t\treturn {\n\t\t\tlabels: Object.assign({ quantile: percentile }, summaryOfLabels.labels),\n\t\t\tvalue: percentileValue ? percentileValue : 0,\n\t\t};\n\t});\n}\n\nfunction getCountForExport(value, summary) {\n\treturn {\n\t\tmetricName: `${summary.name}_count`,\n\t\tlabels: value.labels,\n\t\tvalue: value.count,\n\t};\n}\n\nfunction getSumForExport(value, summary) {\n\treturn {\n\t\tmetricName: `${summary.name}_sum`,\n\t\tlabels: value.labels,\n\t\tvalue: value.sum,\n\t};\n}\n\nfunction startTimer(startLabels) {\n\treturn () => {\n\t\tconst start = process.hrtime();\n\t\treturn endLabels => {\n\t\t\tconst delta = process.hrtime(start);\n\t\t\tconst value = delta[0] + delta[1] / 1e9;\n\t\t\tthis.observe(Object.assign({}, startLabels, endLabels), value);\n\t\t\treturn value;\n\t\t};\n\t};\n}\n\nfunction observe(labels) {\n\treturn value => {\n\t\tconst labelValuePair = convertLabelsAndValues(labels, value);\n\n\t\tvalidateLabel(this.labelNames, labels);\n\t\tif (!Number.isFinite(labelValuePair.value)) {\n\t\t\tthrow new TypeError(\n\t\t\t\t`Value is not a valid number: ${util.format(labelValuePair.value)}`,\n\t\t\t);\n\t\t}\n\n\t\tconst hash = hashObject(labelValuePair.labels, this.sortedLabelNames);\n\t\tlet summaryOfLabel = this.hashMap[hash];\n\t\tif (!summaryOfLabel) {\n\t\t\tsummaryOfLabel = {\n\t\t\t\tlabels: labelValuePair.labels,\n\t\t\t\ttd: new timeWindowQuantiles(this.maxAgeSeconds, this.ageBuckets),\n\t\t\t\tcount: 0,\n\t\t\t\tsum: 0,\n\t\t\t};\n\t\t}\n\n\t\tsummaryOfLabel.td.push(labelValuePair.value);\n\t\tsummaryOfLabel.count++;\n\t\tif (summaryOfLabel.count % this.compressCount === 0) {\n\t\t\tsummaryOfLabel.td.compress();\n\t\t}\n\t\tsummaryOfLabel.sum += labelValuePair.value;\n\t\tthis.hashMap[hash] = summaryOfLabel;\n\t};\n}\n\nfunction convertLabelsAndValues(labels, value) {\n\tif (value === undefined) {\n\t\treturn {\n\t\t\tvalue: labels,\n\t\t\tlabels: {},\n\t\t};\n\t}\n\n\treturn {\n\t\tlabels,\n\t\tvalue,\n\t};\n}\n\nmodule.exports = Summary;\n","'use strict';\n\nconst url = require('url');\nconst http = require('http');\nconst https = require('https');\nconst { gzipSync } = require('zlib');\nconst { globalRegistry } = require('./registry');\n\nclass Pushgateway {\n\tconstructor(gatewayUrl, options, registry) {\n\t\tif (!registry) {\n\t\t\tregistry = globalRegistry;\n\t\t}\n\t\tthis.registry = registry;\n\t\tthis.gatewayUrl = gatewayUrl;\n\t\tconst { requireJobName, ...requestOptions } = {\n\t\t\trequireJobName: true,\n\t\t\t...options,\n\t\t};\n\t\tthis.requireJobName = requireJobName;\n\t\tthis.requestOptions = requestOptions;\n\t}\n\n\tpushAdd(params = {}) {\n\t\tif (this.requireJobName && !params.jobName) {\n\t\t\tthrow new Error('Missing jobName parameter');\n\t\t}\n\n\t\treturn useGateway.call(this, 'POST', params.jobName, params.groupings);\n\t}\n\n\tpush(params = {}) {\n\t\tif (this.requireJobName && !params.jobName) {\n\t\t\tthrow new Error('Missing jobName parameter');\n\t\t}\n\n\t\treturn useGateway.call(this, 'PUT', params.jobName, params.groupings);\n\t}\n\n\tdelete(params = {}) {\n\t\tif (this.requireJobName && !params.jobName) {\n\t\t\tthrow new Error('Missing jobName parameter');\n\t\t}\n\n\t\treturn useGateway.call(this, 'DELETE', params.jobName, params.groupings);\n\t}\n}\nasync function useGateway(method, job, groupings) {\n\t// `URL` first added in v6.13.0\n\t// eslint-disable-next-line n/no-deprecated-api\n\tconst gatewayUrlParsed = url.parse(this.gatewayUrl);\n\tconst gatewayUrlPath =\n\t\tgatewayUrlParsed.pathname && gatewayUrlParsed.pathname !== '/'\n\t\t\t? gatewayUrlParsed.pathname\n\t\t\t: '';\n\tconst jobPath = job\n\t\t? `/job/${encodeURIComponent(job)}${generateGroupings(groupings)}`\n\t\t: '';\n\tconst path = `${gatewayUrlPath}/metrics${jobPath}`;\n\n\t// eslint-disable-next-line n/no-deprecated-api\n\tconst target = url.resolve(this.gatewayUrl, path);\n\t// eslint-disable-next-line n/no-deprecated-api\n\tconst requestParams = url.parse(target);\n\tconst httpModule = isHttps(requestParams.href) ? https : http;\n\tconst options = Object.assign(requestParams, this.requestOptions, {\n\t\tmethod,\n\t});\n\n\treturn new Promise((resolve, reject) => {\n\t\tif (method === 'DELETE' && options.headers) {\n\t\t\tdelete options.headers['Content-Encoding'];\n\t\t}\n\t\tconst req = httpModule.request(options, resp => {\n\t\t\tlet body = '';\n\t\t\tresp.setEncoding('utf8');\n\t\t\tresp.on('data', chunk => {\n\t\t\t\tbody += chunk;\n\t\t\t});\n\t\t\tresp.on('end', () => {\n\t\t\t\tif (resp.statusCode >= 400) {\n\t\t\t\t\treject(\n\t\t\t\t\t\tnew Error(`push failed with status ${resp.statusCode}, ${body}`),\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tresolve({ resp, body });\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t\treq.on('error', err => {\n\t\t\treject(err);\n\t\t});\n\n\t\treq.on('timeout', () => {\n\t\t\treq.destroy(new Error('Pushgateway request timed out'));\n\t\t});\n\n\t\tif (method !== 'DELETE') {\n\t\t\tthis.registry\n\t\t\t\t.metrics()\n\t\t\t\t.then(metrics => {\n\t\t\t\t\tif (\n\t\t\t\t\t\toptions.headers &&\n\t\t\t\t\t\toptions.headers['Content-Encoding'] === 'gzip'\n\t\t\t\t\t) {\n\t\t\t\t\t\tmetrics = gzipSync(metrics);\n\t\t\t\t\t}\n\t\t\t\t\treq.write(metrics);\n\t\t\t\t\treq.end();\n\t\t\t\t})\n\t\t\t\t.catch(err => {\n\t\t\t\t\treject(err);\n\t\t\t\t});\n\t\t} else {\n\t\t\treq.end();\n\t\t}\n\t});\n}\n\nfunction generateGroupings(groupings) {\n\tif (!groupings) {\n\t\treturn '';\n\t}\n\treturn Object.keys(groupings)\n\t\t.map(\n\t\t\tkey =>\n\t\t\t\t`/${encodeURIComponent(key)}/${encodeURIComponent(groupings[key])}`,\n\t\t)\n\t\t.join('');\n}\n\nfunction isHttps(href) {\n\treturn href.search(/^https/) !== -1;\n}\n\nmodule.exports = Pushgateway;\n","'use strict';\n\nexports.linearBuckets = (start, width, count) => {\n\tif (count < 1) {\n\t\tthrow new Error('Linear buckets needs a positive count');\n\t}\n\n\tconst buckets = new Array(count);\n\tfor (let i = 0; i < count; i++) {\n\t\tbuckets[i] = start + i * width;\n\t}\n\treturn buckets;\n};\n\nexports.exponentialBuckets = (start, factor, count) => {\n\tif (start <= 0) {\n\t\tthrow new Error('Exponential buckets needs a positive start');\n\t}\n\tif (count < 1) {\n\t\tthrow new Error('Exponential buckets needs a positive count');\n\t}\n\tif (factor <= 1) {\n\t\tthrow new Error('Exponential buckets needs a factor greater than 1');\n\t}\n\tconst buckets = new Array(count);\n\tfor (let i = 0; i < count; i++) {\n\t\tbuckets[i] = start;\n\t\tstart *= factor;\n\t}\n\treturn buckets;\n};\n","/*\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/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexport var _globalThis = typeof globalThis === 'object' ? globalThis : global;\n//# sourceMappingURL=globalThis.js.map","/*\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 * from './globalThis';\n//# sourceMappingURL=index.js.map","/*\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 * from './node';\n//# sourceMappingURL=index.js.map","/*\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// this is autogenerated file, see scripts/version-update.js\nexport var VERSION = '1.9.0';\n//# sourceMappingURL=version.js.map","/*\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 { VERSION } from '../version';\nvar re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(ownVersion) {\n var acceptedVersions = new Set([ownVersion]);\n var rejectedVersions = new Set();\n var myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return function () { return false; };\n }\n var ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n var globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n var globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport var isCompatible = _makeCompatibilityCheck(VERSION);\n//# sourceMappingURL=semver.js.map","/*\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 { _globalThis } from '../platform';\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\nvar major = VERSION.split('.')[0];\nvar GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\"opentelemetry.js.api.\" + major);\nvar _global = _globalThis;\nexport function registerGlobal(type, instance, diag, allowOverride) {\n var _a;\n if (allowOverride === void 0) { allowOverride = false; }\n var api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n var err = new Error(\"@opentelemetry/api: Attempted duplicate registration of API: \" + type);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n var err = new Error(\"@opentelemetry/api: Registration of version v\" + api.version + \" for \" + type + \" does not match previously registered API v\" + VERSION);\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(\"@opentelemetry/api: Registered a global for \" + type + \" v\" + VERSION + \".\");\n return true;\n}\nexport function getGlobal(type) {\n var _a, _b;\n var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexport function unregisterGlobal(type, diag) {\n diag.debug(\"@opentelemetry/api: Unregistering a global for \" + type + \" v\" + VERSION + \".\");\n var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\n//# sourceMappingURL=global-utils.js.map","/*\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 */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { getGlobal } from '../internal/global-utils';\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nvar DiagComponentLogger = /** @class */ (function () {\n function DiagComponentLogger(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n DiagComponentLogger.prototype.debug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('debug', this._namespace, args);\n };\n DiagComponentLogger.prototype.error = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('error', this._namespace, args);\n };\n DiagComponentLogger.prototype.info = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('info', this._namespace, args);\n };\n DiagComponentLogger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('warn', this._namespace, args);\n };\n DiagComponentLogger.prototype.verbose = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('verbose', this._namespace, args);\n };\n return DiagComponentLogger;\n}());\nexport { DiagComponentLogger };\nfunction logProxy(funcName, namespace, args) {\n var logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n args.unshift(namespace);\n return logger[funcName].apply(logger, __spreadArray([], __read(args), false));\n}\n//# sourceMappingURL=ComponentLogger.js.map","/*\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 * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nexport var DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel || (DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map","/*\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 { DiagLogLevel } from '../types';\nexport function createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n }\n else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n var theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n//# sourceMappingURL=logLevelLogger.js.map","/*\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 */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport { DiagLogLevel, } from '../diag/types';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nvar API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nvar DiagAPI = /** @class */ (function () {\n /**\n * Private internal constructor\n * @private\n */\n function DiagAPI() {\n function _logProxy(funcName) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName].apply(logger, __spreadArray([], __read(args), false));\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n var self = this;\n // DiagAPI specific functions\n var setLogger = function (logger, optionsOrLogLevel) {\n var _a, _b, _c;\n if (optionsOrLogLevel === void 0) { optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }; }\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n var oldLogger = getGlobal('diag');\n var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';\n oldLogger.warn(\"Current logger will be overwritten from \" + stack);\n newLogger.warn(\"Current logger will overwrite one already registered from \" + stack);\n }\n return registerGlobal('diag', newLogger, self, true);\n };\n self.setLogger = setLogger;\n self.disable = function () {\n unregisterGlobal(API_NAME, self);\n };\n self.createComponentLogger = function (options) {\n return new DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n /** Get the singleton instance of the DiagAPI API */\n DiagAPI.instance = function () {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n };\n return DiagAPI;\n}());\nexport { DiagAPI };\n//# sourceMappingURL=diag.js.map","/*\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 */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nvar BaggageImpl = /** @class */ (function () {\n function BaggageImpl(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n BaggageImpl.prototype.getEntry = function (key) {\n var entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n };\n BaggageImpl.prototype.getAllEntries = function () {\n return Array.from(this._entries.entries()).map(function (_a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return [k, v];\n });\n };\n BaggageImpl.prototype.setEntry = function (key, entry) {\n var newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n };\n BaggageImpl.prototype.removeEntry = function (key) {\n var newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n };\n BaggageImpl.prototype.removeEntries = function () {\n var e_1, _a;\n var keys = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n keys[_i] = arguments[_i];\n }\n var newBaggage = new BaggageImpl(this._entries);\n try {\n for (var keys_1 = __values(keys), keys_1_1 = keys_1.next(); !keys_1_1.done; keys_1_1 = keys_1.next()) {\n var key = keys_1_1.value;\n newBaggage._entries.delete(key);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (keys_1_1 && !keys_1_1.done && (_a = keys_1.return)) _a.call(keys_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return newBaggage;\n };\n BaggageImpl.prototype.clear = function () {\n return new BaggageImpl();\n };\n return BaggageImpl;\n}());\nexport { BaggageImpl };\n//# sourceMappingURL=baggage-impl.js.map","/*\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 * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport var baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n//# sourceMappingURL=symbol.js.map","/*\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 { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nvar diag = DiagAPI.instance();\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(entries) {\n if (entries === void 0) { entries = {}; }\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nexport function baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(\"Cannot create baggage metadata from unknown type: \" + typeof str);\n str = '';\n }\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString: function () {\n return str;\n },\n };\n}\n//# sourceMappingURL=utils.js.map","/*\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/** Get a key to uniquely identify a context value */\nexport function createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nvar BaseContext = /** @class */ (function () {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n function BaseContext(parentContext) {\n // for minification\n var self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = function (key) { return self._currentContext.get(key); };\n self.setValue = function (key, value) {\n var context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = function (key) {\n var context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n return BaseContext;\n}());\n/** The root context is used as the default parent context when there is no active context */\nexport var ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map","/*\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 */\nvar consoleMap = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n */\nvar DiagConsoleLogger = /** @class */ (function () {\n function DiagConsoleLogger() {\n function _consoleFunc(funcName) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (console) {\n // Some environments only expose the console when the F12 developer console is open\n // eslint-disable-next-line no-console\n var theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // Not all environments support all functions\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n // One last final check\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\n }\n }\n };\n }\n for (var i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n return DiagConsoleLogger;\n}());\nexport { DiagConsoleLogger };\n//# sourceMappingURL=consoleLogger.js.map","/*\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 */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nvar NoopMeter = /** @class */ (function () {\n function NoopMeter() {\n }\n /**\n * @see {@link Meter.createGauge}\n */\n NoopMeter.prototype.createGauge = function (_name, _options) {\n return NOOP_GAUGE_METRIC;\n };\n /**\n * @see {@link Meter.createHistogram}\n */\n NoopMeter.prototype.createHistogram = function (_name, _options) {\n return NOOP_HISTOGRAM_METRIC;\n };\n /**\n * @see {@link Meter.createCounter}\n */\n NoopMeter.prototype.createCounter = function (_name, _options) {\n return NOOP_COUNTER_METRIC;\n };\n /**\n * @see {@link Meter.createUpDownCounter}\n */\n NoopMeter.prototype.createUpDownCounter = function (_name, _options) {\n return NOOP_UP_DOWN_COUNTER_METRIC;\n };\n /**\n * @see {@link Meter.createObservableGauge}\n */\n NoopMeter.prototype.createObservableGauge = function (_name, _options) {\n return NOOP_OBSERVABLE_GAUGE_METRIC;\n };\n /**\n * @see {@link Meter.createObservableCounter}\n */\n NoopMeter.prototype.createObservableCounter = function (_name, _options) {\n return NOOP_OBSERVABLE_COUNTER_METRIC;\n };\n /**\n * @see {@link Meter.createObservableUpDownCounter}\n */\n NoopMeter.prototype.createObservableUpDownCounter = function (_name, _options) {\n return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n };\n /**\n * @see {@link Meter.addBatchObservableCallback}\n */\n NoopMeter.prototype.addBatchObservableCallback = function (_callback, _observables) { };\n /**\n * @see {@link Meter.removeBatchObservableCallback}\n */\n NoopMeter.prototype.removeBatchObservableCallback = function (_callback) { };\n return NoopMeter;\n}());\nexport { NoopMeter };\nvar NoopMetric = /** @class */ (function () {\n function NoopMetric() {\n }\n return NoopMetric;\n}());\nexport { NoopMetric };\nvar NoopCounterMetric = /** @class */ (function (_super) {\n __extends(NoopCounterMetric, _super);\n function NoopCounterMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NoopCounterMetric.prototype.add = function (_value, _attributes) { };\n return NoopCounterMetric;\n}(NoopMetric));\nexport { NoopCounterMetric };\nvar NoopUpDownCounterMetric = /** @class */ (function (_super) {\n __extends(NoopUpDownCounterMetric, _super);\n function NoopUpDownCounterMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NoopUpDownCounterMetric.prototype.add = function (_value, _attributes) { };\n return NoopUpDownCounterMetric;\n}(NoopMetric));\nexport { NoopUpDownCounterMetric };\nvar NoopGaugeMetric = /** @class */ (function (_super) {\n __extends(NoopGaugeMetric, _super);\n function NoopGaugeMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NoopGaugeMetric.prototype.record = function (_value, _attributes) { };\n return NoopGaugeMetric;\n}(NoopMetric));\nexport { NoopGaugeMetric };\nvar NoopHistogramMetric = /** @class */ (function (_super) {\n __extends(NoopHistogramMetric, _super);\n function NoopHistogramMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n NoopHistogramMetric.prototype.record = function (_value, _attributes) { };\n return NoopHistogramMetric;\n}(NoopMetric));\nexport { NoopHistogramMetric };\nvar NoopObservableMetric = /** @class */ (function () {\n function NoopObservableMetric() {\n }\n NoopObservableMetric.prototype.addCallback = function (_callback) { };\n NoopObservableMetric.prototype.removeCallback = function (_callback) { };\n return NoopObservableMetric;\n}());\nexport { NoopObservableMetric };\nvar NoopObservableCounterMetric = /** @class */ (function (_super) {\n __extends(NoopObservableCounterMetric, _super);\n function NoopObservableCounterMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return NoopObservableCounterMetric;\n}(NoopObservableMetric));\nexport { NoopObservableCounterMetric };\nvar NoopObservableGaugeMetric = /** @class */ (function (_super) {\n __extends(NoopObservableGaugeMetric, _super);\n function NoopObservableGaugeMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return NoopObservableGaugeMetric;\n}(NoopObservableMetric));\nexport { NoopObservableGaugeMetric };\nvar NoopObservableUpDownCounterMetric = /** @class */ (function (_super) {\n __extends(NoopObservableUpDownCounterMetric, _super);\n function NoopObservableUpDownCounterMetric() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return NoopObservableUpDownCounterMetric;\n}(NoopObservableMetric));\nexport { NoopObservableUpDownCounterMetric };\nexport var NOOP_METER = new NoopMeter();\n// Synchronous instruments\nexport var NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexport var NOOP_GAUGE_METRIC = new NoopGaugeMetric();\nexport var NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexport var NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n// Asynchronous instruments\nexport var NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexport var NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexport var NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();\n/**\n * Create a no-op Meter\n */\nexport function createNoopMeter() {\n return NOOP_METER;\n}\n//# sourceMappingURL=NoopMeter.js.map","/*\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/** The Type of value. It describes how the data is reported. */\nexport var ValueType;\n(function (ValueType) {\n ValueType[ValueType[\"INT\"] = 0] = \"INT\";\n ValueType[ValueType[\"DOUBLE\"] = 1] = \"DOUBLE\";\n})(ValueType || (ValueType = {}));\n//# sourceMappingURL=Metric.js.map","/*\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 var defaultTextMapGetter = {\n get: function (carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys: function (carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\nexport var defaultTextMapSetter = {\n set: function (carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map","/*\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 */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { ROOT_CONTEXT } from './context';\nvar NoopContextManager = /** @class */ (function () {\n function NoopContextManager() {\n }\n NoopContextManager.prototype.active = function () {\n return ROOT_CONTEXT;\n };\n NoopContextManager.prototype.with = function (_context, fn, thisArg) {\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return fn.call.apply(fn, __spreadArray([thisArg], __read(args), false));\n };\n NoopContextManager.prototype.bind = function (_context, target) {\n return target;\n };\n NoopContextManager.prototype.enable = function () {\n return this;\n };\n NoopContextManager.prototype.disable = function () {\n return this;\n };\n return NoopContextManager;\n}());\nexport { NoopContextManager };\n//# sourceMappingURL=NoopContextManager.js.map","/*\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 */\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'context';\nvar NOOP_CONTEXT_MANAGER = new NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n */\nvar ContextAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function ContextAPI() {\n }\n /** Get the singleton instance of the Context API */\n ContextAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n };\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n ContextAPI.prototype.setGlobalContextManager = function (contextManager) {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n };\n /**\n * Get the currently active context\n */\n ContextAPI.prototype.active = function () {\n return this._getContextManager().active();\n };\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n ContextAPI.prototype.with = function (context, fn, thisArg) {\n var _a;\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return (_a = this._getContextManager()).with.apply(_a, __spreadArray([context, fn, thisArg], __read(args), false));\n };\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n ContextAPI.prototype.bind = function (context, target) {\n return this._getContextManager().bind(context, target);\n };\n ContextAPI.prototype._getContextManager = function () {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n };\n /** Disable and remove the global context manager */\n ContextAPI.prototype.disable = function () {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n return ContextAPI;\n}());\nexport { ContextAPI };\n//# sourceMappingURL=context.js.map","/*\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 var TraceFlags;\n(function (TraceFlags) {\n /** Represents no flag set. */\n TraceFlags[TraceFlags[\"NONE\"] = 0] = \"NONE\";\n /** Bit to represent whether trace is sampled in trace flags. */\n TraceFlags[TraceFlags[\"SAMPLED\"] = 1] = \"SAMPLED\";\n})(TraceFlags || (TraceFlags = {}));\n//# sourceMappingURL=trace_flags.js.map","/*\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 { TraceFlags } from './trace_flags';\nexport var INVALID_SPANID = '0000000000000000';\nexport var INVALID_TRACEID = '00000000000000000000000000000000';\nexport var INVALID_SPAN_CONTEXT = {\n traceId: INVALID_TRACEID,\n spanId: INVALID_SPANID,\n traceFlags: TraceFlags.NONE,\n};\n//# sourceMappingURL=invalid-span-constants.js.map","/*\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_SPAN_CONTEXT } from './invalid-span-constants';\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 */\nvar NonRecordingSpan = /** @class */ (function () {\n function NonRecordingSpan(_spanContext) {\n if (_spanContext === void 0) { _spanContext = INVALID_SPAN_CONTEXT; }\n this._spanContext = _spanContext;\n }\n // Returns a SpanContext.\n NonRecordingSpan.prototype.spanContext = function () {\n return this._spanContext;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setAttribute = function (_key, _value) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setAttributes = function (_attributes) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.addEvent = function (_name, _attributes) {\n return this;\n };\n NonRecordingSpan.prototype.addLink = function (_link) {\n return this;\n };\n NonRecordingSpan.prototype.addLinks = function (_links) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setStatus = function (_status) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.updateName = function (_name) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.end = function (_endTime) { };\n // isRecording always returns false for NonRecordingSpan.\n NonRecordingSpan.prototype.isRecording = function () {\n return false;\n };\n // By default does nothing\n NonRecordingSpan.prototype.recordException = function (_exception, _time) { };\n return NonRecordingSpan;\n}());\nexport { NonRecordingSpan };\n//# sourceMappingURL=NonRecordingSpan.js.map","/*\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 { createContextKey } from '../context/context';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { ContextAPI } from '../api/context';\n/**\n * span key\n */\nvar SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nexport function getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\n/**\n * Gets the span from the current context, if one exists.\n */\nexport function getActiveSpan() {\n return getSpan(ContextAPI.getInstance().active());\n}\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nexport function setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nexport function deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nexport function setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan(spanContext));\n}\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nexport function getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\n//# sourceMappingURL=context-utils.js.map","/*\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';\nvar VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;\nvar VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;\nexport function isValidTraceId(traceId) {\n return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;\n}\nexport function isValidSpanId(spanId) {\n return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;\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) {\n return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));\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) {\n return new NonRecordingSpan(spanContext);\n}\n//# sourceMappingURL=spancontext-utils.js.map","/*\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 { ContextAPI } from '../api/context';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { isSpanContextValid } from './spancontext-utils';\nvar contextApi = ContextAPI.getInstance();\n/**\n * No-op implementations of {@link Tracer}.\n */\nvar NoopTracer = /** @class */ (function () {\n function NoopTracer() {\n }\n // startSpan starts a noop span.\n NoopTracer.prototype.startSpan = function (name, options, context) {\n if (context === void 0) { context = contextApi.active(); }\n var root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan();\n }\n var parentFromContext = context && getSpanContext(context);\n if (isSpanContext(parentFromContext) &&\n isSpanContextValid(parentFromContext)) {\n return new NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan();\n }\n };\n NoopTracer.prototype.startActiveSpan = function (name, arg2, arg3, arg4) {\n var opts;\n var ctx;\n var fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();\n var span = this.startSpan(name, opts, parentContext);\n var contextWithSpanSet = setSpan(parentContext, span);\n return contextApi.with(contextWithSpanSet, fn, undefined, span);\n };\n return NoopTracer;\n}());\nexport { NoopTracer };\nfunction isSpanContext(spanContext) {\n return (typeof spanContext === 'object' &&\n typeof spanContext['spanId'] === 'string' &&\n typeof spanContext['traceId'] === 'string' &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map","/*\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 { NoopTracer } from './NoopTracer';\nvar NOOP_TRACER = new NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n */\nvar ProxyTracer = /** @class */ (function () {\n function ProxyTracer(_provider, name, version, options) {\n this._provider = _provider;\n this.name = name;\n this.version = version;\n this.options = options;\n }\n ProxyTracer.prototype.startSpan = function (name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n };\n ProxyTracer.prototype.startActiveSpan = function (_name, _options, _context, _fn) {\n var tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n };\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n ProxyTracer.prototype._getTracer = function () {\n if (this._delegate) {\n return this._delegate;\n }\n var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n };\n return ProxyTracer;\n}());\nexport { ProxyTracer };\n//# sourceMappingURL=ProxyTracer.js.map","/*\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 { NoopTracer } from './NoopTracer';\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nvar NoopTracerProvider = /** @class */ (function () {\n function NoopTracerProvider() {\n }\n NoopTracerProvider.prototype.getTracer = function (_name, _version, _options) {\n return new NoopTracer();\n };\n return NoopTracerProvider;\n}());\nexport { NoopTracerProvider };\n//# sourceMappingURL=NoopTracerProvider.js.map","/*\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 { ProxyTracer } from './ProxyTracer';\nimport { NoopTracerProvider } from './NoopTracerProvider';\nvar NOOP_TRACER_PROVIDER = new NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n */\nvar ProxyTracerProvider = /** @class */ (function () {\n function ProxyTracerProvider() {\n }\n /**\n * Get a {@link ProxyTracer}\n */\n ProxyTracerProvider.prototype.getTracer = function (name, version, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options));\n };\n ProxyTracerProvider.prototype.getDelegate = function () {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n };\n /**\n * Set the delegate tracer provider\n */\n ProxyTracerProvider.prototype.setDelegate = function (delegate) {\n this._delegate = delegate;\n };\n ProxyTracerProvider.prototype.getDelegateTracer = function (name, version, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\n };\n return ProxyTracerProvider;\n}());\nexport { ProxyTracerProvider };\n//# sourceMappingURL=ProxyTracerProvider.js.map","/*\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 * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n */\nexport var SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision || (SamplingDecision = {}));\n//# sourceMappingURL=SamplingResult.js.map","/*\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 var SpanKind;\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(SpanKind || (SpanKind = {}));\n//# sourceMappingURL=span_kind.js.map","/**\n * An enumeration of status codes.\n */\nexport var SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode || (SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map","/*\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 */\nvar VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nvar VALID_KEY = \"[a-z]\" + VALID_KEY_CHAR_RANGE + \"{0,255}\";\nvar VALID_VENDOR_KEY = \"[a-z0-9]\" + VALID_KEY_CHAR_RANGE + \"{0,240}@[a-z]\" + VALID_KEY_CHAR_RANGE + \"{0,13}\";\nvar VALID_KEY_REGEX = new RegExp(\"^(?:\" + VALID_KEY + \"|\" + VALID_VENDOR_KEY + \")$\");\nvar VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nvar INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nexport function validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nexport function validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\n//# sourceMappingURL=tracestate-validators.js.map","/*\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 { validateKey, validateValue } from './tracestate-validators';\nvar MAX_TRACE_STATE_ITEMS = 32;\nvar MAX_TRACE_STATE_LEN = 512;\nvar LIST_MEMBERS_SEPARATOR = ',';\nvar LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nvar TraceStateImpl = /** @class */ (function () {\n function TraceStateImpl(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n TraceStateImpl.prototype.set = function (key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n var traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n };\n TraceStateImpl.prototype.unset = function (key) {\n var traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n };\n TraceStateImpl.prototype.get = function (key) {\n return this._internalState.get(key);\n };\n TraceStateImpl.prototype.serialize = function () {\n var _this = this;\n return this._keys()\n .reduce(function (agg, key) {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + _this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR);\n };\n TraceStateImpl.prototype._parse = function (rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning\n .reduce(function (agg, part) {\n var listMember = part.trim(); // Optional Whitespace (OWS) handling\n var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n var key = listMember.slice(0, i);\n var value = listMember.slice(i + 1, part.length);\n if (validateKey(key) && validateValue(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n };\n TraceStateImpl.prototype._keys = function () {\n return Array.from(this._internalState.keys()).reverse();\n };\n TraceStateImpl.prototype._clone = function () {\n var traceState = new TraceStateImpl();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n };\n return TraceStateImpl;\n}());\nexport { TraceStateImpl };\n//# sourceMappingURL=tracestate-impl.js.map","/*\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 { TraceStateImpl } from './tracestate-impl';\nexport function createTraceState(rawTraceState) {\n return new TraceStateImpl(rawTraceState);\n}\n//# sourceMappingURL=utils.js.map","/*\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// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { ContextAPI } from './api/context';\n/** Entrypoint for context API */\nexport var context = ContextAPI.getInstance();\n//# sourceMappingURL=context-api.js.map","/*\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// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { DiagAPI } from './api/diag';\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n */\nexport var diag = DiagAPI.instance();\n//# sourceMappingURL=diag-api.js.map","/*\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 { NOOP_METER } from './NoopMeter';\n/**\n * An implementation of the {@link MeterProvider} which returns an impotent Meter\n * for all calls to `getMeter`\n */\nvar NoopMeterProvider = /** @class */ (function () {\n function NoopMeterProvider() {\n }\n NoopMeterProvider.prototype.getMeter = function (_name, _version, _options) {\n return NOOP_METER;\n };\n return NoopMeterProvider;\n}());\nexport { NoopMeterProvider };\nexport var NOOP_METER_PROVIDER = new NoopMeterProvider();\n//# sourceMappingURL=NoopMeterProvider.js.map","/*\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 { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'metrics';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nvar MetricsAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function MetricsAPI() {\n }\n /** Get the singleton instance of the Metrics API */\n MetricsAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n return this._instance;\n };\n /**\n * Set the current global meter provider.\n * Returns true if the meter provider was successfully registered, else false.\n */\n MetricsAPI.prototype.setGlobalMeterProvider = function (provider) {\n return registerGlobal(API_NAME, provider, DiagAPI.instance());\n };\n /**\n * Returns the global meter provider.\n */\n MetricsAPI.prototype.getMeterProvider = function () {\n return getGlobal(API_NAME) || NOOP_METER_PROVIDER;\n };\n /**\n * Returns a meter from the global meter provider.\n */\n MetricsAPI.prototype.getMeter = function (name, version, options) {\n return this.getMeterProvider().getMeter(name, version, options);\n };\n /** Remove the global meter provider */\n MetricsAPI.prototype.disable = function () {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n return MetricsAPI;\n}());\nexport { MetricsAPI };\n//# sourceMappingURL=metrics.js.map","/*\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// 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 var metrics = MetricsAPI.getInstance();\n//# sourceMappingURL=metrics-api.js.map","/*\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 * No-op implementations of {@link TextMapPropagator}.\n */\nvar NoopTextMapPropagator = /** @class */ (function () {\n function NoopTextMapPropagator() {\n }\n /** Noop inject function does nothing */\n NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { };\n /** Noop extract function does nothing and returns the input context */\n NoopTextMapPropagator.prototype.extract = function (context, _carrier) {\n return context;\n };\n NoopTextMapPropagator.prototype.fields = function () {\n return [];\n };\n return NoopTextMapPropagator;\n}());\nexport { NoopTextMapPropagator };\n//# sourceMappingURL=NoopTextMapPropagator.js.map","/*\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 { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\n/**\n * Baggage key\n */\nvar BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage() {\n return getBaggage(ContextAPI.getInstance().active());\n}\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\n//# sourceMappingURL=context-helpers.js.map","/*\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 { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';\nimport { getBaggage, getActiveBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'propagation';\nvar NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n */\nvar PropagationAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function PropagationAPI() {\n this.createBaggage = createBaggage;\n this.getBaggage = getBaggage;\n this.getActiveBaggage = getActiveBaggage;\n this.setBaggage = setBaggage;\n this.deleteBaggage = deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n PropagationAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n };\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n PropagationAPI.prototype.setGlobalPropagator = function (propagator) {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n };\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n PropagationAPI.prototype.inject = function (context, carrier, setter) {\n if (setter === void 0) { setter = defaultTextMapSetter; }\n return this._getGlobalPropagator().inject(context, carrier, setter);\n };\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n PropagationAPI.prototype.extract = function (context, carrier, getter) {\n if (getter === void 0) { getter = defaultTextMapGetter; }\n return this._getGlobalPropagator().extract(context, carrier, getter);\n };\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n PropagationAPI.prototype.fields = function () {\n return this._getGlobalPropagator().fields();\n };\n /** Remove the global propagator */\n PropagationAPI.prototype.disable = function () {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n };\n PropagationAPI.prototype._getGlobalPropagator = function () {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n };\n return PropagationAPI;\n}());\nexport { PropagationAPI };\n//# sourceMappingURL=propagation.js.map","/*\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// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { PropagationAPI } from './api/propagation';\n/** Entrypoint for propagation API */\nexport var propagation = PropagationAPI.getInstance();\n//# sourceMappingURL=propagation-api.js.map","/*\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 { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport { isSpanContextValid, wrapSpanContext, } from '../trace/spancontext-utils';\nimport { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext, } from '../trace/context-utils';\nimport { DiagAPI } from './diag';\nvar API_NAME = 'trace';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n */\nvar TraceAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function TraceAPI() {\n this._proxyTracerProvider = new ProxyTracerProvider();\n this.wrapSpanContext = wrapSpanContext;\n this.isSpanContextValid = isSpanContextValid;\n this.deleteSpan = deleteSpan;\n this.getSpan = getSpan;\n this.getActiveSpan = getActiveSpan;\n this.getSpanContext = getSpanContext;\n this.setSpan = setSpan;\n this.setSpanContext = setSpanContext;\n }\n /** Get the singleton instance of the Trace API */\n TraceAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n };\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n TraceAPI.prototype.setGlobalTracerProvider = function (provider) {\n var success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n };\n /**\n * Returns the global tracer provider.\n */\n TraceAPI.prototype.getTracerProvider = function () {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n };\n /**\n * Returns a tracer from the global tracer provider.\n */\n TraceAPI.prototype.getTracer = function (name, version) {\n return this.getTracerProvider().getTracer(name, version);\n };\n /** Remove the global tracer provider */\n TraceAPI.prototype.disable = function () {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n };\n return TraceAPI;\n}());\nexport { TraceAPI };\n//# sourceMappingURL=trace.js.map","/*\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// 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 var trace = TraceAPI.getInstance();\n//# sourceMappingURL=trace-api.js.map","/*\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 { baggageEntryMetadataFromString } from './baggage/utils';\n// Context APIs\nexport { createContextKey, ROOT_CONTEXT } from './context/context';\n// Diag APIs\nexport { DiagConsoleLogger } from './diag/consoleLogger';\nexport { DiagLogLevel, } from './diag/types';\n// Metrics APIs\nexport { createNoopMeter } from './metrics/NoopMeter';\nexport { ValueType, } from './metrics/Metric';\n// Propagation APIs\nexport { defaultTextMapGetter, defaultTextMapSetter, } from './propagation/TextMapPropagator';\nexport { ProxyTracer } from './trace/ProxyTracer';\nexport { ProxyTracerProvider } from './trace/ProxyTracerProvider';\nexport { SamplingDecision } from './trace/SamplingResult';\nexport { SpanKind } from './trace/span_kind';\nexport { SpanStatusCode } from './trace/status';\nexport { TraceFlags } from './trace/trace_flags';\nexport { createTraceState } from './trace/internal/utils';\nexport { isSpanContextValid, isValidTraceId, isValidSpanId, } from './trace/spancontext-utils';\nexport { INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT, } from './trace/invalid-span-constants';\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// Named export.\nexport { context, diag, metrics, propagation, trace };\n// Default export.\nexport default {\n context: context,\n diag: diag,\n metrics: metrics,\n propagation: propagation,\n trace: trace,\n};\n//# sourceMappingURL=index.js.map","'use strict';\n\nconst OtelApi = require('@opentelemetry/api');\nconst Counter = require('../counter');\n\nconst PROCESS_CPU_USER_SECONDS = 'process_cpu_user_seconds_total';\nconst PROCESS_CPU_SYSTEM_SECONDS = 'process_cpu_system_seconds_total';\nconst PROCESS_CPU_SECONDS = 'process_cpu_seconds_total';\n\nmodule.exports = (registry, config = {}) => {\n\tconst registers = registry ? [registry] : undefined;\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst exemplars = config.enableExemplars ? config.enableExemplars : false;\n\tconst labelNames = Object.keys(labels);\n\n\tlet lastCpuUsage = process.cpuUsage();\n\n\tconst cpuUserUsageCounter = new Counter({\n\t\tname: namePrefix + PROCESS_CPU_USER_SECONDS,\n\t\thelp: 'Total user CPU time spent in seconds.',\n\t\tenableExemplars: exemplars,\n\t\tregisters,\n\t\tlabelNames,\n\t\t// Use this one metric's `collect` to set all metrics' values.\n\t\tcollect() {\n\t\t\tconst cpuUsage = process.cpuUsage();\n\n\t\t\tconst userUsageMicros = cpuUsage.user - lastCpuUsage.user;\n\t\t\tconst systemUsageMicros = cpuUsage.system - lastCpuUsage.system;\n\n\t\t\tlastCpuUsage = cpuUsage;\n\n\t\t\tif (this.enableExemplars) {\n\t\t\t\tlet exemplarLabels = {};\n\t\t\t\tconst currentSpan = OtelApi.trace.getSpan(OtelApi.context.active());\n\t\t\t\tif (currentSpan) {\n\t\t\t\t\texemplarLabels = {\n\t\t\t\t\t\ttraceId: currentSpan.spanContext().traceId,\n\t\t\t\t\t\tspanId: currentSpan.spanContext().spanId,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tcpuUserUsageCounter.inc({\n\t\t\t\t\tlabels,\n\t\t\t\t\tvalue: userUsageMicros / 1e6,\n\t\t\t\t\texemplarLabels,\n\t\t\t\t});\n\t\t\t\tcpuSystemUsageCounter.inc({\n\t\t\t\t\tlabels,\n\t\t\t\t\tvalue: systemUsageMicros / 1e6,\n\t\t\t\t\texemplarLabels,\n\t\t\t\t});\n\t\t\t\tcpuUsageCounter.inc({\n\t\t\t\t\tlabels,\n\t\t\t\t\tvalue: (userUsageMicros + systemUsageMicros) / 1e6,\n\t\t\t\t\texemplarLabels,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tcpuUserUsageCounter.inc(labels, userUsageMicros / 1e6);\n\t\t\t\tcpuSystemUsageCounter.inc(labels, systemUsageMicros / 1e6);\n\t\t\t\tcpuUsageCounter.inc(\n\t\t\t\t\tlabels,\n\t\t\t\t\t(userUsageMicros + systemUsageMicros) / 1e6,\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t});\n\tconst cpuSystemUsageCounter = new Counter({\n\t\tname: namePrefix + PROCESS_CPU_SYSTEM_SECONDS,\n\t\thelp: 'Total system CPU time spent in seconds.',\n\t\tenableExemplars: exemplars,\n\t\tregisters,\n\t\tlabelNames,\n\t});\n\tconst cpuUsageCounter = new Counter({\n\t\tname: namePrefix + PROCESS_CPU_SECONDS,\n\t\thelp: 'Total user and system CPU time spent in seconds.',\n\t\tenableExemplars: exemplars,\n\t\tregisters,\n\t\tlabelNames,\n\t});\n};\n\nmodule.exports.metricNames = [\n\tPROCESS_CPU_USER_SECONDS,\n\tPROCESS_CPU_SYSTEM_SECONDS,\n\tPROCESS_CPU_SECONDS,\n];\n","'use strict';\n\nconst Gauge = require('../gauge');\nconst startInSeconds = Math.round(Date.now() / 1000 - process.uptime());\n\nconst PROCESS_START_TIME = 'process_start_time_seconds';\n\nmodule.exports = (registry, config = {}) => {\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tnew Gauge({\n\t\tname: namePrefix + PROCESS_START_TIME,\n\t\thelp: 'Start time of the process since unix epoch in seconds.',\n\t\tregisters: registry ? [registry] : undefined,\n\t\tlabelNames,\n\t\taggregator: 'omit',\n\t\tcollect() {\n\t\t\tthis.set(labels, startInSeconds);\n\t\t},\n\t});\n};\n\nmodule.exports.metricNames = [PROCESS_START_TIME];\n","'use strict';\n\nconst Gauge = require('../gauge');\nconst fs = require('fs');\n\nconst values = ['VmSize', 'VmRSS', 'VmData'];\n\nconst PROCESS_RESIDENT_MEMORY = 'process_resident_memory_bytes';\nconst PROCESS_VIRTUAL_MEMORY = 'process_virtual_memory_bytes';\nconst PROCESS_HEAP = 'process_heap_bytes';\n\nfunction structureOutput(input) {\n\treturn input.split('\\n').reduce((acc, string) => {\n\t\tif (!values.some(value => string.startsWith(value))) {\n\t\t\treturn acc;\n\t\t}\n\n\t\tconst split = string.split(':');\n\n\t\t// Get the value\n\t\tlet value = split[1].trim();\n\t\t// Remove trailing ` kb`\n\t\tvalue = value.substr(0, value.length - 3);\n\t\t// Make it into a number in bytes bytes\n\t\tvalue = Number(value) * 1024;\n\n\t\tacc[split[0]] = value;\n\n\t\treturn acc;\n\t}, {});\n}\n\nmodule.exports = (registry, config = {}) => {\n\tconst registers = registry ? [registry] : undefined;\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tconst residentMemGauge = new Gauge({\n\t\tname: namePrefix + PROCESS_RESIDENT_MEMORY,\n\t\thelp: 'Resident memory size in bytes.',\n\t\tregisters,\n\t\tlabelNames,\n\t\t// Use this one metric's `collect` to set all metrics' values.\n\t\tcollect() {\n\t\t\ttry {\n\t\t\t\t// Sync I/O is often problematic, but /proc isn't really I/O, it\n\t\t\t\t// a virtual filesystem that maps directly to in-kernel data\n\t\t\t\t// structures and never blocks.\n\t\t\t\t//\n\t\t\t\t// Node.js/libuv do this already for process.memoryUsage(), see:\n\t\t\t\t// - https://github.com/libuv/libuv/blob/a629688008694ed8022269e66826d4d6ec688b83/src/unix/linux-core.c#L506-L523\n\t\t\t\tconst stat = fs.readFileSync('/proc/self/status', 'utf8');\n\t\t\t\tconst structuredOutput = structureOutput(stat);\n\n\t\t\t\tresidentMemGauge.set(labels, structuredOutput.VmRSS);\n\t\t\t\tvirtualMemGauge.set(labels, structuredOutput.VmSize);\n\t\t\t\theapSizeMemGauge.set(labels, structuredOutput.VmData);\n\t\t\t} catch {\n\t\t\t\t// noop\n\t\t\t}\n\t\t},\n\t});\n\tconst virtualMemGauge = new Gauge({\n\t\tname: namePrefix + PROCESS_VIRTUAL_MEMORY,\n\t\thelp: 'Virtual memory size in bytes.',\n\t\tregisters,\n\t\tlabelNames,\n\t});\n\tconst heapSizeMemGauge = new Gauge({\n\t\tname: namePrefix + PROCESS_HEAP,\n\t\thelp: 'Process heap size in bytes.',\n\t\tregisters,\n\t\tlabelNames,\n\t});\n};\n\nmodule.exports.metricNames = [\n\tPROCESS_RESIDENT_MEMORY,\n\tPROCESS_VIRTUAL_MEMORY,\n\tPROCESS_HEAP,\n];\n","'use strict';\n\n// process.memoryUsage() can throw on some platforms, see #67\nfunction safeMemoryUsage() {\n\ttry {\n\t\treturn process.memoryUsage();\n\t} catch {\n\t\treturn;\n\t}\n}\n\nmodule.exports = safeMemoryUsage;\n","'use strict';\n\nconst Gauge = require('../gauge');\nconst linuxVariant = require('./osMemoryHeapLinux');\nconst safeMemoryUsage = require('./helpers/safeMemoryUsage');\n\nconst PROCESS_RESIDENT_MEMORY = 'process_resident_memory_bytes';\n\nfunction notLinuxVariant(registry, config = {}) {\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tnew Gauge({\n\t\tname: namePrefix + PROCESS_RESIDENT_MEMORY,\n\t\thelp: 'Resident memory size in bytes.',\n\t\tregisters: registry ? [registry] : undefined,\n\t\tlabelNames,\n\t\tcollect() {\n\t\t\tconst memUsage = safeMemoryUsage();\n\n\t\t\t// I don't think the other things returned from `process.memoryUsage()` is relevant to a standard export\n\t\t\tif (memUsage) {\n\t\t\t\tthis.set(labels, memUsage.rss);\n\t\t\t}\n\t\t},\n\t});\n}\n\nmodule.exports = (registry, config) =>\n\tprocess.platform === 'linux'\n\t\t? linuxVariant(registry, config)\n\t\t: notLinuxVariant(registry, config);\n\nmodule.exports.metricNames =\n\tprocess.platform === 'linux'\n\t\t? linuxVariant.metricNames\n\t\t: [PROCESS_RESIDENT_MEMORY];\n","'use strict';\n\nconst Gauge = require('../gauge');\nconst fs = require('fs');\nconst process = require('process');\n\nconst PROCESS_OPEN_FDS = 'process_open_fds';\n\nmodule.exports = (registry, config = {}) => {\n\tif (process.platform !== 'linux') {\n\t\treturn;\n\t}\n\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tnew Gauge({\n\t\tname: namePrefix + PROCESS_OPEN_FDS,\n\t\thelp: 'Number of open file descriptors.',\n\t\tregisters: registry ? [registry] : undefined,\n\t\tlabelNames,\n\t\tcollect() {\n\t\t\ttry {\n\t\t\t\tconst fds = fs.readdirSync('/proc/self/fd');\n\t\t\t\t// Minus 1 to not count the fd that was used by readdirSync(),\n\t\t\t\t// it's now closed.\n\t\t\t\tthis.set(labels, fds.length - 1);\n\t\t\t} catch {\n\t\t\t\t// noop\n\t\t\t}\n\t\t},\n\t});\n};\n\nmodule.exports.metricNames = [PROCESS_OPEN_FDS];\n","'use strict';\n\nconst Gauge = require('../gauge');\nconst fs = require('fs');\n\nconst PROCESS_MAX_FDS = 'process_max_fds';\n\nlet maxFds;\n\nmodule.exports = (registry, config = {}) => {\n\tif (maxFds === undefined) {\n\t\t// This will fail if a linux-like procfs is not available.\n\t\ttry {\n\t\t\tconst limits = fs.readFileSync('/proc/self/limits', 'utf8');\n\t\t\tconst lines = limits.split('\\n');\n\t\t\tfor (const line of lines) {\n\t\t\t\tif (line.startsWith('Max open files')) {\n\t\t\t\t\tconst parts = line.split(/ +/);\n\t\t\t\t\tmaxFds = Number(parts[1]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (maxFds === undefined) return;\n\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tnew Gauge({\n\t\tname: namePrefix + PROCESS_MAX_FDS,\n\t\thelp: 'Maximum number of open file descriptors.',\n\t\tregisters: registry ? [registry] : undefined,\n\t\tlabelNames,\n\t\tcollect() {\n\t\t\tif (maxFds !== undefined) this.set(labels, maxFds);\n\t\t},\n\t});\n};\n\nmodule.exports.metricNames = [PROCESS_MAX_FDS];\n","'use strict';\n\nconst Gauge = require('../gauge');\n\n// Check if perf_hooks module is available\nlet perf_hooks;\ntry {\n\tperf_hooks = require('perf_hooks');\n} catch {\n\t// node version is too old\n}\n\n// Reported always.\nconst NODEJS_EVENTLOOP_LAG = 'nodejs_eventloop_lag_seconds';\n\n// Reported only when perf_hooks is available.\nconst NODEJS_EVENTLOOP_LAG_MIN = 'nodejs_eventloop_lag_min_seconds';\nconst NODEJS_EVENTLOOP_LAG_MAX = 'nodejs_eventloop_lag_max_seconds';\nconst NODEJS_EVENTLOOP_LAG_MEAN = 'nodejs_eventloop_lag_mean_seconds';\nconst NODEJS_EVENTLOOP_LAG_STDDEV = 'nodejs_eventloop_lag_stddev_seconds';\nconst NODEJS_EVENTLOOP_LAG_P50 = 'nodejs_eventloop_lag_p50_seconds';\nconst NODEJS_EVENTLOOP_LAG_P90 = 'nodejs_eventloop_lag_p90_seconds';\nconst NODEJS_EVENTLOOP_LAG_P99 = 'nodejs_eventloop_lag_p99_seconds';\n\nfunction reportEventloopLag(start, gauge, labels) {\n\tconst delta = process.hrtime(start);\n\tconst nanosec = delta[0] * 1e9 + delta[1];\n\tconst seconds = nanosec / 1e9;\n\n\tgauge.set(labels, seconds);\n}\n\nmodule.exports = (registry, config = {}) => {\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\tconst registers = registry ? [registry] : undefined;\n\n\tlet collect = () => {\n\t\tconst start = process.hrtime();\n\t\tsetImmediate(reportEventloopLag, start, lag, labels);\n\t};\n\n\tif (perf_hooks && perf_hooks.monitorEventLoopDelay) {\n\t\ttry {\n\t\t\tconst histogram = perf_hooks.monitorEventLoopDelay({\n\t\t\t\tresolution: config.eventLoopMonitoringPrecision,\n\t\t\t});\n\t\t\thistogram.enable();\n\n\t\t\tcollect = () => {\n\t\t\t\tconst start = process.hrtime();\n\t\t\t\tsetImmediate(reportEventloopLag, start, lag, labels);\n\n\t\t\t\tlagMin.set(labels, histogram.min / 1e9);\n\t\t\t\tlagMax.set(labels, histogram.max / 1e9);\n\t\t\t\tlagMean.set(labels, histogram.mean / 1e9);\n\t\t\t\tlagStddev.set(labels, histogram.stddev / 1e9);\n\t\t\t\tlagP50.set(labels, histogram.percentile(50) / 1e9);\n\t\t\t\tlagP90.set(labels, histogram.percentile(90) / 1e9);\n\t\t\t\tlagP99.set(labels, histogram.percentile(99) / 1e9);\n\n\t\t\t\thistogram.reset();\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tif (e.code === 'ERR_NOT_IMPLEMENTED') {\n\t\t\t\treturn; // Bun\n\t\t\t}\n\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tconst lag = new Gauge({\n\t\tname: namePrefix + NODEJS_EVENTLOOP_LAG,\n\t\thelp: 'Lag of event loop in seconds.',\n\t\tregisters,\n\t\tlabelNames,\n\t\taggregator: 'average',\n\t\t// Use this one metric's `collect` to set all metrics' values.\n\t\tcollect,\n\t});\n\tconst lagMin = new Gauge({\n\t\tname: namePrefix + NODEJS_EVENTLOOP_LAG_MIN,\n\t\thelp: 'The minimum recorded event loop delay.',\n\t\tregisters,\n\t\tlabelNames,\n\t\taggregator: 'min',\n\t});\n\tconst lagMax = new Gauge({\n\t\tname: namePrefix + NODEJS_EVENTLOOP_LAG_MAX,\n\t\thelp: 'The maximum recorded event loop delay.',\n\t\tregisters,\n\t\tlabelNames,\n\t\taggregator: 'max',\n\t});\n\tconst lagMean = new Gauge({\n\t\tname: namePrefix + NODEJS_EVENTLOOP_LAG_MEAN,\n\t\thelp: 'The mean of the recorded event loop delays.',\n\t\tregisters,\n\t\tlabelNames,\n\t\taggregator: 'average',\n\t});\n\tconst lagStddev = new Gauge({\n\t\tname: namePrefix + NODEJS_EVENTLOOP_LAG_STDDEV,\n\t\thelp: 'The standard deviation of the recorded event loop delays.',\n\t\tregisters,\n\t\tlabelNames,\n\t\taggregator: 'average',\n\t});\n\tconst lagP50 = new Gauge({\n\t\tname: namePrefix + NODEJS_EVENTLOOP_LAG_P50,\n\t\thelp: 'The 50th percentile of the recorded event loop delays.',\n\t\tregisters,\n\t\tlabelNames,\n\t\taggregator: 'average',\n\t});\n\tconst lagP90 = new Gauge({\n\t\tname: namePrefix + NODEJS_EVENTLOOP_LAG_P90,\n\t\thelp: 'The 90th percentile of the recorded event loop delays.',\n\t\tregisters,\n\t\tlabelNames,\n\t\taggregator: 'average',\n\t});\n\tconst lagP99 = new Gauge({\n\t\tname: namePrefix + NODEJS_EVENTLOOP_LAG_P99,\n\t\thelp: 'The 99th percentile of the recorded event loop delays.',\n\t\tregisters,\n\t\tlabelNames,\n\t\taggregator: 'average',\n\t});\n};\n\nmodule.exports.metricNames = [\n\tNODEJS_EVENTLOOP_LAG,\n\tNODEJS_EVENTLOOP_LAG_MIN,\n\tNODEJS_EVENTLOOP_LAG_MAX,\n\tNODEJS_EVENTLOOP_LAG_MEAN,\n\tNODEJS_EVENTLOOP_LAG_STDDEV,\n\tNODEJS_EVENTLOOP_LAG_P50,\n\tNODEJS_EVENTLOOP_LAG_P90,\n\tNODEJS_EVENTLOOP_LAG_P99,\n];\n","'use strict';\n\nfunction aggregateByObjectName(list) {\n\tconst data = {};\n\n\tfor (let i = 0; i < list.length; i++) {\n\t\tconst listElement = list[i];\n\n\t\tif (!listElement || typeof listElement.constructor === 'undefined') {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (Object.hasOwnProperty.call(data, listElement.constructor.name)) {\n\t\t\tdata[listElement.constructor.name] += 1;\n\t\t} else {\n\t\t\tdata[listElement.constructor.name] = 1;\n\t\t}\n\t}\n\treturn data;\n}\n\nfunction updateMetrics(gauge, data, labels) {\n\tgauge.reset();\n\tfor (const key in data) {\n\t\tgauge.set(Object.assign({ type: key }, labels || {}), data[key]);\n\t}\n}\n\nmodule.exports = {\n\taggregateByObjectName,\n\tupdateMetrics,\n};\n","'use strict';\n\nconst { aggregateByObjectName } = require('./helpers/processMetricsHelpers');\nconst { updateMetrics } = require('./helpers/processMetricsHelpers');\nconst Gauge = require('../gauge');\n\nconst NODEJS_ACTIVE_HANDLES = 'nodejs_active_handles';\nconst NODEJS_ACTIVE_HANDLES_TOTAL = 'nodejs_active_handles_total';\n\nmodule.exports = (registry, config = {}) => {\n\t// Don't do anything if the function is removed in later nodes (exists in node@6-12...)\n\tif (typeof process._getActiveHandles !== 'function') {\n\t\treturn;\n\t}\n\n\tconst registers = registry ? [registry] : undefined;\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tnew Gauge({\n\t\tname: namePrefix + NODEJS_ACTIVE_HANDLES,\n\t\thelp: 'Number of active libuv handles grouped by handle type. Every handle type is C++ class name.',\n\t\tlabelNames: ['type', ...labelNames],\n\t\tregisters,\n\t\tcollect() {\n\t\t\tconst handles = process._getActiveHandles();\n\t\t\tupdateMetrics(this, aggregateByObjectName(handles), labels);\n\t\t},\n\t});\n\tnew Gauge({\n\t\tname: namePrefix + NODEJS_ACTIVE_HANDLES_TOTAL,\n\t\thelp: 'Total number of active handles.',\n\t\tregisters,\n\t\tlabelNames,\n\t\tcollect() {\n\t\t\tconst handles = process._getActiveHandles();\n\t\t\tthis.set(labels, handles.length);\n\t\t},\n\t});\n};\n\nmodule.exports.metricNames = [\n\tNODEJS_ACTIVE_HANDLES,\n\tNODEJS_ACTIVE_HANDLES_TOTAL,\n];\n","'use strict';\nconst Gauge = require('../gauge');\nconst { aggregateByObjectName } = require('./helpers/processMetricsHelpers');\nconst { updateMetrics } = require('./helpers/processMetricsHelpers');\n\nconst NODEJS_ACTIVE_REQUESTS = 'nodejs_active_requests';\nconst NODEJS_ACTIVE_REQUESTS_TOTAL = 'nodejs_active_requests_total';\n\nmodule.exports = (registry, config = {}) => {\n\t// Don't do anything if the function is removed in later nodes (exists in node@6)\n\tif (typeof process._getActiveRequests !== 'function') {\n\t\treturn;\n\t}\n\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tnew Gauge({\n\t\tname: namePrefix + NODEJS_ACTIVE_REQUESTS,\n\t\thelp: 'Number of active libuv requests grouped by request type. Every request type is C++ class name.',\n\t\tlabelNames: ['type', ...labelNames],\n\t\tregisters: registry ? [registry] : undefined,\n\t\tcollect() {\n\t\t\tconst requests = process._getActiveRequests();\n\t\t\tupdateMetrics(this, aggregateByObjectName(requests), labels);\n\t\t},\n\t});\n\n\tnew Gauge({\n\t\tname: namePrefix + NODEJS_ACTIVE_REQUESTS_TOTAL,\n\t\thelp: 'Total number of active requests.',\n\t\tregisters: registry ? [registry] : undefined,\n\t\tlabelNames,\n\t\tcollect() {\n\t\t\tconst requests = process._getActiveRequests();\n\t\t\tthis.set(labels, requests.length);\n\t\t},\n\t});\n};\n\nmodule.exports.metricNames = [\n\tNODEJS_ACTIVE_REQUESTS,\n\tNODEJS_ACTIVE_REQUESTS_TOTAL,\n];\n","'use strict';\nconst Gauge = require('../gauge');\nconst { updateMetrics } = require('./helpers/processMetricsHelpers');\n\nconst NODEJS_ACTIVE_RESOURCES = 'nodejs_active_resources';\nconst NODEJS_ACTIVE_RESOURCES_TOTAL = 'nodejs_active_resources_total';\n\nmodule.exports = (registry, config = {}) => {\n\t// Don't do anything if the function does not exist in previous nodes (exists in node@17.3.0)\n\tif (typeof process.getActiveResourcesInfo !== 'function') {\n\t\treturn;\n\t}\n\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tnew Gauge({\n\t\tname: namePrefix + NODEJS_ACTIVE_RESOURCES,\n\t\thelp: 'Number of active resources that are currently keeping the event loop alive, grouped by async resource type.',\n\t\tlabelNames: ['type', ...labelNames],\n\t\tregisters: registry ? [registry] : undefined,\n\t\tcollect() {\n\t\t\tconst resources = process.getActiveResourcesInfo();\n\n\t\t\tconst data = {};\n\n\t\t\tfor (let i = 0; i < resources.length; i++) {\n\t\t\t\tconst resource = resources[i];\n\n\t\t\t\tif (Object.hasOwn(data, resource)) {\n\t\t\t\t\tdata[resource] += 1;\n\t\t\t\t} else {\n\t\t\t\t\tdata[resource] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tupdateMetrics(this, data, labels);\n\t\t},\n\t});\n\n\tnew Gauge({\n\t\tname: namePrefix + NODEJS_ACTIVE_RESOURCES_TOTAL,\n\t\thelp: 'Total number of active resources.',\n\t\tregisters: registry ? [registry] : undefined,\n\t\tlabelNames,\n\t\tcollect() {\n\t\t\tconst resources = process.getActiveResourcesInfo();\n\t\t\tthis.set(labels, resources.length);\n\t\t},\n\t});\n};\n\nmodule.exports.metricNames = [\n\tNODEJS_ACTIVE_RESOURCES,\n\tNODEJS_ACTIVE_RESOURCES_TOTAL,\n];\n","'use strict';\n\nconst Gauge = require('../gauge');\nconst safeMemoryUsage = require('./helpers/safeMemoryUsage');\n\nconst NODEJS_HEAP_SIZE_TOTAL = 'nodejs_heap_size_total_bytes';\nconst NODEJS_HEAP_SIZE_USED = 'nodejs_heap_size_used_bytes';\nconst NODEJS_EXTERNAL_MEMORY = 'nodejs_external_memory_bytes';\n\nmodule.exports = (registry, config = {}) => {\n\tif (typeof process.memoryUsage !== 'function') {\n\t\treturn;\n\t}\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tconst registers = registry ? [registry] : undefined;\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst collect = () => {\n\t\tconst memUsage = safeMemoryUsage();\n\t\tif (memUsage) {\n\t\t\theapSizeTotal.set(labels, memUsage.heapTotal);\n\t\t\theapSizeUsed.set(labels, memUsage.heapUsed);\n\t\t\tif (memUsage.external !== undefined) {\n\t\t\t\texternalMemUsed.set(labels, memUsage.external);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst heapSizeTotal = new Gauge({\n\t\tname: namePrefix + NODEJS_HEAP_SIZE_TOTAL,\n\t\thelp: 'Process heap size from Node.js in bytes.',\n\t\tregisters,\n\t\tlabelNames,\n\t\t// Use this one metric's `collect` to set all metrics' values.\n\t\tcollect,\n\t});\n\tconst heapSizeUsed = new Gauge({\n\t\tname: namePrefix + NODEJS_HEAP_SIZE_USED,\n\t\thelp: 'Process heap size used from Node.js in bytes.',\n\t\tregisters,\n\t\tlabelNames,\n\t});\n\tconst externalMemUsed = new Gauge({\n\t\tname: namePrefix + NODEJS_EXTERNAL_MEMORY,\n\t\thelp: 'Node.js external memory size in bytes.',\n\t\tregisters,\n\t\tlabelNames,\n\t});\n};\n\nmodule.exports.metricNames = [\n\tNODEJS_HEAP_SIZE_TOTAL,\n\tNODEJS_HEAP_SIZE_USED,\n\tNODEJS_EXTERNAL_MEMORY,\n];\n","'use strict';\n\nconst Gauge = require('../gauge');\nconst v8 = require('v8');\n\nconst METRICS = ['total', 'used', 'available'];\nconst NODEJS_HEAP_SIZE = {};\n\nMETRICS.forEach(metricType => {\n\tNODEJS_HEAP_SIZE[metricType] = `nodejs_heap_space_size_${metricType}_bytes`;\n});\n\nmodule.exports = (registry, config = {}) => {\n\ttry {\n\t\tv8.getHeapSpaceStatistics();\n\t} catch (e) {\n\t\tif (e.code === 'ERR_NOT_IMPLEMENTED') {\n\t\t\treturn; // Bun\n\t\t}\n\t\tthrow e;\n\t}\n\tconst registers = registry ? [registry] : undefined;\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = ['space', ...Object.keys(labels)];\n\n\tconst gauges = {};\n\n\tMETRICS.forEach(metricType => {\n\t\tgauges[metricType] = new Gauge({\n\t\t\tname: namePrefix + NODEJS_HEAP_SIZE[metricType],\n\t\t\thelp: `Process heap space size ${metricType} from Node.js in bytes.`,\n\t\t\tlabelNames,\n\t\t\tregisters,\n\t\t});\n\t});\n\n\t// Use this one metric's `collect` to set all metrics' values.\n\tgauges.total.collect = () => {\n\t\tfor (const space of v8.getHeapSpaceStatistics()) {\n\t\t\tconst spaceName = space.space_name.substr(\n\t\t\t\t0,\n\t\t\t\tspace.space_name.indexOf('_space'),\n\t\t\t);\n\n\t\t\tgauges.total.set({ space: spaceName, ...labels }, space.space_size);\n\t\t\tgauges.used.set({ space: spaceName, ...labels }, space.space_used_size);\n\t\t\tgauges.available.set(\n\t\t\t\t{ space: spaceName, ...labels },\n\t\t\t\tspace.space_available_size,\n\t\t\t);\n\t\t}\n\t};\n};\n\nmodule.exports.metricNames = Object.values(NODEJS_HEAP_SIZE);\n","'use strict';\n\nconst Gauge = require('../gauge');\nconst version = process.version;\nconst versionSegments = version.slice(1).split('.').map(Number);\n\nconst NODE_VERSION_INFO = 'nodejs_version_info';\n\nmodule.exports = (registry, config = {}) => {\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\n\tnew Gauge({\n\t\tname: namePrefix + NODE_VERSION_INFO,\n\t\thelp: 'Node.js version info.',\n\t\tlabelNames: ['version', 'major', 'minor', 'patch', ...labelNames],\n\t\tregisters: registry ? [registry] : undefined,\n\t\taggregator: 'first',\n\t\tcollect() {\n\t\t\t// Needs to be in collect() so value is present even if reg is reset\n\t\t\tthis.labels(\n\t\t\t\tversion,\n\t\t\t\tversionSegments[0],\n\t\t\t\tversionSegments[1],\n\t\t\t\tversionSegments[2],\n\t\t\t\t...Object.values(labels),\n\t\t\t).set(1);\n\t\t},\n\t});\n};\n\nmodule.exports.metricNames = [NODE_VERSION_INFO];\n","'use strict';\nconst Histogram = require('../histogram');\n\nlet perf_hooks;\n\ntry {\n\t// eslint-disable-next-line\n\tperf_hooks = require('perf_hooks');\n} catch {\n\t// node version is too old\n}\n\nconst NODEJS_GC_DURATION_SECONDS = 'nodejs_gc_duration_seconds';\nconst DEFAULT_GC_DURATION_BUCKETS = [0.001, 0.01, 0.1, 1, 2, 5];\n\nconst kinds = [];\n\nif (perf_hooks && perf_hooks.constants) {\n\tkinds[perf_hooks.constants.NODE_PERFORMANCE_GC_MAJOR] = 'major';\n\tkinds[perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR] = 'minor';\n\tkinds[perf_hooks.constants.NODE_PERFORMANCE_GC_INCREMENTAL] = 'incremental';\n\tkinds[perf_hooks.constants.NODE_PERFORMANCE_GC_WEAKCB] = 'weakcb';\n}\n\nmodule.exports = (registry, config = {}) => {\n\tif (!perf_hooks) {\n\t\treturn;\n\t}\n\n\tconst namePrefix = config.prefix ? config.prefix : '';\n\tconst labels = config.labels ? config.labels : {};\n\tconst labelNames = Object.keys(labels);\n\tconst buckets = config.gcDurationBuckets\n\t\t? config.gcDurationBuckets\n\t\t: DEFAULT_GC_DURATION_BUCKETS;\n\tconst gcHistogram = new Histogram({\n\t\tname: namePrefix + NODEJS_GC_DURATION_SECONDS,\n\t\thelp: 'Garbage collection duration by kind, one of major, minor, incremental or weakcb.',\n\t\tlabelNames: ['kind', ...labelNames],\n\t\tenableExemplars: false,\n\t\tbuckets,\n\t\tregisters: registry ? [registry] : undefined,\n\t});\n\n\tconst obs = new perf_hooks.PerformanceObserver(list => {\n\t\tconst entry = list.getEntries()[0];\n\t\t// Node < 16 uses entry.kind\n\t\t// Node >= 16 uses entry.detail.kind\n\t\t// See: https://nodejs.org/docs/latest-v16.x/api/deprecations.html#deprecations_dep0152_extension_performanceentry_properties\n\t\tconst kind = entry.detail ? kinds[entry.detail.kind] : kinds[entry.kind];\n\t\t// Convert duration from milliseconds to seconds\n\t\tgcHistogram.observe(Object.assign({ kind }, labels), entry.duration / 1000);\n\t});\n\n\tobs.observe({ entryTypes: ['gc'] });\n};\n\nmodule.exports.metricNames = [NODEJS_GC_DURATION_SECONDS];\n","'use strict';\n\nconst { isObject } = require('./util');\n\n// Default metrics.\nconst processCpuTotal = require('./metrics/processCpuTotal');\nconst processStartTime = require('./metrics/processStartTime');\nconst osMemoryHeap = require('./metrics/osMemoryHeap');\nconst processOpenFileDescriptors = require('./metrics/processOpenFileDescriptors');\nconst processMaxFileDescriptors = require('./metrics/processMaxFileDescriptors');\nconst eventLoopLag = require('./metrics/eventLoopLag');\nconst processHandles = require('./metrics/processHandles');\nconst processRequests = require('./metrics/processRequests');\nconst processResources = require('./metrics/processResources');\nconst heapSizeAndUsed = require('./metrics/heapSizeAndUsed');\nconst heapSpacesSizeAndUsed = require('./metrics/heapSpacesSizeAndUsed');\nconst version = require('./metrics/version');\nconst gc = require('./metrics/gc');\n\nconst metrics = {\n\tprocessCpuTotal,\n\tprocessStartTime,\n\tosMemoryHeap,\n\tprocessOpenFileDescriptors,\n\tprocessMaxFileDescriptors,\n\teventLoopLag,\n\t...(typeof process.getActiveResourcesInfo === 'function'\n\t\t? { processResources }\n\t\t: {}),\n\tprocessHandles,\n\tprocessRequests,\n\theapSizeAndUsed,\n\theapSpacesSizeAndUsed,\n\tversion,\n\tgc,\n};\nconst metricsList = Object.keys(metrics);\n\nmodule.exports = function collectDefaultMetrics(config) {\n\tif (config !== null && config !== undefined && !isObject(config)) {\n\t\tthrow new TypeError('config must be null, undefined, or an object');\n\t}\n\n\tconfig = { eventLoopMonitoringPrecision: 10, ...config };\n\n\tfor (const metric of Object.values(metrics)) {\n\t\tmetric(config.register, config);\n\t}\n};\n\nmodule.exports.metricsList = metricsList;\n","'use strict';\n\nconst { Grouper, hashObject } = require('./util');\n\n/**\n * Returns a new function that applies the `aggregatorFn` to the values.\n * @param {Function} aggregatorFn function to apply to values.\n * @return {Function} aggregator function\n */\nfunction AggregatorFactory(aggregatorFn) {\n\treturn metrics => {\n\t\tif (metrics.length === 0) return;\n\t\tconst result = {\n\t\t\thelp: metrics[0].help,\n\t\t\tname: metrics[0].name,\n\t\t\ttype: metrics[0].type,\n\t\t\tvalues: [],\n\t\t\taggregator: metrics[0].aggregator,\n\t\t};\n\t\t// Gather metrics by metricName and labels.\n\t\tconst byLabels = new Grouper();\n\t\tmetrics.forEach(metric => {\n\t\t\tmetric.values.forEach(value => {\n\t\t\t\tconst key = hashObject(value.labels);\n\t\t\t\tbyLabels.add(`${value.metricName}_${key}`, value);\n\t\t\t});\n\t\t});\n\t\t// Apply aggregator function to gathered metrics.\n\t\tbyLabels.forEach(values => {\n\t\t\tif (values.length === 0) return;\n\t\t\tconst valObj = {\n\t\t\t\tvalue: aggregatorFn(values),\n\t\t\t\tlabels: values[0].labels,\n\t\t\t};\n\t\t\tif (values[0].metricName) {\n\t\t\t\tvalObj.metricName = values[0].metricName;\n\t\t\t}\n\t\t\t// NB: Timestamps are omitted.\n\t\t\tresult.values.push(valObj);\n\t\t});\n\t\treturn result;\n\t};\n}\n// Export for users to define their own aggregation methods.\nexports.AggregatorFactory = AggregatorFactory;\n\n/**\n * Functions that can be used to aggregate metrics from multiple registries.\n */\nexports.aggregators = {\n\t/**\n\t * @return The sum of values.\n\t */\n\tsum: AggregatorFactory(v => v.reduce((p, c) => p + c.value, 0)),\n\t/**\n\t * @return The first value.\n\t */\n\tfirst: AggregatorFactory(v => v[0].value),\n\t/**\n\t * @return {undefined} Undefined; omits the metric.\n\t */\n\tomit: () => {},\n\t/**\n\t * @return The arithmetic mean of the values.\n\t */\n\taverage: AggregatorFactory(\n\t\tv => v.reduce((p, c) => p + c.value, 0) / v.length,\n\t),\n\t/**\n\t * @return The minimum of the values.\n\t */\n\tmin: AggregatorFactory(v =>\n\t\tv.reduce((p, c) => Math.min(p, c.value), Infinity),\n\t),\n\t/**\n\t * @return The maximum of the values.\n\t */\n\tmax: AggregatorFactory(v =>\n\t\tv.reduce((p, c) => Math.max(p, c.value), -Infinity),\n\t),\n};\n","'use strict';\n\n/**\n * Extends the Registry class with a `clusterMetrics` method that returns\n * aggregated metrics for all workers.\n *\n * In cluster workers, listens for and responds to requests for metrics by the\n * cluster master.\n */\n\nconst Registry = require('./registry');\nconst { Grouper } = require('./util');\nconst { aggregators } = require('./metricAggregators');\n// We need to lazy-load the 'cluster' module as some application servers -\n// namely Passenger - crash when it is imported.\nlet cluster = () => {\n\tconst data = require('cluster');\n\tcluster = () => data;\n\treturn data;\n};\n\nconst GET_METRICS_REQ = 'prom-client:getMetricsReq';\nconst GET_METRICS_RES = 'prom-client:getMetricsRes';\n\nlet registries = [Registry.globalRegistry];\nlet requestCtr = 0; // Concurrency control\nlet listenersAdded = false;\nconst requests = new Map(); // Pending requests for workers' local metrics.\n\nclass AggregatorRegistry extends Registry {\n\tconstructor(regContentType = Registry.PROMETHEUS_CONTENT_TYPE) {\n\t\tsuper(regContentType);\n\t\taddListeners();\n\t}\n\n\t/**\n\t * Gets aggregated metrics for all workers. The optional callback and\n\t * returned Promise resolve with the same value; either may be used.\n\t * @return {Promise<string>} Promise that resolves with the aggregated\n\t * metrics.\n\t */\n\tclusterMetrics() {\n\t\tconst requestId = requestCtr++;\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlet settled = false;\n\t\t\tfunction done(err, result) {\n\t\t\t\tif (settled) return;\n\t\t\t\tsettled = true;\n\t\t\t\tif (err) reject(err);\n\t\t\t\telse resolve(result);\n\t\t\t}\n\n\t\t\tconst request = {\n\t\t\t\tresponses: [],\n\t\t\t\tpending: 0,\n\t\t\t\tdone,\n\t\t\t\terrorTimeout: setTimeout(() => {\n\t\t\t\t\tconst err = new Error('Operation timed out.');\n\t\t\t\t\trequest.done(err);\n\t\t\t\t}, 5000),\n\t\t\t};\n\t\t\trequests.set(requestId, request);\n\n\t\t\tconst message = {\n\t\t\t\ttype: GET_METRICS_REQ,\n\t\t\t\trequestId,\n\t\t\t};\n\n\t\t\tfor (const id in cluster().workers) {\n\t\t\t\t// If the worker exits abruptly, it may still be in the workers\n\t\t\t\t// list but not able to communicate.\n\t\t\t\tif (cluster().workers[id].isConnected()) {\n\t\t\t\t\tcluster().workers[id].send(message);\n\t\t\t\t\trequest.pending++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (request.pending === 0) {\n\t\t\t\t// No workers were up\n\t\t\t\tclearTimeout(request.errorTimeout);\n\t\t\t\tprocess.nextTick(() => done(null, ''));\n\t\t\t}\n\t\t});\n\t}\n\n\tget contentType() {\n\t\treturn super.contentType;\n\t}\n\n\t/**\n\t * Creates a new Registry instance from an array of metrics that were\n\t * created by `registry.getMetricsAsJSON()`. Metrics are aggregated using\n\t * the method specified by their `aggregator` property, or by summation if\n\t * `aggregator` is undefined.\n\t * @param {Array} metricsArr Array of metrics, each of which created by\n\t * `registry.getMetricsAsJSON()`.\n\t * @param {string} registryType content type of the new registry. Defaults\n\t * to PROMETHEUS_CONTENT_TYPE.\n\t * @return {Registry} aggregated registry.\n\t */\n\tstatic aggregate(\n\t\tmetricsArr,\n\t\tregistryType = Registry.PROMETHEUS_CONTENT_TYPE,\n\t) {\n\t\tconst aggregatedRegistry = new Registry();\n\t\tconst metricsByName = new Grouper();\n\n\t\taggregatedRegistry.setContentType(registryType);\n\n\t\t// Gather by name\n\t\tmetricsArr.forEach(metrics => {\n\t\t\tmetrics.forEach(metric => {\n\t\t\t\tmetricsByName.add(metric.name, metric);\n\t\t\t});\n\t\t});\n\n\t\t// Aggregate gathered metrics.\n\t\tmetricsByName.forEach(metrics => {\n\t\t\tconst aggregatorName = metrics[0].aggregator;\n\t\t\tconst aggregatorFn = aggregators[aggregatorName];\n\t\t\tif (typeof aggregatorFn !== 'function') {\n\t\t\t\tthrow new Error(`'${aggregatorName}' is not a defined aggregator.`);\n\t\t\t}\n\t\t\tconst aggregatedMetric = aggregatorFn(metrics);\n\t\t\t// NB: The 'omit' aggregator returns undefined.\n\t\t\tif (aggregatedMetric) {\n\t\t\t\tconst aggregatedMetricWrapper = Object.assign(\n\t\t\t\t\t{\n\t\t\t\t\t\tget: () => aggregatedMetric,\n\t\t\t\t\t},\n\t\t\t\t\taggregatedMetric,\n\t\t\t\t);\n\t\t\t\taggregatedRegistry.registerMetric(aggregatedMetricWrapper);\n\t\t\t}\n\t\t});\n\n\t\treturn aggregatedRegistry;\n\t}\n\n\t/**\n\t * Sets the registry or registries to be aggregated. Call from workers to\n\t * use a registry/registries other than the default global registry.\n\t * @param {Array<Registry>|Registry} regs Registry or registries to be\n\t * aggregated.\n\t * @return {void}\n\t */\n\tstatic setRegistries(regs) {\n\t\tif (!Array.isArray(regs)) regs = [regs];\n\t\tregs.forEach(reg => {\n\t\t\tif (!(reg instanceof Registry)) {\n\t\t\t\tthrow new TypeError(`Expected Registry, got ${typeof reg}`);\n\t\t\t}\n\t\t});\n\t\tregistries = regs;\n\t}\n}\n\n/**\n * Adds event listeners for cluster aggregation. Idempotent (safe to call more\n * than once).\n * @return {void}\n */\nfunction addListeners() {\n\tif (listenersAdded) return;\n\tlistenersAdded = true;\n\n\tif (cluster().isMaster) {\n\t\t// Listen for worker responses to requests for local metrics\n\t\tcluster().on('message', (worker, message) => {\n\t\t\tif (message.type === GET_METRICS_RES) {\n\t\t\t\tconst request = requests.get(message.requestId);\n\n\t\t\t\tif (message.error) {\n\t\t\t\t\trequest.done(new Error(message.error));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tmessage.metrics.forEach(registry => request.responses.push(registry));\n\t\t\t\trequest.pending--;\n\n\t\t\t\tif (request.pending === 0) {\n\t\t\t\t\t// finalize\n\t\t\t\t\trequests.delete(message.requestId);\n\t\t\t\t\tclearTimeout(request.errorTimeout);\n\n\t\t\t\t\tconst registry = AggregatorRegistry.aggregate(request.responses);\n\t\t\t\t\tconst promString = registry.metrics();\n\t\t\t\t\trequest.done(null, promString);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\tif (cluster().isWorker) {\n\t\t// Respond to master's requests for worker's local metrics.\n\t\tprocess.on('message', message => {\n\t\t\tif (message.type === GET_METRICS_REQ) {\n\t\t\t\tPromise.all(registries.map(r => r.getMetricsAsJSON()))\n\t\t\t\t\t.then(metrics => {\n\t\t\t\t\t\tprocess.send({\n\t\t\t\t\t\t\ttype: GET_METRICS_RES,\n\t\t\t\t\t\t\trequestId: message.requestId,\n\t\t\t\t\t\t\tmetrics,\n\t\t\t\t\t\t});\n\t\t\t\t\t})\n\t\t\t\t\t.catch(error => {\n\t\t\t\t\t\tprocess.send({\n\t\t\t\t\t\t\ttype: GET_METRICS_RES,\n\t\t\t\t\t\t\trequestId: message.requestId,\n\t\t\t\t\t\t\terror: error.message,\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n}\n\nmodule.exports = AggregatorRegistry;\n","/**\n * Prometheus client\n * @module Prometheus client\n */\n\n'use strict';\n\nexports.register = require('./lib/registry').globalRegistry;\nexports.Registry = require('./lib/registry');\nObject.defineProperty(exports, 'contentType', {\n\tconfigurable: false,\n\tenumerable: true,\n\tget() {\n\t\treturn exports.register.contentType;\n\t},\n\tset(value) {\n\t\texports.register.setContentType(value);\n\t},\n});\nexports.prometheusContentType = exports.Registry.PROMETHEUS_CONTENT_TYPE;\nexports.openMetricsContentType = exports.Registry.OPENMETRICS_CONTENT_TYPE;\nexports.validateMetricName = require('./lib/validation').validateMetricName;\n\nexports.Counter = require('./lib/counter');\nexports.Gauge = require('./lib/gauge');\nexports.Histogram = require('./lib/histogram');\nexports.Summary = require('./lib/summary');\nexports.Pushgateway = require('./lib/pushgateway');\n\nexports.linearBuckets = require('./lib/bucketGenerators').linearBuckets;\nexports.exponentialBuckets =\n\trequire('./lib/bucketGenerators').exponentialBuckets;\n\nexports.collectDefaultMetrics = require('./lib/defaultMetrics');\n\nexports.aggregators = require('./lib/metricAggregators').aggregators;\nexports.AggregatorRegistry = require('./lib/cluster');\n","import { $hook, $inject, Alepha } from \"alepha\";\nimport { $route } from \"alepha/server\";\nimport { collectDefaultMetrics, Histogram, Registry } from \"prom-client\";\n\nexport class ServerMetricsProvider {\n protected readonly register: Registry = new Registry();\n protected readonly alepha = $inject(Alepha);\n protected httpRequestDuration?: Histogram<string>;\n\n public readonly options: ServerMetricsProviderOptions = {};\n\n public readonly metrics = $route({\n method: \"GET\",\n path: \"/metrics\",\n silent: true,\n handler: () => this.register.metrics(),\n });\n\n protected readonly onStart = $hook({\n on: \"start\",\n handler: () => {\n collectDefaultMetrics({\n register: this.register,\n ...this.options,\n });\n this.httpRequestDuration = new Histogram({\n name: \"http_request_duration_seconds\",\n help: \"Duration of HTTP requests in seconds\",\n labelNames: [\"method\", \"path\", \"code\"],\n registers: [this.register],\n });\n },\n });\n\n protected readonly onRequest = $hook({\n on: \"server:onRequest\",\n priority: \"first\",\n handler: ({ request }) => {\n const end = this.httpRequestDuration?.startTimer();\n request.metadata.metricsTimer = end;\n },\n });\n\n protected readonly onResponse = $hook({\n on: \"server:onResponse\",\n priority: \"last\",\n handler: ({ request, response, route }) => {\n const timerEnd = request.metadata.metricsTimer as\n | MetricsTimerEnd\n | undefined;\n\n if (timerEnd) {\n timerEnd({\n method: request.method,\n path: route.path,\n code: response.status,\n });\n }\n },\n });\n}\n\nexport interface ServerMetricsProviderOptions {\n prefix?: string;\n gcDurationBuckets?: number[];\n eventLoopMonitoringPrecision?: number;\n labels?: object;\n}\n\ntype MetricsTimerEnd = (labels?: Record<string, string | number>) => number;\n","import { $module } from \"alepha\";\nimport { AlephaServer } from \"alepha/server\";\nimport { ServerMetricsProvider } from \"./providers/ServerMetricsProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./providers/ServerMetricsProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * This module provides prometheus metrics for the Alepha server.\n * Metrics are exposed at the `/metrics` endpoint.\n *\n * @see {@link ServerMetricsProvider}\n * @module alepha.server.metrics\n */\nexport const AlephaServerMetrics = $module({\n name: \"alepha.server.metrics\",\n services: [AlephaServer, ServerMetricsProvider],\n});\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAQ,mBAAmB,SAAS,eAAe,OAAO;AACzD,MAAI,OAAO,MAAM,MAAM,CACtB,QAAO;WACG,CAAC,OAAO,SAAS,MAAM,CACjC,KAAI,QAAQ,EACX,QAAO;MAEP,QAAO;MAGR,QAAO,GAAG;;AAIZ,SAAQ,eAAe,SAAS,aAC/B,SACA,QACA,kBACC;EACD,MAAM,OAAO,WAAW,QAAQ,iBAAiB;AACjD,SAAO,QAAQ;;AAGhB,SAAQ,WAAW,SAAS,SAAS,SAAS,OAAO,QAAQ;EAC5D,MAAM,OAAO,WAAW,OAAO;AAC/B,UAAQ,QA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