dd-trace 5.79.0 → 5.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/LICENSE-3rdparty.csv +79 -87
  2. package/ext/tags.d.ts +1 -0
  3. package/ext/tags.js +1 -0
  4. package/index.d.ts +46 -39
  5. package/initialize.mjs +10 -10
  6. package/loader-hook.mjs +10 -3
  7. package/package.json +23 -40
  8. package/packages/datadog-core/src/storage.js +4 -4
  9. package/packages/datadog-esbuild/index.js +36 -19
  10. package/packages/datadog-esbuild/src/utils.js +5 -1
  11. package/packages/datadog-instrumentations/index.js +1 -0
  12. package/packages/datadog-instrumentations/src/anthropic.js +12 -0
  13. package/packages/datadog-instrumentations/src/aws-sdk.js +13 -2
  14. package/packages/datadog-instrumentations/src/azure-service-bus.js +43 -36
  15. package/packages/datadog-instrumentations/src/cucumber.js +2 -2
  16. package/packages/datadog-instrumentations/src/find-my-way.js +6 -5
  17. package/packages/datadog-instrumentations/src/google-genai.js +120 -0
  18. package/packages/datadog-instrumentations/src/graphql.js +20 -0
  19. package/packages/datadog-instrumentations/src/helpers/hook.js +1 -0
  20. package/packages/datadog-instrumentations/src/helpers/hooks.js +1 -0
  21. package/packages/datadog-instrumentations/src/helpers/instrument.js +12 -1
  22. package/packages/datadog-instrumentations/src/helpers/register.js +6 -1
  23. package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +27 -0
  24. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +152 -0
  25. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +5 -0
  26. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/langchain.js +237 -0
  27. package/packages/datadog-instrumentations/src/helpers/rewriter/loader.js +9 -0
  28. package/packages/datadog-instrumentations/src/helpers/rewriter/loader.mjs +11 -0
  29. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +139 -0
  30. package/packages/datadog-instrumentations/src/jest.js +1 -1
  31. package/packages/datadog-instrumentations/src/langchain.js +3 -109
  32. package/packages/datadog-instrumentations/src/mocha/main.js +1 -1
  33. package/packages/datadog-instrumentations/src/mysql2.js +1 -1
  34. package/packages/datadog-instrumentations/src/playwright.js +65 -16
  35. package/packages/datadog-instrumentations/src/router.js +1 -1
  36. package/packages/datadog-instrumentations/src/selenium.js +3 -1
  37. package/packages/datadog-instrumentations/src/ws.js +35 -17
  38. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +3 -2
  39. package/packages/datadog-plugin-azure-service-bus/src/producer.js +14 -5
  40. package/packages/datadog-plugin-child_process/src/scrub-cmd-params.js +1 -1
  41. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +23 -2
  42. package/packages/datadog-plugin-cypress/src/plugin.js +1 -1
  43. package/packages/datadog-plugin-cypress/src/support.js +73 -31
  44. package/packages/datadog-plugin-google-genai/src/index.js +17 -0
  45. package/packages/datadog-plugin-google-genai/src/tracing.js +41 -0
  46. package/packages/datadog-plugin-graphql/src/tools/transforms.js +5 -4
  47. package/packages/datadog-plugin-jest/src/util.js +4 -3
  48. package/packages/datadog-plugin-kafkajs/src/consumer.js +2 -1
  49. package/packages/datadog-plugin-kafkajs/src/producer.js +3 -1
  50. package/packages/datadog-plugin-langchain/src/tracing.js +7 -3
  51. package/packages/datadog-plugin-next/src/index.js +11 -3
  52. package/packages/datadog-plugin-openai/src/stream-helpers.js +1 -1
  53. package/packages/datadog-shimmer/src/shimmer.js +2 -2
  54. package/packages/dd-trace/src/aiguard/sdk.js +29 -14
  55. package/packages/dd-trace/src/appsec/api_security_sampler.js +1 -1
  56. package/packages/dd-trace/src/appsec/iast/overhead-controller.js +1 -1
  57. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-esm.mjs +1 -1
  58. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +1 -2
  59. package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +1 -1
  60. package/packages/dd-trace/src/appsec/reporter.js +0 -4
  61. package/packages/dd-trace/src/baggage.js +11 -0
  62. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +4 -8
  63. package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +1 -1
  64. package/packages/dd-trace/src/ci-visibility/test-management/get-test-management-tests.js +4 -2
  65. package/packages/dd-trace/src/config.js +81 -7
  66. package/packages/dd-trace/src/config_defaults.js +15 -2
  67. package/packages/dd-trace/src/datastreams/encoding.js +23 -6
  68. package/packages/dd-trace/src/datastreams/pathway.js +40 -1
  69. package/packages/dd-trace/src/datastreams/processor.js +1 -1
  70. package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +1 -1
  71. package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +15 -5
  72. package/packages/dd-trace/src/debugger/devtools_client/condition.js +1 -1
  73. package/packages/dd-trace/src/debugger/devtools_client/config.js +2 -0
  74. package/packages/dd-trace/src/debugger/devtools_client/index.js +30 -15
  75. package/packages/dd-trace/src/debugger/devtools_client/inspector_promises_polyfill.js +2 -0
  76. package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +24 -18
  77. package/packages/dd-trace/src/debugger/devtools_client/send.js +18 -8
  78. package/packages/dd-trace/src/debugger/devtools_client/snapshot/collector.js +103 -15
  79. package/packages/dd-trace/src/debugger/devtools_client/snapshot/constants.js +25 -0
  80. package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +56 -25
  81. package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +64 -23
  82. package/packages/dd-trace/src/debugger/devtools_client/snapshot/symbols.js +3 -1
  83. package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +404 -0
  84. package/packages/dd-trace/src/debugger/devtools_client/source-maps.js +1 -1
  85. package/packages/dd-trace/src/debugger/devtools_client/state.js +7 -2
  86. package/packages/dd-trace/src/debugger/devtools_client/status.js +1 -1
  87. package/packages/dd-trace/src/debugger/index.js +1 -1
  88. package/packages/dd-trace/src/encode/0.4.js +3 -3
  89. package/packages/dd-trace/src/encode/coverage-ci-visibility.js +2 -2
  90. package/packages/dd-trace/src/encode/span-stats.js +7 -1
  91. package/packages/dd-trace/src/exporters/agent/writer.js +6 -13
  92. package/packages/dd-trace/src/histogram.js +1 -1
  93. package/packages/dd-trace/src/id.js +60 -0
  94. package/packages/dd-trace/src/lambda/runtime/ritm.js +2 -3
  95. package/packages/dd-trace/src/llmobs/constants/tags.js +1 -0
  96. package/packages/dd-trace/src/llmobs/index.js +5 -5
  97. package/packages/dd-trace/src/llmobs/noop.js +6 -0
  98. package/packages/dd-trace/src/llmobs/plugins/ai/index.js +1 -0
  99. package/packages/dd-trace/src/llmobs/plugins/genai/index.js +104 -0
  100. package/packages/dd-trace/src/llmobs/plugins/genai/util.js +486 -0
  101. package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +2 -2
  102. package/packages/dd-trace/src/llmobs/plugins/{openai.js → openai/index.js} +87 -39
  103. package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +114 -0
  104. package/packages/dd-trace/src/llmobs/sdk.js +10 -1
  105. package/packages/dd-trace/src/llmobs/span_processor.js +11 -6
  106. package/packages/dd-trace/src/llmobs/tagger.js +35 -17
  107. package/packages/dd-trace/src/msgpack/chunk.js +2 -2
  108. package/packages/dd-trace/src/msgpack/encoder.js +2 -3
  109. package/packages/dd-trace/src/msgpack/index.js +2 -2
  110. package/packages/dd-trace/src/openfeature/flagging_provider.js +5 -3
  111. package/packages/dd-trace/src/opentelemetry/logs/index.js +3 -3
  112. package/packages/dd-trace/src/opentelemetry/logs/logger.js +14 -8
  113. package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +6 -4
  114. package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +9 -17
  115. package/packages/dd-trace/src/opentelemetry/metrics/constants.js +34 -0
  116. package/packages/dd-trace/src/opentelemetry/metrics/index.js +81 -0
  117. package/packages/dd-trace/src/opentelemetry/metrics/instruments.js +225 -0
  118. package/packages/dd-trace/src/opentelemetry/metrics/meter.js +171 -0
  119. package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +54 -0
  120. package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +62 -0
  121. package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +251 -0
  122. package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +532 -0
  123. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +10 -18
  124. package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +36 -22
  125. package/packages/dd-trace/src/opentelemetry/otlp/protobuf_loader.js +2 -2
  126. package/packages/dd-trace/src/opentelemetry/span.js +1 -1
  127. package/packages/dd-trace/src/opentelemetry/tracer.js +1 -1
  128. package/packages/dd-trace/src/opentelemetry/tracer_provider.js +1 -1
  129. package/packages/dd-trace/src/payload-tagging/index.js +2 -2
  130. package/packages/dd-trace/src/plugin_manager.js +4 -2
  131. package/packages/dd-trace/src/plugins/database.js +1 -0
  132. package/packages/dd-trace/src/plugins/index.js +1 -0
  133. package/packages/dd-trace/src/plugins/plugin.js +7 -9
  134. package/packages/dd-trace/src/plugins/util/test.js +3 -3
  135. package/packages/dd-trace/src/plugins/util/url.js +119 -1
  136. package/packages/dd-trace/src/plugins/util/web.js +10 -41
  137. package/packages/dd-trace/src/process-tags/index.js +81 -0
  138. package/packages/dd-trace/src/profiling/config.js +1 -1
  139. package/packages/dd-trace/src/profiling/exporter_cli.js +7 -6
  140. package/packages/dd-trace/src/profiling/exporters/agent.js +1 -1
  141. package/packages/dd-trace/src/profiling/profilers/events.js +10 -1
  142. package/packages/dd-trace/src/proxy.js +5 -0
  143. package/packages/dd-trace/src/rate_limiter.js +1 -1
  144. package/packages/dd-trace/src/remote_config/manager.js +1 -1
  145. package/packages/dd-trace/src/require-package-json.js +1 -1
  146. package/packages/dd-trace/src/ritm.js +1 -1
  147. package/packages/dd-trace/src/service-naming/index.js +31 -4
  148. package/packages/dd-trace/src/service-naming/schemas/v0/web.js +4 -0
  149. package/packages/dd-trace/src/service-naming/schemas/v1/web.js +4 -0
  150. package/packages/dd-trace/src/{format.js → span_format.js} +9 -4
  151. package/packages/dd-trace/src/span_processor.js +16 -11
  152. package/packages/dd-trace/src/span_stats.js +15 -4
  153. package/packages/dd-trace/src/spanleak.js +1 -1
  154. package/packages/dd-trace/src/supported-configurations.json +13 -0
  155. package/packages/dd-trace/src/telemetry/dependencies.js +1 -1
  156. package/packages/dd-trace/src/telemetry/telemetry.js +11 -2
  157. package/vendor/dist/@datadog/sketches-js/LICENSE +39 -0
  158. package/vendor/dist/@datadog/sketches-js/index.js +1 -0
  159. package/vendor/dist/@datadog/source-map/LICENSE +28 -0
  160. package/vendor/dist/@datadog/source-map/index.js +1 -0
  161. package/vendor/dist/@isaacs/ttlcache/LICENSE +55 -0
  162. package/vendor/dist/@isaacs/ttlcache/index.js +1 -0
  163. package/vendor/dist/@opentelemetry/core/LICENSE +201 -0
  164. package/vendor/dist/@opentelemetry/core/index.js +1 -0
  165. package/vendor/dist/@opentelemetry/resources/LICENSE +201 -0
  166. package/vendor/dist/@opentelemetry/resources/index.js +1 -0
  167. package/vendor/dist/astring/LICENSE +19 -0
  168. package/vendor/dist/astring/index.js +1 -0
  169. package/vendor/dist/crypto-randomuuid/index.js +1 -0
  170. package/vendor/dist/escape-string-regexp/LICENSE +9 -0
  171. package/vendor/dist/escape-string-regexp/index.js +1 -0
  172. package/vendor/dist/esquery/LICENSE +24 -0
  173. package/vendor/dist/esquery/index.js +1 -0
  174. package/vendor/dist/ignore/LICENSE +21 -0
  175. package/vendor/dist/ignore/index.js +1 -0
  176. package/vendor/dist/istanbul-lib-coverage/LICENSE +24 -0
  177. package/vendor/dist/istanbul-lib-coverage/index.js +1 -0
  178. package/vendor/dist/jest-docblock/LICENSE +21 -0
  179. package/vendor/dist/jest-docblock/index.js +1 -0
  180. package/vendor/dist/jsonpath-plus/LICENSE +22 -0
  181. package/vendor/dist/jsonpath-plus/index.js +1 -0
  182. package/vendor/dist/limiter/LICENSE +19 -0
  183. package/vendor/dist/limiter/index.js +1 -0
  184. package/vendor/dist/lodash.sortby/LICENSE +47 -0
  185. package/vendor/dist/lodash.sortby/index.js +1 -0
  186. package/vendor/dist/lru-cache/LICENSE +15 -0
  187. package/vendor/dist/lru-cache/index.js +1 -0
  188. package/vendor/dist/meriyah/LICENSE +7 -0
  189. package/vendor/dist/meriyah/index.js +1 -0
  190. package/vendor/dist/module-details-from-path/LICENSE +21 -0
  191. package/vendor/dist/module-details-from-path/index.js +1 -0
  192. package/vendor/dist/mutexify/promise/LICENSE +21 -0
  193. package/vendor/dist/mutexify/promise/index.js +1 -0
  194. package/vendor/dist/opentracing/LICENSE +201 -0
  195. package/vendor/dist/opentracing/binary_carrier.d.ts +11 -0
  196. package/vendor/dist/opentracing/constants.d.ts +61 -0
  197. package/vendor/dist/opentracing/examples/demo/demo.d.ts +2 -0
  198. package/vendor/dist/opentracing/ext/tags.d.ts +90 -0
  199. package/vendor/dist/opentracing/functions.d.ts +20 -0
  200. package/vendor/dist/opentracing/global_tracer.d.ts +14 -0
  201. package/vendor/dist/opentracing/index.d.ts +12 -0
  202. package/vendor/dist/opentracing/index.js +1 -0
  203. package/vendor/dist/opentracing/mock_tracer/index.d.ts +5 -0
  204. package/vendor/dist/opentracing/mock_tracer/mock_context.d.ts +13 -0
  205. package/vendor/dist/opentracing/mock_tracer/mock_report.d.ts +16 -0
  206. package/vendor/dist/opentracing/mock_tracer/mock_span.d.ts +50 -0
  207. package/vendor/dist/opentracing/mock_tracer/mock_tracer.d.ts +26 -0
  208. package/vendor/dist/opentracing/noop.d.ts +8 -0
  209. package/vendor/dist/opentracing/reference.d.ts +33 -0
  210. package/vendor/dist/opentracing/span.d.ts +147 -0
  211. package/vendor/dist/opentracing/span_context.d.ts +26 -0
  212. package/vendor/dist/opentracing/test/api_compatibility.d.ts +16 -0
  213. package/vendor/dist/opentracing/test/mocktracer_implemenation.d.ts +3 -0
  214. package/vendor/dist/opentracing/test/noop_implementation.d.ts +4 -0
  215. package/vendor/dist/opentracing/test/opentracing_api.d.ts +3 -0
  216. package/vendor/dist/opentracing/test/unittest.d.ts +2 -0
  217. package/vendor/dist/opentracing/tracer.d.ts +127 -0
  218. package/vendor/dist/path-to-regexp/LICENSE +21 -0
  219. package/vendor/dist/path-to-regexp/index.js +1 -0
  220. package/vendor/dist/pprof-format/LICENSE +8 -0
  221. package/vendor/dist/pprof-format/index.js +1 -0
  222. package/vendor/dist/protobufjs/LICENSE +39 -0
  223. package/vendor/dist/protobufjs/index.js +1 -0
  224. package/vendor/dist/protobufjs/minimal/LICENSE +39 -0
  225. package/vendor/dist/protobufjs/minimal/index.js +1 -0
  226. package/vendor/dist/retry/LICENSE +21 -0
  227. package/vendor/dist/retry/index.js +1 -0
  228. package/vendor/dist/rfdc/LICENSE +15 -0
  229. package/vendor/dist/rfdc/index.js +1 -0
  230. package/vendor/dist/semifies/LICENSE +201 -0
  231. package/vendor/dist/semifies/index.js +1 -0
  232. package/vendor/dist/shell-quote/LICENSE +24 -0
  233. package/vendor/dist/shell-quote/index.js +1 -0
  234. package/vendor/dist/source-map/LICENSE +28 -0
  235. package/vendor/dist/source-map/index.js +1 -0
  236. package/vendor/dist/source-map/lib/util/LICENSE +28 -0
  237. package/vendor/dist/source-map/lib/util/index.js +1 -0
  238. package/vendor/dist/source-map/mappings.wasm +0 -0
  239. package/vendor/dist/tlhunter-sorted-set/LICENSE +21 -0
  240. package/vendor/dist/tlhunter-sorted-set/index.js +1 -0
  241. package/vendor/dist/ttl-set/LICENSE +21 -0
  242. package/vendor/dist/ttl-set/index.js +1 -0
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const { URL, format } = require('url')
4
- const uuid = require('crypto-randomuuid')
4
+ const uuid = require('../../../../vendor/dist/crypto-randomuuid')
5
5
  const { EventEmitter } = require('events')
6
6
  const tracerVersion = require('../../../../package.json').version
7
7
  const request = require('../exporters/common/request')
@@ -12,7 +12,7 @@ const fs = require('fs')
12
12
  * @typedef { import('module').Module } Module
13
13
  * @param {string} name
14
14
  * @param {Module} module
15
- * @return {Object} The parsed package.json
15
+ * @returns {Object} The parsed package.json
16
16
  */
17
17
  function requirePackageJson (name, module) {
18
18
  if (path.isAbsolute(name)) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  const path = require('path')
4
4
  const Module = require('module')
5
- const parse = require('module-details-from-path')
5
+ const parse = require('../../../vendor/dist/module-details-from-path')
6
6
  const dc = require('dc-polyfill')
7
7
  const { getEnvironmentVariable } = require('../../dd-trace/src/config-helper')
8
8
 
@@ -1,9 +1,16 @@
1
1
  'use strict'
2
2
 
3
3
  class SchemaManager {
4
- constructor () {
5
- this.schemas = {}
6
- this.configure({ spanAttributeSchema: 'v0', spanRemoveIntegrationFromService: false })
4
+ /**
5
+ * @type {object}
6
+ */
7
+ config = {
8
+ spanAttributeSchema: 'v0',
9
+ spanRemoveIntegrationFromService: false
10
+ }
11
+
12
+ schemas = {
13
+ v0: require('./schemas/v0'),
7
14
  }
8
15
 
9
16
  get schema () {
@@ -18,10 +25,24 @@ class SchemaManager {
18
25
  return this.config.spanRemoveIntegrationFromService && this.version === 'v0'
19
26
  }
20
27
 
28
+ /**
29
+ * @param {string} type
30
+ * @param {string} kind
31
+ * @param {string} plugin
32
+ * @param {object} opts
33
+ * @returns {string}
34
+ */
21
35
  opName (type, kind, plugin, opts) {
22
36
  return this.schema.getOpName(type, kind, plugin, opts)
23
37
  }
24
38
 
39
+ /**
40
+ * @param {string} type
41
+ * @param {string} kind
42
+ * @param {string} plugin
43
+ * @param {object} opts
44
+ * @returns {string}
45
+ */
25
46
  serviceName (type, kind, plugin, opts) {
26
47
  const schema = this.shouldUseConsistentServiceNaming
27
48
  ? this.schemas.v1
@@ -30,7 +51,13 @@ class SchemaManager {
30
51
  return schema.getServiceName(type, kind, plugin, { ...opts, tracerService: this.config.service })
31
52
  }
32
53
 
33
- configure (config = {}) {
54
+ /**
55
+ * @param {object} config
56
+ * @param {string} config.spanAttributeSchema
57
+ * @param {boolean} config.spanRemoveIntegrationFromService
58
+ * @param {string} [config.service]
59
+ */
60
+ configure (config) {
34
61
  const { spanAttributeSchema, spanRemoveIntegrationFromService } = config
35
62
 
36
63
  if (!this.schemas.v0 && spanAttributeSchema === 'v0') {
@@ -24,6 +24,10 @@ const web = {
24
24
  opName: () => 'http.request',
25
25
  serviceName: httpPluginClientService
26
26
  },
27
+ genai: {
28
+ opName: () => 'google_genai.request',
29
+ serviceName: ({ pluginConfig, tracerService }) => pluginConfig.service || tracerService
30
+ },
27
31
  aws: {
28
32
  opName: () => 'aws.request',
29
33
  serviceName: awsServiceV0
@@ -16,6 +16,10 @@ const web = {
16
16
  opName: () => 'http.client.request',
17
17
  serviceName: httpPluginClientService
18
18
  },
19
+ genai: {
20
+ opName: () => 'google_genai.request',
21
+ serviceName: ({ pluginConfig, tracerService }) => pluginConfig.service || tracerService
22
+ },
19
23
  fetch: {
20
24
  opName: () => 'http.client.request',
21
25
  serviceName: httpPluginClientService
@@ -5,6 +5,7 @@ const tags = require('../../../ext/tags')
5
5
  const id = require('./id')
6
6
  const { isError } = require('./util')
7
7
  const { registerExtraService } = require('./service-naming/extra-services')
8
+ const { TRACING_FIELD_NAME } = require('./process-tags')
8
9
 
9
10
  const SAMPLING_PRIORITY_KEY = constants.SAMPLING_PRIORITY_KEY
10
11
  const SAMPLING_RULE_DECISION = constants.SAMPLING_RULE_DECISION
@@ -32,13 +33,13 @@ const map = {
32
33
  'resource.name': 'resource'
33
34
  }
34
35
 
35
- function format (span, isChunkRoot) {
36
+ function format (span, isFirstSpanInChunk = false, tagForFirstSpanInChunk = false) {
36
37
  const formatted = formatSpan(span)
37
38
 
38
39
  extractSpanLinks(formatted, span)
39
40
  extractSpanEvents(formatted, span)
40
41
  extractRootTags(formatted, span)
41
- extractChunkTags(formatted, span, isChunkRoot)
42
+ extractChunkTags(formatted, span, isFirstSpanInChunk, tagForFirstSpanInChunk)
42
43
  extractTags(formatted, span)
43
44
 
44
45
  return formatted
@@ -192,10 +193,14 @@ function extractRootTags (formattedSpan, span) {
192
193
  addTag({}, formattedSpan.metrics, TOP_LEVEL_KEY, 1)
193
194
  }
194
195
 
195
- function extractChunkTags (formattedSpan, span, isChunkRoot) {
196
+ function extractChunkTags (formattedSpan, span, isFirstSpanInChunk, tagForFirstSpanInChunk) {
196
197
  const context = span.context()
197
198
 
198
- if (!isChunkRoot) return
199
+ if (!isFirstSpanInChunk) return
200
+
201
+ if (tagForFirstSpanInChunk) {
202
+ addTag(formattedSpan.meta, formattedSpan.metrics, TRACING_FIELD_NAME, tagForFirstSpanInChunk)
203
+ }
199
204
 
200
205
  for (const [key, value] of Object.entries(context._trace.tags)) {
201
206
  addTag(formattedSpan.meta, formattedSpan.metrics, key, value)
@@ -1,17 +1,15 @@
1
1
  'use strict'
2
2
 
3
3
  const log = require('./log')
4
- const format = require('./format')
4
+ const spanFormat = require('./span_format')
5
5
  const SpanSampler = require('./span_sampler')
6
6
  const GitMetadataTagger = require('./git_metadata_tagger')
7
7
  const { getEnvironmentVariable } = require('./config-helper')
8
+ const getProcessTags = require('./process-tags')
8
9
 
9
10
  const startedSpans = new WeakSet()
10
11
  const finishedSpans = new WeakSet()
11
12
 
12
- const { channel } = require('dc-polyfill')
13
- const spanProcessCh = channel('dd-trace:span:process')
14
-
15
13
  class SpanProcessor {
16
14
  constructor (exporter, prioritySampler, config) {
17
15
  this._exporter = exporter
@@ -27,6 +25,16 @@ class SpanProcessor {
27
25
 
28
26
  this._spanSampler = new SpanSampler(config.sampler)
29
27
  this._gitMetadataTagger = new GitMetadataTagger(config)
28
+
29
+ this._processTags = config.propagateProcessTags?.enabled
30
+ ? getProcessTags().serialized
31
+ : false
32
+ }
33
+
34
+ sample (span) {
35
+ const spanContext = span.context()
36
+ this._prioritySampler.sample(spanContext)
37
+ this._spanSampler.sample(spanContext)
30
38
  }
31
39
 
32
40
  process (span) {
@@ -43,22 +51,19 @@ class SpanProcessor {
43
51
  return
44
52
  }
45
53
  if (started.length === finished.length || finished.length >= flushMinSpans) {
46
- this._prioritySampler.sample(spanContext)
47
- this._spanSampler.sample(spanContext)
54
+ this.sample(span)
48
55
  this._gitMetadataTagger.tagGitMetadata(spanContext)
49
56
 
50
- let isChunkRoot = true
57
+ let isFirstSpanInChunk = true
51
58
 
52
59
  for (const span of started) {
53
60
  if (span._duration === undefined) {
54
61
  active.push(span)
55
62
  } else {
56
- const formattedSpan = format(span, isChunkRoot)
57
- isChunkRoot = false
63
+ const formattedSpan = spanFormat(span, isFirstSpanInChunk, this._processTags)
64
+ isFirstSpanInChunk = false
58
65
  this._stats?.onSpanFinished(formattedSpan)
59
66
  formatted.push(formattedSpan)
60
-
61
- spanProcessCh.publish({ span })
62
67
  }
63
68
  }
64
69
 
@@ -4,11 +4,14 @@ const os = require('os')
4
4
  const { version } = require('./pkg')
5
5
  const pkg = require('../../../package.json')
6
6
 
7
- const { LogCollapsingLowestDenseDDSketch } = require('@datadog/sketches-js')
7
+ const { LogCollapsingLowestDenseDDSketch } = require('../../../vendor/dist/@datadog/sketches-js')
8
8
  const { ORIGIN_KEY, TOP_LEVEL_KEY } = require('./constants')
9
9
  const {
10
10
  MEASURED,
11
- HTTP_STATUS_CODE
11
+ HTTP_STATUS_CODE,
12
+ HTTP_ENDPOINT,
13
+ HTTP_ROUTE,
14
+ HTTP_METHOD
12
15
  } = require('../../../ext/tags')
13
16
 
14
17
  const { SpanStatsExporter } = require('./exporters/span-stats')
@@ -53,7 +56,9 @@ class SpanAggStats {
53
56
  resource,
54
57
  type,
55
58
  statusCode,
56
- synthetics
59
+ synthetics,
60
+ method,
61
+ endpoint
57
62
  } = this.aggKey
58
63
 
59
64
  return {
@@ -63,6 +68,8 @@ class SpanAggStats {
63
68
  Type: type,
64
69
  HTTPStatusCode: statusCode,
65
70
  Synthetics: synthetics,
71
+ HTTPMethod: method,
72
+ HTTPEndpoint: endpoint,
66
73
  Hits: this.hits,
67
74
  TopLevelHits: this.topLevelHits,
68
75
  Errors: this.errors,
@@ -81,6 +88,8 @@ class SpanAggKey {
81
88
  this.type = span.type || ''
82
89
  this.statusCode = span.meta[HTTP_STATUS_CODE] || 0
83
90
  this.synthetics = span.meta[ORIGIN_KEY] === 'synthetics'
91
+ this.endpoint = span.meta[HTTP_ROUTE] || span.meta[HTTP_ENDPOINT] || ''
92
+ this.method = span.meta[HTTP_METHOD] || ''
84
93
  }
85
94
 
86
95
  toString () {
@@ -90,7 +99,9 @@ class SpanAggKey {
90
99
  this.resource,
91
100
  this.type,
92
101
  this.statusCode,
93
- this.synthetics
102
+ this.synthetics,
103
+ this.method,
104
+ this.endpoint
94
105
  ].join(',')
95
106
  }
96
107
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  /* eslint-disable no-console */
4
4
 
5
- const SortedSet = require('tlhunter-sorted-set')
5
+ const SortedSet = require('../../../vendor/dist/tlhunter-sorted-set')
6
6
 
7
7
  const INTERVAL = 1000 // look for expired spans every 1s
8
8
  const LIFETIME = 60 * 1000 // all spans have a max lifetime of 1m
@@ -50,6 +50,7 @@
50
50
  "DD_CIVISIBILITY_GIT_UPLOAD_ENABLED": ["A"],
51
51
  "DD_CIVISIBILITY_IMPACTED_TESTS_DETECTION_ENABLED": ["A"],
52
52
  "DD_CIVISIBILITY_ITR_ENABLED": ["A"],
53
+ "DD_CIVISIBILITY_RUM_FLUSH_WAIT_MILLIS": ["A"],
53
54
  "DD_CIVISIBILITY_MANUAL_API_ENABLED": ["A"],
54
55
  "DD_CIVISIBILITY_TEST_COMMAND": ["A"],
55
56
  "DD_CIVISIBILITY_TEST_MODULE_ID": ["A"],
@@ -62,6 +63,7 @@
62
63
  "DD_DBM_PROPAGATION_MODE": ["A"],
63
64
  "DD_DOGSTATSD_HOST": ["A"],
64
65
  "DD_DOGSTATSD_PORT": ["A"],
66
+ "DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS": ["A"],
65
67
  "DD_DYNAMIC_INSTRUMENTATION_ENABLED": ["A"],
66
68
  "DD_DYNAMIC_INSTRUMENTATION_PROBE_FILE": ["A"],
67
69
  "DD_DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS": ["A"],
@@ -70,6 +72,7 @@
70
72
  "DD_ENV": ["A"],
71
73
  "DD_EXPERIMENTAL_APPSEC_STANDALONE_ENABLED": ["A"],
72
74
  "DD_EXPERIMENTAL_FLAGGING_PROVIDER_ENABLED": ["A"],
75
+ "DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED": ["A"],
73
76
  "DD_EXPERIMENTAL_TEST_OPT_GIT_CACHE_ENABLED": ["A"],
74
77
  "DD_EXPERIMENTAL_TEST_OPT_GIT_CACHE_DIR": ["A"],
75
78
  "DD_EXTERNAL_ENV": ["A"],
@@ -124,6 +127,7 @@
124
127
  "DD_LOG_LEVEL": ["A"],
125
128
  "DD_LOGS_INJECTION": ["A"],
126
129
  "DD_LOGS_OTEL_ENABLED": ["A"],
130
+ "DD_METRICS_OTEL_ENABLED": ["A"],
127
131
  "DD_MINI_AGENT_PATH": ["A"],
128
132
  "DD_OPENAI_LOGS_ENABLED": ["A"],
129
133
  "DD_OPENAI_SPAN_CHAR_LIMIT": ["A"],
@@ -290,6 +294,7 @@
290
294
  "DD_TRACE_GOOGLE_CLOUD_PUBSUB_ENABLED": ["A"],
291
295
  "DD_TRACE_GOOGLE_CLOUD_VERTEXAI_ENABLED": ["A"],
292
296
  "DD_TRACE_GOOGLE_GAX_ENABLED": ["A"],
297
+ "DD_TRACE_GOOGLE_GENAI_ENABLED": ["A"],
293
298
  "DD_TRACE_GRAPHQL_ENABLED": ["A"],
294
299
  "DD_TRACE_GRAPHQL_ERROR_EXTENSIONS": ["A"],
295
300
  "DD_TRACE_GRAPHQL_TAG_ENABLED": ["A"],
@@ -408,6 +413,7 @@
408
413
  "DD_TRACE_REMOVE_INTEGRATION_SERVICE_NAMES_ENABLED": ["A"],
409
414
  "DD_TRACE_REPORT_HOSTNAME": ["A"],
410
415
  "DD_TRACE_REQUEST_ENABLED": ["A"],
416
+ "DD_TRACE_RESOURCE_RENAMING_ENABLED": ["A"],
411
417
  "DD_TRACE_RESTIFY_ENABLED": ["A"],
412
418
  "DD_TRACE_RHEA_ENABLED": ["A"],
413
419
  "DD_TRACE_ROUTER_ENABLED": ["A"],
@@ -458,6 +464,13 @@
458
464
  "OTEL_BSP_SCHEDULE_DELAY": ["A"],
459
465
  "OTEL_BSP_MAX_EXPORT_BATCH_SIZE": ["A"],
460
466
  "OTEL_BSP_MAX_QUEUE_SIZE": ["A"],
467
+ "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT": ["A"],
468
+ "OTEL_EXPORTER_OTLP_METRICS_HEADERS": ["A"],
469
+ "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL": ["A"],
470
+ "OTEL_EXPORTER_OTLP_METRICS_TIMEOUT": ["A"],
471
+ "OTEL_METRIC_EXPORT_INTERVAL": ["A"],
472
+ "OTEL_METRIC_EXPORT_TIMEOUT": ["A"],
473
+ "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": ["A"],
461
474
  "OTEL_METRICS_EXPORTER": ["A"],
462
475
  "OTEL_PROPAGATORS": ["A"],
463
476
  "OTEL_RESOURCE_ATTRIBUTES": ["A"],
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const path = require('path')
4
- const parse = require('module-details-from-path')
4
+ const parse = require('../../../../vendor/dist/module-details-from-path')
5
5
  const requirePackageJson = require('../require-package-json')
6
6
  const { sendData } = require('./send-data')
7
7
  const dc = require('dc-polyfill')
@@ -339,8 +339,17 @@ const nameMapping = {
339
339
  otelLogsProtocol: 'OTEL_EXPORTER_OTLP_LOGS_PROTOCOL',
340
340
  otelLogsTimeout: 'OTEL_EXPORTER_OTLP_LOGS_TIMEOUT',
341
341
  otelLogsUrl: 'OTEL_EXPORTER_OTLP_LOGS_ENDPOINT',
342
- otelLogsBatchTimeout: 'OTEL_BSP_SCHEDULE_DELAY',
343
- otelLogsMaxExportBatchSize: 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE',
342
+ otelBatchTimeout: 'OTEL_BSP_SCHEDULE_DELAY',
343
+ otelMaxExportBatchSize: 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE',
344
+ otelMaxQueueSize: 'OTEL_BSP_MAX_QUEUE_SIZE',
345
+ otelMetricsEnabled: 'DD_METRICS_OTEL_ENABLED',
346
+ otelMetricsHeaders: 'OTEL_EXPORTER_OTLP_METRICS_HEADERS',
347
+ otelMetricsProtocol: 'OTEL_EXPORTER_OTLP_METRICS_PROTOCOL',
348
+ otelMetricsTimeout: 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT',
349
+ otelMetricsExportTimeout: 'OTEL_METRIC_EXPORT_TIMEOUT',
350
+ otelMetricsUrl: 'OTEL_EXPORTER_OTLP_METRICS_ENDPOINT',
351
+ otelMetricsExportInterval: 'OTEL_METRIC_EXPORT_INTERVAL',
352
+ otelMetricsTemporalityPreference: 'OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE',
344
353
  }
345
354
 
346
355
  const namesNeedFormatting = new Set(['DD_TAGS', 'peerServiceMapping', 'serviceMapping'])
@@ -0,0 +1,39 @@
1
+ This license applies to all parts of protobuf.js except those files
2
+ either explicitly including or referencing a different license or
3
+ located in a directory containing a different LICENSE file.
4
+
5
+ ---
6
+
7
+ Copyright (c) 2016, Daniel Wirtz All rights reserved.
8
+
9
+ Redistribution and use in source and binary forms, with or without
10
+ modification, are permitted provided that the following conditions are
11
+ met:
12
+
13
+ * Redistributions of source code must retain the above copyright
14
+ notice, this list of conditions and the following disclaimer.
15
+ * Redistributions in binary form must reproduce the above copyright
16
+ notice, this list of conditions and the following disclaimer in the
17
+ documentation and/or other materials provided with the distribution.
18
+ * Neither the name of its author, nor the names of its contributors
19
+ may be used to endorse or promote products derived from this software
20
+ without specific prior written permission.
21
+
22
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
+
34
+ ---
35
+
36
+ Code generated by the command line utilities is owned by the owner
37
+ of the input file used when generating it. This code is not
38
+ standalone and requires a support library to be linked with it. This
39
+ support library is itself covered by the above license.
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var __webpack_modules__={"./@datadog/sketches-js/dist/ddsketch/DDSketch.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LogCollapsingHighestDenseDDSketch=e.LogCollapsingLowestDenseDDSketch=e.DDSketch=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/store/index.js"),r=n("./@datadog/sketches-js/dist/ddsketch/mapping/index.js"),s=.01,u=2048,a=function(){function t(t){var e=t.mapping,n=t.store,i=t.negativeStore,o=t.zeroCount;this.mapping=e,this.store=n,this.negativeStore=i,this.zeroCount=o,this.count=this.negativeStore.count+this.zeroCount+this.store.count,this.min=1/0,this.max=-1/0,this.sum=0}return t.prototype.accept=function(t,e){if(void 0===e&&(e=1),e<=0)throw Error("Weight must be a positive number");if(t>this.mapping.minPossible){var n=this.mapping.key(t);this.store.add(n,e)}else if(t<-this.mapping.minPossible){var n=this.mapping.key(-t);this.negativeStore.add(n,e)}else this.zeroCount+=e;this.count+=e,this.sum+=t*e,t<this.min&&(this.min=t),t>this.max&&(this.max=t)},t.prototype.getValueAtQuantile=function(t){if(t<0||t>1||0===this.count)return NaN;var e=t*(this.count-1),n=0;if(e<this.negativeStore.count){var i=this.negativeStore.count-e-1,o=this.negativeStore.keyAtRank(i,!1);n=-this.mapping.value(o)}else{if(e<this.zeroCount+this.negativeStore.count)return 0;var o=this.store.keyAtRank(e-this.zeroCount-this.negativeStore.count);n=this.mapping.value(o)}return n},t.prototype.merge=function(t){if(!this.mergeable(t))throw Error("Cannot merge two DDSketches with different `relativeAccuracy` parameters");if(0!==t.count){if(0===this.count)return void this._copy(t);this.store.merge(t.store),this.zeroCount+=t.zeroCount,this.count+=t.count,this.sum+=t.sum,t.min<this.min&&(this.min=t.min),t.max>this.max&&(this.max=t.max)}},t.prototype.mergeable=function(t){return this.mapping.gamma===t.mapping.gamma},t.prototype._copy=function(t){this.store.copy(t.store),this.negativeStore.copy(t.negativeStore),this.zeroCount=t.zeroCount,this.min=t.min,this.max=t.max,this.count=t.count,this.sum=t.sum},t.prototype.toProto=function(){var t=n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").DDSketch,e=t.create({mapping:this.mapping.toProto(),positiveValues:this.store.toProto(),negativeValues:this.negativeStore.toProto(),zeroCount:this.zeroCount});return t.encode(e).finish()},t.fromProto=function(e){var i=n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").DDSketch.decode(e);return new t({mapping:r.KeyMapping.fromProto(i.mapping),store:o.DenseStore.fromProto(i.positiveValues),negativeStore:o.DenseStore.fromProto(i.negativeValues),zeroCount:i.zeroCount})},t}(),f={relativeAccuracy:s};e.DDSketch=function(t){function e(e){var n=(void 0===e?f:e).relativeAccuracy,i=void 0===n?s:n,u=new r.LogarithmicMapping(i),a=new o.DenseStore,c=new o.DenseStore;return t.call(this,{mapping:u,store:a,negativeStore:c,zeroCount:0})||this}return i(e,t),e}(a),e.LogCollapsingLowestDenseDDSketch=function(t){function e(e){var n=void 0===e?f:e,i=n.relativeAccuracy,a=void 0===i?s:i,c=n.binLimit,p=void 0===c?u:c,l=new r.LogarithmicMapping(a),h=new o.CollapsingLowestDenseStore(p),d=new o.CollapsingLowestDenseStore(p);return t.call(this,{mapping:l,store:h,negativeStore:d,zeroCount:0})||this}return i(e,t),e}(a),e.LogCollapsingHighestDenseDDSketch=function(t){function e(e){var n=void 0===e?f:e,i=n.relativeAccuracy,a=void 0===i?s:i,c=n.binLimit,p=void 0===c?u:c,l=new r.LogarithmicMapping(a),h=new o.CollapsingHighestDenseStore(p),d=new o.CollapsingHighestDenseStore(p);return t.call(this,{mapping:l,store:h,negativeStore:d,zeroCount:0})||this}return i(e,t),e}(a)},"./@datadog/sketches-js/dist/ddsketch/index.js":function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(e,n);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,o)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n("./@datadog/sketches-js/dist/ddsketch/DDSketch.js"),e)},"./@datadog/sketches-js/dist/ddsketch/mapping/CubicallyInterpolatedMapping.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CubicallyInterpolatedMapping=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"),r=n("./@datadog/sketches-js/dist/ddsketch/math.js");e.CubicallyInterpolatedMapping=function(t){function e(e,n){void 0===n&&(n=0);var i=t.call(this,e,n)||this;return i.A=6/35,i.B=-.6,i.C=10/7,i._multiplier/=i.C,i}return i(e,t),e.prototype._cubicLog2Approx=function(t){var e=(0,r.frexp)(t),n=e[0],i=e[1],o=2*n-1;return((this.A*o+this.B)*o+this.C)*o+(i-1)},e.prototype._cubicExp2Approx=function(t){var e=Math.floor(t),n=this.B*this.B-3*this.A*this.C,i=2*this.B*this.B*this.B-9*this.A*this.B*this.C-27*this.A*this.A*(t-e),o=Math.cbrt((i-Math.sqrt(i*i-4*n*n*n))/2),s=(-(this.B+o+n/o)/(3*this.A)+1)/2;return(0,r.ldexp)(s,e+1)},e.prototype._logGamma=function(t){return this._cubicLog2Approx(t)*this._multiplier},e.prototype._powGamma=function(t){return this._cubicExp2Approx(t/this._multiplier)},e.prototype._protoInterpolation=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.CUBIC},e}(o.KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.KeyMapping=void 0;var i=n("./@datadog/sketches-js/dist/ddsketch/mapping/index.js"),o=11125369292536007e-324,r=Number.MAX_VALUE;e.KeyMapping=function(){function t(t,e){if(void 0===e&&(e=0),t<=0||t>=1)throw Error("Relative accuracy must be between 0 and 1 when initializing a KeyMapping");this.relativeAccuracy=t,this._offset=e;var n=2*t/(1-t);this.gamma=1+n,this._multiplier=1/Math.log1p(n),this.minPossible=o*this.gamma,this.maxPossible=r/this.gamma}return t.fromGammaOffset=function(t,e){return new this((t-1)/(t+1),e)},t.prototype.key=function(t){return Math.ceil(this._logGamma(t))+this._offset},t.prototype.value=function(t){return this._powGamma(t-this._offset)*(2/(1+this.gamma))},t.prototype.toProto=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.create({gamma:this.gamma,indexOffset:this._offset,interpolation:this._protoInterpolation()})},t.fromProto=function(t){if(!t||null==t.gamma||null==t.indexOffset)throw Error("Failed to decode mapping from protobuf");var e=n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation,o=t.interpolation,r=t.gamma,s=t.indexOffset;switch(o){case e.NONE:return i.LogarithmicMapping.fromGammaOffset(r,s);case e.LINEAR:return i.LinearlyInterpolatedMapping.fromGammaOffset(r,s);case e.CUBIC:return i.CubicallyInterpolatedMapping.fromGammaOffset(r,s);default:throw Error("Unrecognized mapping when decoding from protobuf")}},t.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},t.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},t.prototype._protoInterpolation=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.NONE},t}()},"./@datadog/sketches-js/dist/ddsketch/mapping/LinearlyInterpolatedMapping.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LinearlyInterpolatedMapping=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"),r=n("./@datadog/sketches-js/dist/ddsketch/math.js");e.LinearlyInterpolatedMapping=function(t){function e(e,n){return void 0===n&&(n=0),t.call(this,e,n)||this}return i(e,t),e.prototype._log2Approx=function(t){var e=(0,r.frexp)(t);return 2*e[0]-1+(e[1]-1)},e.prototype._exp2Approx=function(t){var e=Math.floor(t)+1,n=(t-e+2)/2;return(0,r.ldexp)(n,e)},e.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},e.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},e.prototype._protoInterpolation=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.LINEAR},e}(o.KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/LogarithmicMapping.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LogarithmicMapping=void 0,e.LogarithmicMapping=function(t){function e(e,n){void 0===n&&(n=0);var i=t.call(this,e,n)||this;return i._multiplier*=Math.log(2),i}return i(e,t),e.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},e.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},e.prototype._protoInterpolation=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.NONE},e}(n("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js").KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/index.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CubicallyInterpolatedMapping=e.LinearlyInterpolatedMapping=e.LogarithmicMapping=e.KeyMapping=void 0;var i=n("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js");Object.defineProperty(e,"KeyMapping",{enumerable:!0,get:function(){return i.KeyMapping}});var o=n("./@datadog/sketches-js/dist/ddsketch/mapping/LogarithmicMapping.js");Object.defineProperty(e,"LogarithmicMapping",{enumerable:!0,get:function(){return o.LogarithmicMapping}});var r=n("./@datadog/sketches-js/dist/ddsketch/mapping/LinearlyInterpolatedMapping.js");Object.defineProperty(e,"LinearlyInterpolatedMapping",{enumerable:!0,get:function(){return r.LinearlyInterpolatedMapping}});var s=n("./@datadog/sketches-js/dist/ddsketch/mapping/CubicallyInterpolatedMapping.js");Object.defineProperty(e,"CubicallyInterpolatedMapping",{enumerable:!0,get:function(){return s.CubicallyInterpolatedMapping}})},"./@datadog/sketches-js/dist/ddsketch/math.js":function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ldexp=e.frexp=void 0,e.frexp=function(t){if(0===t||!Number.isFinite(t))return[t,0];for(var e=Math.abs(t),n=Math.max(-1023,Math.floor(Math.log2(e))+1),i=e*Math.pow(2,-n);i<.5;)i*=2,n--;for(;i>=1;)i*=.5,n++;return t<0&&(i=-i),[i,n]},e.ldexp=function(t,e){for(var n=Math.min(3,Math.ceil(Math.abs(e)/1023)),i=t,o=0;o<n;o++)i*=Math.pow(2,Math.floor((e+o)/n));return i}},"./@datadog/sketches-js/dist/ddsketch/proto/compiled.js":function(t,e,n){var i=n("./protobufjs/minimal.js"),o=i.Reader,r=i.Writer,s=i.util,u=i.roots.default||(i.roots.default={});u.DDSketch=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.mapping=null,t.prototype.positiveValues=null,t.prototype.negativeValues=null,t.prototype.zeroCount=0,t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=r.create()),null!=t.mapping&&Object.hasOwnProperty.call(t,"mapping")&&u.IndexMapping.encode(t.mapping,e.uint32(10).fork()).ldelim(),null!=t.positiveValues&&Object.hasOwnProperty.call(t,"positiveValues")&&u.Store.encode(t.positiveValues,e.uint32(18).fork()).ldelim(),null!=t.negativeValues&&Object.hasOwnProperty.call(t,"negativeValues")&&u.Store.encode(t.negativeValues,e.uint32(26).fork()).ldelim(),null!=t.zeroCount&&Object.hasOwnProperty.call(t,"zeroCount")&&e.uint32(33).double(t.zeroCount),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof o||(t=o.create(t));for(var n=void 0===e?t.len:t.pos+e,i=new u.DDSketch;t.pos<n;){var r=t.uint32();switch(r>>>3){case 1:i.mapping=u.IndexMapping.decode(t,t.uint32());break;case 2:i.positiveValues=u.Store.decode(t,t.uint32());break;case 3:i.negativeValues=u.Store.decode(t,t.uint32());break;case 4:i.zeroCount=t.double();break;default:t.skipType(7&r)}}return i},t.decodeDelimited=function(t){return t instanceof o||(t=new o(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.mapping&&t.hasOwnProperty("mapping")){var e=u.IndexMapping.verify(t.mapping);if(e)return"mapping."+e}if(null!=t.positiveValues&&t.hasOwnProperty("positiveValues")){var e=u.Store.verify(t.positiveValues);if(e)return"positiveValues."+e}if(null!=t.negativeValues&&t.hasOwnProperty("negativeValues")){var e=u.Store.verify(t.negativeValues);if(e)return"negativeValues."+e}return null!=t.zeroCount&&t.hasOwnProperty("zeroCount")&&"number"!=typeof t.zeroCount?"zeroCount: number expected":null},t.fromObject=function(t){if(t instanceof u.DDSketch)return t;var e=new u.DDSketch;if(null!=t.mapping){if("object"!=typeof t.mapping)throw TypeError(".DDSketch.mapping: object expected");e.mapping=u.IndexMapping.fromObject(t.mapping)}if(null!=t.positiveValues){if("object"!=typeof t.positiveValues)throw TypeError(".DDSketch.positiveValues: object expected");e.positiveValues=u.Store.fromObject(t.positiveValues)}if(null!=t.negativeValues){if("object"!=typeof t.negativeValues)throw TypeError(".DDSketch.negativeValues: object expected");e.negativeValues=u.Store.fromObject(t.negativeValues)}return null!=t.zeroCount&&(e.zeroCount=Number(t.zeroCount)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.mapping=null,n.positiveValues=null,n.negativeValues=null,n.zeroCount=0),null!=t.mapping&&t.hasOwnProperty("mapping")&&(n.mapping=u.IndexMapping.toObject(t.mapping,e)),null!=t.positiveValues&&t.hasOwnProperty("positiveValues")&&(n.positiveValues=u.Store.toObject(t.positiveValues,e)),null!=t.negativeValues&&t.hasOwnProperty("negativeValues")&&(n.negativeValues=u.Store.toObject(t.negativeValues,e)),null!=t.zeroCount&&t.hasOwnProperty("zeroCount")&&(n.zeroCount=e.json&&!isFinite(t.zeroCount)?String(t.zeroCount):t.zeroCount),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},t}(),u.IndexMapping=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.gamma=0,t.prototype.indexOffset=0,t.prototype.interpolation=0,t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=r.create()),null!=t.gamma&&Object.hasOwnProperty.call(t,"gamma")&&e.uint32(9).double(t.gamma),null!=t.indexOffset&&Object.hasOwnProperty.call(t,"indexOffset")&&e.uint32(17).double(t.indexOffset),null!=t.interpolation&&Object.hasOwnProperty.call(t,"interpolation")&&e.uint32(24).int32(t.interpolation),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof o||(t=o.create(t));for(var n=void 0===e?t.len:t.pos+e,i=new u.IndexMapping;t.pos<n;){var r=t.uint32();switch(r>>>3){case 1:i.gamma=t.double();break;case 2:i.indexOffset=t.double();break;case 3:i.interpolation=t.int32();break;default:t.skipType(7&r)}}return i},t.decodeDelimited=function(t){return t instanceof o||(t=new o(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.gamma&&t.hasOwnProperty("gamma")&&"number"!=typeof t.gamma)return"gamma: number expected";if(null!=t.indexOffset&&t.hasOwnProperty("indexOffset")&&"number"!=typeof t.indexOffset)return"indexOffset: number expected";if(null!=t.interpolation&&t.hasOwnProperty("interpolation"))switch(t.interpolation){default:return"interpolation: enum value expected";case 0:case 1:case 2:case 3:}return null},t.fromObject=function(t){if(t instanceof u.IndexMapping)return t;var e=new u.IndexMapping;switch(null!=t.gamma&&(e.gamma=Number(t.gamma)),null!=t.indexOffset&&(e.indexOffset=Number(t.indexOffset)),t.interpolation){case"NONE":case 0:e.interpolation=0;break;case"LINEAR":case 1:e.interpolation=1;break;case"QUADRATIC":case 2:e.interpolation=2;break;case"CUBIC":case 3:e.interpolation=3}return e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.gamma=0,n.indexOffset=0,n.interpolation=e.enums===String?"NONE":0),null!=t.gamma&&t.hasOwnProperty("gamma")&&(n.gamma=e.json&&!isFinite(t.gamma)?String(t.gamma):t.gamma),null!=t.indexOffset&&t.hasOwnProperty("indexOffset")&&(n.indexOffset=e.json&&!isFinite(t.indexOffset)?String(t.indexOffset):t.indexOffset),null!=t.interpolation&&t.hasOwnProperty("interpolation")&&(n.interpolation=e.enums===String?u.IndexMapping.Interpolation[t.interpolation]:t.interpolation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},t.Interpolation=function(){var t={},e=Object.create(t);return e[t[0]="NONE"]=0,e[t[1]="LINEAR"]=1,e[t[2]="QUADRATIC"]=2,e[t[3]="CUBIC"]=3,e}(),t}(),u.Store=function(){function t(t){if(this.binCounts={},this.contiguousBinCounts=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.binCounts=s.emptyObject,t.prototype.contiguousBinCounts=s.emptyArray,t.prototype.contiguousBinIndexOffset=0,t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=r.create()),null!=t.binCounts&&Object.hasOwnProperty.call(t,"binCounts"))for(var n=Object.keys(t.binCounts),i=0;i<n.length;++i)e.uint32(10).fork().uint32(8).sint32(n[i]).uint32(17).double(t.binCounts[n[i]]).ldelim();if(null!=t.contiguousBinCounts&&t.contiguousBinCounts.length){e.uint32(18).fork();for(var i=0;i<t.contiguousBinCounts.length;++i)e.double(t.contiguousBinCounts[i]);e.ldelim()}return null!=t.contiguousBinIndexOffset&&Object.hasOwnProperty.call(t,"contiguousBinIndexOffset")&&e.uint32(24).sint32(t.contiguousBinIndexOffset),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof o||(t=o.create(t));for(var n,i,r=void 0===e?t.len:t.pos+e,a=new u.Store;t.pos<r;){var f=t.uint32();switch(f>>>3){case 1:a.binCounts===s.emptyObject&&(a.binCounts={});var c=t.uint32()+t.pos;for(n=0,i=0;t.pos<c;){var p=t.uint32();switch(p>>>3){case 1:n=t.sint32();break;case 2:i=t.double();break;default:t.skipType(7&p)}}a.binCounts[n]=i;break;case 2:if(a.contiguousBinCounts&&a.contiguousBinCounts.length||(a.contiguousBinCounts=[]),(7&f)==2)for(var c=t.uint32()+t.pos;t.pos<c;)a.contiguousBinCounts.push(t.double());else a.contiguousBinCounts.push(t.double());break;case 3:a.contiguousBinIndexOffset=t.sint32();break;default:t.skipType(7&f)}}return a},t.decodeDelimited=function(t){return t instanceof o||(t=new o(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.binCounts&&t.hasOwnProperty("binCounts")){if(!s.isObject(t.binCounts))return"binCounts: object expected";for(var e=Object.keys(t.binCounts),n=0;n<e.length;++n){if(!s.key32Re.test(e[n]))return"binCounts: integer key{k:sint32} expected";if("number"!=typeof t.binCounts[e[n]])return"binCounts: number{k:sint32} expected"}}if(null!=t.contiguousBinCounts&&t.hasOwnProperty("contiguousBinCounts")){if(!Array.isArray(t.contiguousBinCounts))return"contiguousBinCounts: array expected";for(var n=0;n<t.contiguousBinCounts.length;++n)if("number"!=typeof t.contiguousBinCounts[n])return"contiguousBinCounts: number[] expected"}return null!=t.contiguousBinIndexOffset&&t.hasOwnProperty("contiguousBinIndexOffset")&&!s.isInteger(t.contiguousBinIndexOffset)?"contiguousBinIndexOffset: integer expected":null},t.fromObject=function(t){if(t instanceof u.Store)return t;var e=new u.Store;if(t.binCounts){if("object"!=typeof t.binCounts)throw TypeError(".Store.binCounts: object expected");e.binCounts={};for(var n=Object.keys(t.binCounts),i=0;i<n.length;++i)e.binCounts[n[i]]=Number(t.binCounts[n[i]])}if(t.contiguousBinCounts){if(!Array.isArray(t.contiguousBinCounts))throw TypeError(".Store.contiguousBinCounts: array expected");e.contiguousBinCounts=[];for(var i=0;i<t.contiguousBinCounts.length;++i)e.contiguousBinCounts[i]=Number(t.contiguousBinCounts[i])}return null!=t.contiguousBinIndexOffset&&(e.contiguousBinIndexOffset=0|t.contiguousBinIndexOffset),e},t.toObject=function(t,e){e||(e={});var n,i={};if((e.arrays||e.defaults)&&(i.contiguousBinCounts=[]),(e.objects||e.defaults)&&(i.binCounts={}),e.defaults&&(i.contiguousBinIndexOffset=0),t.binCounts&&(n=Object.keys(t.binCounts)).length){i.binCounts={};for(var o=0;o<n.length;++o)i.binCounts[n[o]]=e.json&&!isFinite(t.binCounts[n[o]])?String(t.binCounts[n[o]]):t.binCounts[n[o]]}if(t.contiguousBinCounts&&t.contiguousBinCounts.length){i.contiguousBinCounts=[];for(var o=0;o<t.contiguousBinCounts.length;++o)i.contiguousBinCounts[o]=e.json&&!isFinite(t.contiguousBinCounts[o])?String(t.contiguousBinCounts[o]):t.contiguousBinCounts[o]}return null!=t.contiguousBinIndexOffset&&t.hasOwnProperty("contiguousBinIndexOffset")&&(i.contiguousBinIndexOffset=t.contiguousBinIndexOffset),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},t}(),t.exports=u},"./@datadog/sketches-js/dist/ddsketch/store/CollapsingHighestDenseStore.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingHighestDenseStore=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"),r=n("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.CollapsingHighestDenseStore=function(t){function e(e,n){var i=t.call(this,n)||this;return i.binLimit=e,i.isCollapsed=!1,i}return i(e,t),e.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.maxKey-t.offset+1,n=Math.max(this.maxKey+1,t.minKey)-t.offset;if(e>n){var i=(0,r.sumOfRange)(t.bins,n,e);this.bins[this.length()-1]+=i}else n=e;for(var o=t.minKey;o<n+t.offset;o++)this.bins[o-this.offset]+=t.bins[o-t.offset];this.count+=t.count}},e.prototype.copy=function(e){t.prototype.copy.call(this,e),this.isCollapsed=e.isCollapsed},e.prototype._getNewLength=function(t,e){var n=e-t+1;return Math.min(this.chunkSize*Math.ceil(n/this.chunkSize),this.binLimit)},e.prototype._adjust=function(t,e){if(e-t+1>this.length())if((e=t+this.length()+1)<=this.minKey)this.offset=t,this.maxKey=e,this.bins.fill(0),this.bins[this.length()-1]=this.count;else{var n=this.offset-t;if(n>0){var i=e-this.offset+1,o=this.maxKey-this.offset+1,s=(0,r.sumOfRange)(this.bins,i,o);this.bins.fill(0,i,o),this.bins[i-1]+=s,this.maxKey=e,this._shiftBins(n)}else this.maxKey=e,this._shiftBins(n);this.minKey=t,this.isCollapsed=!0}else this._centerBins(t,e),this.minKey=t,this.maxKey=e},e.prototype._getIndex=function(t){if(t<this.minKey){if(this.isCollapsed||(this._extendRange(t),this.isCollapsed))return this.length()-1}else t>this.maxKey&&this._extendRange(t);return t-this.offset},e}(o.DenseStore)},"./@datadog/sketches-js/dist/ddsketch/store/CollapsingLowestDenseStore.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingLowestDenseStore=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"),r=n("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.CollapsingLowestDenseStore=function(t){function e(e,n){var i=t.call(this,n)||this;return i.binLimit=e,i.isCollapsed=!1,i}return i(e,t),e.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.minKey-t.offset,n=Math.min(this.minKey,t.maxKey+1)-t.offset;if(n>e){var i=(0,r.sumOfRange)(t.bins,e,n);this.bins[0]+=i}else n=e;for(var o=n+t.offset;o<t.maxKey+1;o++)this.bins[o-this.offset]+=t.bins[o-t.offset];this.count+=t.count}},e.prototype.copy=function(e){t.prototype.copy.call(this,e),this.isCollapsed=e.isCollapsed},e.prototype._getNewLength=function(t,e){var n=e-t+1;return Math.min(this.chunkSize*Math.ceil(n/this.chunkSize),this.binLimit)},e.prototype._adjust=function(t,e){if(e-t+1>this.length()){if((t=e-this.length()+1)>=this.maxKey)this.offset=t,this.minKey=t,this.bins.fill(0),this.bins[0]=this.count;else{var n=this.offset-t;if(n<0){var i=this.minKey-this.offset,o=t-this.offset,s=(0,r.sumOfRange)(this.bins,i,o);this.bins.fill(0,i,o),this.bins[o]+=s,this.minKey=t,this._shiftBins(n)}else this.minKey=t,this._shiftBins(n)}this.maxKey=e,this.isCollapsed=!0}else this._centerBins(t,e),this.minKey=t,this.maxKey=e},e.prototype._getIndex=function(t){if(t<this.minKey){if(this.isCollapsed||(this._extendRange(t),this.isCollapsed))return 0}else t>this.maxKey&&this._extendRange(t);return t-this.offset},e}(o.DenseStore)},"./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js":function(t,e,n){var i=this&&this.__spreadArray||function(t,e,n){if(n||2==arguments.length)for(var i,o=0,r=e.length;o<r;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.DenseStore=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/store/util.js"),r=128;e.DenseStore=function(){function t(t){void 0===t&&(t=r),this.chunkSize=t,this.bins=[],this.count=0,this.minKey=1/0,this.maxKey=-1/0,this.offset=0}return t.prototype.add=function(t,e){void 0===e&&(e=1);var n=this._getIndex(t);this.bins[n]+=e,this.count+=e},t.prototype.keyAtRank=function(t,e){void 0===e&&(e=!0);for(var n=0,i=0;i<this.length();i++)if(n+=this.bins[i],e&&n>t||!e&&n>=t+1)return i+this.offset;return this.maxKey},t.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.minKey-t.offset,n=Math.min(this.minKey,t.maxKey+1)-t.offset;if(n>e){var i=(0,o.sumOfRange)(t.bins,e,n);this.bins[0]+=i}else n=e;for(var r=n+t.offset;r<t.maxKey+1;r++)this.bins[r-this.offset]+=t.bins[r-t.offset];this.count+=t.count}},t.prototype.copy=function(t){this.bins=i([],t.bins,!0),this.count=t.count,this.minKey=t.minKey,this.maxKey=t.maxKey,this.offset=t.offset},t.prototype.length=function(){return this.bins.length},t.prototype._getNewLength=function(t,e){var n=e-t+1;return this.chunkSize*Math.ceil(n/this.chunkSize)},t.prototype._adjust=function(t,e){this._centerBins(t,e),this.minKey=t,this.maxKey=e},t.prototype._shiftBins=function(t){var e,n;t>0?(this.bins=this.bins.slice(0,-t),(e=this.bins).unshift.apply(e,Array(t).fill(0))):(this.bins=this.bins.slice(Math.abs(t)),(n=this.bins).push.apply(n,Array(Math.abs(t)).fill(0))),this.offset-=t},t.prototype._centerBins=function(t,e){var n=t+Math.floor((e-t+1)/2);this._shiftBins(Math.floor(this.offset+this.length()/2)-n)},t.prototype._extendRange=function(t,e){e=e||t;var n,i=Math.min(t,e,this.minKey),o=Math.max(t,e,this.maxKey);if(0===this.length())this.bins=Array(this._getNewLength(i,o)).fill(0),this.offset=i,this._adjust(i,o);else if(i>=this.minKey&&o<this.offset+this.length())this.minKey=i,this.maxKey=o;else{var r=this._getNewLength(i,o);r>this.length()&&(n=this.bins).push.apply(n,Array(r-this.length()).fill(0)),this._adjust(i,o)}},t.prototype._getIndex=function(t){return t<this.minKey?this._extendRange(t):t>this.maxKey&&this._extendRange(t),t-this.offset},t.prototype.toProto=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").Store.create({contiguousBinCounts:this.bins,contiguousBinIndexOffset:this.offset})},t.fromProto=function(t){if(!t||null==t.contiguousBinCounts||null==t.contiguousBinIndexOffset)throw Error("Failed to decode store from protobuf");var e=new this,n=t.contiguousBinIndexOffset;e.offset=n;for(var i=0,o=t.contiguousBinCounts;i<o.length;i++){var r=o[i];e.add(n,r),n+=1}return e},t}()},"./@datadog/sketches-js/dist/ddsketch/store/index.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingHighestDenseStore=e.CollapsingLowestDenseStore=e.DenseStore=void 0;var i=n("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js");Object.defineProperty(e,"DenseStore",{enumerable:!0,get:function(){return i.DenseStore}});var o=n("./@datadog/sketches-js/dist/ddsketch/store/CollapsingLowestDenseStore.js");Object.defineProperty(e,"CollapsingLowestDenseStore",{enumerable:!0,get:function(){return o.CollapsingLowestDenseStore}});var r=n("./@datadog/sketches-js/dist/ddsketch/store/CollapsingHighestDenseStore.js");Object.defineProperty(e,"CollapsingHighestDenseStore",{enumerable:!0,get:function(){return r.CollapsingHighestDenseStore}})},"./@datadog/sketches-js/dist/ddsketch/store/util.js":function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfRange=void 0,e.sumOfRange=function(t,e,n){for(var i=0,o=e;o<=n;o++)i+=t[o];return i}},"./@datadog/sketches-js/dist/index.js":function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(e,n);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,o)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n("./@datadog/sketches-js/dist/ddsketch/index.js"),e)},"./@protobufjs/aspromise/index.js":function(t){t.exports=e;function e(t,e){for(var n=Array(arguments.length-1),i=0,o=2,r=!0;o<arguments.length;)n[i++]=arguments[o++];return new Promise(function(o,s){n[i]=function(t){if(r)if(r=!1,t)s(t);else{for(var e=Array(arguments.length-1),n=0;n<e.length;)e[n++]=arguments[n];o.apply(null,e)}};try{t.apply(e||null,n)}catch(t){r&&(r=!1,s(t))}})}},"./@protobufjs/base64/index.js":function(t,e){var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&"="===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var i=Array(64),o=Array(123),r=0;r<64;)o[i[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;n.encode=function(t,e,n){for(var o,r=null,s=[],u=0,a=0;e<n;){var f=t[e++];switch(a){case 0:s[u++]=i[f>>2],o=(3&f)<<4,a=1;break;case 1:s[u++]=i[o|f>>4],o=(15&f)<<2,a=2;break;case 2:s[u++]=i[o|f>>6],s[u++]=i[63&f],a=0}u>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,s)),u=0)}return(a&&(s[u++]=i[o],s[u++]=61,1===a&&(s[u++]=61)),r)?(u&&r.push(String.fromCharCode.apply(String,s.slice(0,u))),r.join("")):String.fromCharCode.apply(String,s.slice(0,u))};var s="invalid encoding";n.decode=function(t,e,n){for(var i,r=n,u=0,a=0;a<t.length;){var f=t.charCodeAt(a++);if(61===f&&u>1)break;if(void 0===(f=o[f]))throw Error(s);switch(u){case 0:i=f,u=1;break;case 1:e[n++]=i<<2|(48&f)>>4,i=f,u=2;break;case 2:e[n++]=(15&i)<<4|(60&f)>>2,i=f,u=3;break;case 3:e[n++]=(3&i)<<6|f,u=0}}if(1===u)throw Error(s);return n-r},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},"./@protobufjs/eventemitter/index.js":function(t){function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],i=0;i<n.length;)n[i].fn===e?n.splice(i,1):++i;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<e.length;)e[i].fn.apply(e[i++].ctx,n)}return this}},"./@protobufjs/float/index.js":function(t){function e(t){return"undefined"!=typeof Float32Array?!function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),i=128===n[3];function o(t,i,o){e[0]=t,i[o]=n[0],i[o+1]=n[1],i[o+2]=n[2],i[o+3]=n[3]}function r(t,i,o){e[0]=t,i[o]=n[3],i[o+1]=n[2],i[o+2]=n[1],i[o+3]=n[0]}function s(t,i){return n[0]=t[i],n[1]=t[i+1],n[2]=t[i+2],n[3]=t[i+3],e[0]}function u(t,i){return n[3]=t[i],n[2]=t[i+1],n[1]=t[i+2],n[0]=t[i+3],e[0]}t.writeFloatLE=i?o:r,t.writeFloatBE=i?r:o,t.readFloatLE=i?s:u,t.readFloatBE=i?u:s}():!function(){function e(t,e,n,i){var o=+(e<0);if(o&&(e=-e),0===e)t(1/e>0?0:0x80000000,n,i);else if(isNaN(e))t(0x7fc00000,n,i);else if(e>34028234663852886e22)t((o<<31|0x7f800000)>>>0,n,i);else if(e<11754943508222875e-54)t((o<<31|Math.round(e/1401298464324817e-60))>>>0,n,i);else{var r=Math.floor(Math.log(e)/Math.LN2),s=8388607&Math.round(e*Math.pow(2,-r)*8388608);t((o<<31|r+127<<23|s)>>>0,n,i)}}function s(t,e,n){var i=t(e,n),o=(i>>31)*2+1,r=i>>>23&255,s=8388607&i;return 255===r?s?NaN:1/0*o:0===r?1401298464324817e-60*o*s:o*Math.pow(2,r-150)*(s+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,i),t.readFloatLE=s.bind(null,o),t.readFloatBE=s.bind(null,r)}(),"undefined"!=typeof Float64Array?!function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),i=128===n[7];function o(t,i,o){e[0]=t,i[o]=n[0],i[o+1]=n[1],i[o+2]=n[2],i[o+3]=n[3],i[o+4]=n[4],i[o+5]=n[5],i[o+6]=n[6],i[o+7]=n[7]}function r(t,i,o){e[0]=t,i[o]=n[7],i[o+1]=n[6],i[o+2]=n[5],i[o+3]=n[4],i[o+4]=n[3],i[o+5]=n[2],i[o+6]=n[1],i[o+7]=n[0]}function s(t,i){return n[0]=t[i],n[1]=t[i+1],n[2]=t[i+2],n[3]=t[i+3],n[4]=t[i+4],n[5]=t[i+5],n[6]=t[i+6],n[7]=t[i+7],e[0]}function u(t,i){return n[7]=t[i],n[6]=t[i+1],n[5]=t[i+2],n[4]=t[i+3],n[3]=t[i+4],n[2]=t[i+5],n[1]=t[i+6],n[0]=t[i+7],e[0]}t.writeDoubleLE=i?o:r,t.writeDoubleBE=i?r:o,t.readDoubleLE=i?s:u,t.readDoubleBE=i?u:s}():!function(){function e(t,e,n,i,o,r){var s,u=+(i<0);if(u&&(i=-i),0===i)t(0,o,r+e),t(1/i>0?0:0x80000000,o,r+n);else if(isNaN(i))t(0,o,r+e),t(0x7ff80000,o,r+n);else if(i>17976931348623157e292)t(0,o,r+e),t((u<<31|0x7ff00000)>>>0,o,r+n);else if(i<22250738585072014e-324)t((s=i/5e-324)>>>0,o,r+e),t((u<<31|s/0x100000000)>>>0,o,r+n);else{var a=Math.floor(Math.log(i)/Math.LN2);1024===a&&(a=1023),t(0x10000000000000*(s=i*Math.pow(2,-a))>>>0,o,r+e),t((u<<31|a+1023<<20|1048576*s&1048575)>>>0,o,r+n)}}function s(t,e,n,i,o){var r=t(i,o+e),s=t(i,o+n),u=(s>>31)*2+1,a=s>>>20&2047,f=0x100000000*(1048575&s)+r;return 2047===a?f?NaN:1/0*u:0===a?5e-324*u*f:u*Math.pow(2,a-1075)*(f+0x10000000000000)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,i,4,0),t.readDoubleLE=s.bind(null,o,0,4),t.readDoubleBE=s.bind(null,r,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function i(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function o(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function r(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},"./@protobufjs/inquire/index.js":function(module){module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},"./@protobufjs/pool/index.js":function(t){t.exports=e;function e(t,e,n){var i=n||8192,o=i>>>1,r=null,s=i;return function(n){if(n<1||n>o)return t(n);s+n>i&&(r=t(i),s=0);var u=e.call(r,s,s+=n);return 7&s&&(s=(7|s)+1),u}}},"./@protobufjs/utf8/index.js":function(t,e){var n=e;n.length=function(t){for(var e=0,n=0,i=0;i<t.length;++i)(n=t.charCodeAt(i))<128?e+=1:n<2048?e+=2:(64512&n)==55296&&(64512&t.charCodeAt(i+1))==56320?(++i,e+=4):e+=3;return e},n.read=function(t,e,n){if(n-e<1)return"";for(var i,o=null,r=[],s=0;e<n;)(i=t[e++])<128?r[s++]=i:i>191&&i<224?r[s++]=(31&i)<<6|63&t[e++]:i>239&&i<365?(i=((7&i)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,r[s++]=55296+(i>>10),r[s++]=56320+(1023&i)):r[s++]=(15&i)<<12|(63&t[e++])<<6|63&t[e++],s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,r)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,r.slice(0,s))),o.join("")):String.fromCharCode.apply(String,r.slice(0,s))},n.write=function(t,e,n){for(var i,o,r=n,s=0;s<t.length;++s)(i=t.charCodeAt(s))<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:((64512&i)==55296&&(64512&(o=t.charCodeAt(s+1)))==56320?(i=65536+((1023&i)<<10)+(1023&o),++s,e[n++]=i>>18|240,e[n++]=i>>12&63|128):e[n++]=i>>12|224,e[n++]=i>>6&63|128),e[n++]=63&i|128);return n-r}},"./protobufjs/minimal.js":function(t,e,n){t.exports=n("./protobufjs/src/index-minimal.js")},"./protobufjs/src/index-minimal.js":function(t,e,n){var i=e;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=n("./protobufjs/src/writer.js"),i.BufferWriter=n("./protobufjs/src/writer_buffer.js"),i.Reader=n("./protobufjs/src/reader.js"),i.BufferReader=n("./protobufjs/src/reader_buffer.js"),i.util=n("./protobufjs/src/util/minimal.js"),i.rpc=n("./protobufjs/src/rpc.js"),i.roots=n("./protobufjs/src/roots.js"),i.configure=o,o()},"./protobufjs/src/reader.js":function(t,e,n){t.exports=a;var i,o=n("./protobufjs/src/util/minimal.js"),r=o.LongBits,s=o.utf8;function u(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function a(t){this.buf=t,this.pos=0,this.len=t.length}var f="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new a(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new a(t);throw Error("illegal buffer")},c=function(){return o.Buffer?function(t){return(a.create=function(t){return o.Buffer.isBuffer(t)?new i(t):f(t)})(t)}:f};function p(){var t=new r(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function l(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw u(this,8);return new r(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}a.create=c(),a.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,a.prototype.uint32=function(){var t=0xffffffff;return function(){if(t=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(t=(t|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,u(this,10);return t}}(),a.prototype.int32=function(){return 0|this.uint32()},a.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)},a.prototype.bool=function(){return 0!==this.uint32()},a.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return l(this.buf,this.pos+=4)},a.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|l(this.buf,this.pos+=4)},a.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},a.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},a.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,n);if(e===n){var i=o.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,n)},a.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},a.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do if(this.pos>=this.len)throw u(this);while(128&this.buf[this.pos++]);return this},a.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},a._configure=function(t){i=t,a.create=c(),i._configure();var e=o.Long?"toLong":"toNumber";o.merge(a.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return h.call(this)[e](!0)},sfixed64:function(){return h.call(this)[e](!1)}})}},"./protobufjs/src/reader_buffer.js":function(t,e,n){t.exports=r;var i=n("./protobufjs/src/reader.js");(r.prototype=Object.create(i.prototype)).constructor=r;var o=n("./protobufjs/src/util/minimal.js");function r(t){i.call(this,t)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},r._configure()},"./protobufjs/src/roots.js":function(t){t.exports={}},"./protobufjs/src/rpc.js":function(t,e,n){e.Service=n("./protobufjs/src/rpc/service.js")},"./protobufjs/src/rpc/service.js":function(t,e,n){t.exports=o;var i=n("./protobufjs/src/util/minimal.js");function o(t,e,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!n}(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function t(e,n,o,r,s){if(!r)throw TypeError("request must be specified");var u=this;if(!s)return i.asPromise(t,u,e,n,o,r);if(!u.rpcImpl)return void setTimeout(function(){s(Error("already ended"))},0);try{return u.rpcImpl(e,n[u.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(t,n){if(t)return u.emit("error",t,e),s(t);if(null===n)return void u.end(!0);if(!(n instanceof o))try{n=o[u.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return u.emit("error",t,e),s(t)}return u.emit("data",n,e),s(null,n)})}catch(t){u.emit("error",t,e),setTimeout(function(){s(t)},0);return}},o.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},"./protobufjs/src/util/longbits.js":function(t,e,n){t.exports=o;var i=n("./protobufjs/src/util/minimal.js");function o(t,e){this.lo=t>>>0,this.hi=e>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(t){if(0===t)return r;var e=t<0;e&&(t=-t);var n=t>>>0,i=(t-n)/0x100000000>>>0;return e&&(i=~i>>>0,n=~n>>>0,++n>0xffffffff&&(n=0,++i>0xffffffff&&(i=0))),new o(n,i)},o.from=function(t){if("number"==typeof t)return o.fromNumber(t);if(i.isString(t))if(!i.Long)return o.fromNumber(parseInt(t,10));else t=i.Long.fromString(t);return t.low||t.high?new o(t.low>>>0,t.high>>>0):r},o.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+0x100000000*n)}return this.lo+0x100000000*this.hi},o.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var u=String.prototype.charCodeAt;o.fromHash=function(t){return t===s?r:new o((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},o.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},o.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},"./protobufjs/src/util/minimal.js":function(t,e,n){var i=e;function o(t,e,n){for(var i=Object.keys(e),o=0;o<i.length;++o)void 0!==t[i[o]]&&n||(t[i[o]]=e[i[o]]);return t}function r(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack||""}),n&&o(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}i.asPromise=n("./@protobufjs/aspromise/index.js"),i.base64=n("./@protobufjs/base64/index.js"),i.EventEmitter=n("./@protobufjs/eventemitter/index.js"),i.float=n("./@protobufjs/float/index.js"),i.inquire=n("./@protobufjs/inquire/index.js"),i.utf8=n("./@protobufjs/utf8/index.js"),i.pool=n("./@protobufjs/pool/index.js"),i.LongBits=n("./protobufjs/src/util/longbits.js"),i.isNode=!!("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return"string"==typeof t||t instanceof String},i.isObject=function(t){return t&&"object"==typeof t},i.isset=i.isSet=function(t,e){var n=t[e];return!!(null!=n&&t.hasOwnProperty(e))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},i.Buffer=function(){try{var t=i.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(t){return"number"==typeof t?i.Buffer?i._Buffer_allocUnsafe(t):new i.Array(t):i.Buffer?i._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(t){return t?i.LongBits.from(t).toHash():i.LongBits.zeroHash},i.longFromHash=function(t,e){var n=i.LongBits.fromHash(t);return i.Long?i.Long.fromBits(n.lo,n.hi,e):n.toNumber(!!e)},i.merge=o,i.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;n>-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},i.oneOfSetter=function(t){return function(e){for(var n=0;n<t.length;++n)t[n]!==e&&delete this[t[n]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var t=i.Buffer;if(!t){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=t.from!==Uint8Array.from&&t.from||function(e,n){return new t(e,n)},i._Buffer_allocUnsafe=t.allocUnsafe||function(e){return new t(e)}}},"./protobufjs/src/writer.js":function(t,e,n){t.exports=p;var i,o=n("./protobufjs/src/util/minimal.js"),r=o.LongBits,s=o.base64,u=o.utf8;function a(t,e,n){this.fn=t,this.len=e,this.next=void 0,this.val=n}function f(){}function c(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function p(){this.len=0,this.head=new a(f,0,0),this.tail=this.head,this.states=null}var l=function(){return o.Buffer?function(){return(p.create=function(){return new i})()}:function(){return new p}};function h(t,e,n){e[n]=255&t}function d(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t}function g(t,e){this.len=t,this.next=void 0,this.val=e}function y(t,e,n){for(;t.hi;)e[n++]=127&t.lo|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function m(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}p.create=l(),p.alloc=function(t){return new o.Array(t)},o.Array!==Array&&(p.alloc=o.pool(p.alloc,o.Array.prototype.subarray)),p.prototype._push=function(t,e,n){return this.tail=this.tail.next=new a(t,e,n),this.len+=e,this},g.prototype=Object.create(a.prototype),g.prototype.fn=d,p.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new g((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<0x10000000?4:5,t)).len,this},p.prototype.int32=function(t){return t<0?this._push(y,10,r.fromNumber(t)):this.uint32(t)},p.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},p.prototype.uint64=function(t){var e=r.from(t);return this._push(y,e.length(),e)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(t){var e=r.from(t).zzEncode();return this._push(y,e.length(),e)},p.prototype.bool=function(t){return this._push(h,1,+!!t)},p.prototype.fixed32=function(t){return this._push(m,4,t>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(t){var e=r.from(t);return this._push(m,4,e.lo)._push(m,4,e.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(t){return this._push(o.float.writeFloatLE,4,t)},p.prototype.double=function(t){return this._push(o.float.writeDoubleLE,8,t)};var b=o.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var i=0;i<t.length;++i)e[n+i]=t[i]};p.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(h,1,0);if(o.isString(t)){var n=p.alloc(e=s.length(t));s.decode(t,n,0),t=n}return this.uint32(e)._push(b,e,t)},p.prototype.string=function(t){var e=u.length(t);return e?this.uint32(e)._push(u.write,e,t):this._push(h,1,0)},p.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new a(f,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new a(f,0,0),this.len=0),this},p.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},p.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},p._configure=function(t){i=t,p.create=l(),i._configure()}},"./protobufjs/src/writer_buffer.js":function(t,e,n){t.exports=r;var i=n("./protobufjs/src/writer.js");(r.prototype=Object.create(i.prototype)).constructor=r;var o=n("./protobufjs/src/util/minimal.js");function r(){i.call(this)}function s(t,e,n){t.length<40?o.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var i=0;i<t.length;)e[n++]=t[i++]}},r.prototype.bytes=function(t){o.isString(t)&&(t=o._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(r.writeBytesBuffer,e,t),this},r.prototype.string=function(t){var e=o.Buffer.byteLength(t);return this.uint32(e),e&&this._push(s,e,t),this},r._configure()}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var n=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(n.exports,n,n.exports,__webpack_require__),n.exports}var __webpack_exports__=__webpack_require__("./@datadog/sketches-js/dist/index.js");module.exports=__webpack_exports__})();
@@ -0,0 +1,28 @@
1
+
2
+ Copyright (c) 2009-2011, Mozilla Foundation and contributors
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ * Neither the names of the Mozilla Foundation nor the names of project
16
+ contributors may be used to endorse or promote products derived from this
17
+ software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.