@microsoft/opentelemetry 0.1.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +91 -0
- package/dist/commonjs/_a365/configuration/A365Configuration.d.ts +42 -0
- package/dist/commonjs/_a365/configuration/A365Configuration.d.ts.map +1 -0
- package/dist/commonjs/_a365/configuration/A365Configuration.js +146 -0
- package/dist/commonjs/_a365/configuration/A365Configuration.js.map +1 -0
- package/dist/commonjs/_a365/configuration/A365ConfigurationOptions.d.ts +53 -0
- package/dist/commonjs/_a365/configuration/A365ConfigurationOptions.d.ts.map +1 -0
- package/dist/commonjs/_a365/configuration/A365ConfigurationOptions.js +5 -0
- package/dist/commonjs/_a365/configuration/A365ConfigurationOptions.js.map +1 -0
- package/dist/commonjs/_a365/configuration/index.d.ts +3 -0
- package/dist/commonjs/_a365/configuration/index.d.ts.map +1 -0
- package/dist/commonjs/_a365/configuration/index.js +9 -0
- package/dist/commonjs/_a365/configuration/index.js.map +1 -0
- package/dist/commonjs/_a365/exporter/Agent365Exporter.d.ts +25 -0
- package/dist/commonjs/_a365/exporter/Agent365Exporter.d.ts.map +1 -0
- package/dist/commonjs/_a365/exporter/Agent365Exporter.js +220 -0
- package/dist/commonjs/_a365/exporter/Agent365Exporter.js.map +1 -0
- package/dist/commonjs/_a365/exporter/Agent365ExporterOptions.d.ts +43 -0
- package/dist/commonjs/_a365/exporter/Agent365ExporterOptions.d.ts.map +1 -0
- package/dist/commonjs/_a365/exporter/Agent365ExporterOptions.js +30 -0
- package/dist/commonjs/_a365/exporter/Agent365ExporterOptions.js.map +1 -0
- package/dist/commonjs/_a365/exporter/ExporterEventNames.d.ts +9 -0
- package/dist/commonjs/_a365/exporter/ExporterEventNames.d.ts.map +1 -0
- package/dist/commonjs/_a365/exporter/ExporterEventNames.js +15 -0
- package/dist/commonjs/_a365/exporter/ExporterEventNames.js.map +1 -0
- package/dist/commonjs/_a365/exporter/index.d.ts +6 -0
- package/dist/commonjs/_a365/exporter/index.d.ts.map +1 -0
- package/dist/commonjs/_a365/exporter/index.js +15 -0
- package/dist/commonjs/_a365/exporter/index.js.map +1 -0
- package/dist/commonjs/_a365/exporter/utils.d.ts +41 -0
- package/dist/commonjs/_a365/exporter/utils.d.ts.map +1 -0
- package/dist/commonjs/_a365/exporter/utils.js +410 -0
- package/dist/commonjs/_a365/exporter/utils.js.map +1 -0
- package/dist/commonjs/_a365/index.d.ts +6 -0
- package/dist/commonjs/_a365/index.d.ts.map +1 -0
- package/dist/commonjs/_a365/index.js +13 -0
- package/dist/commonjs/_a365/index.js.map +1 -0
- package/dist/commonjs/_a365/utils/utils.d.ts +6 -0
- package/dist/commonjs/_a365/utils/utils.d.ts.map +1 -0
- package/dist/commonjs/_a365/utils/utils.js +14 -0
- package/dist/commonjs/_a365/utils/utils.js.map +1 -0
- package/dist/commonjs/azureMonitorSetup.d.ts +14 -0
- package/dist/commonjs/azureMonitorSetup.d.ts.map +1 -0
- package/dist/commonjs/azureMonitorSetup.js +56 -0
- package/dist/commonjs/azureMonitorSetup.js.map +1 -0
- package/dist/commonjs/browserSdkLoader/browserSdkLoader.d.ts +31 -0
- package/dist/commonjs/browserSdkLoader/browserSdkLoader.d.ts.map +1 -0
- package/dist/commonjs/browserSdkLoader/browserSdkLoader.js +374 -0
- package/dist/commonjs/browserSdkLoader/browserSdkLoader.js.map +1 -0
- package/dist/commonjs/browserSdkLoader/browserSdkLoaderHelper.d.ts +24 -0
- package/dist/commonjs/browserSdkLoader/browserSdkLoaderHelper.d.ts.map +1 -0
- package/dist/commonjs/browserSdkLoader/browserSdkLoaderHelper.js +183 -0
- package/dist/commonjs/browserSdkLoader/browserSdkLoaderHelper.js.map +1 -0
- package/dist/commonjs/distro/autoAttach.d.ts +6 -0
- package/dist/commonjs/distro/autoAttach.d.ts.map +1 -0
- package/dist/commonjs/distro/autoAttach.js +30 -0
- package/dist/commonjs/distro/autoAttach.js.map +1 -0
- package/dist/commonjs/distro/distro.d.ts +24 -0
- package/dist/commonjs/distro/distro.d.ts.map +1 -0
- package/dist/commonjs/distro/distro.js +125 -0
- package/dist/commonjs/distro/distro.js.map +1 -0
- package/dist/commonjs/distro/index.d.ts +4 -0
- package/dist/commonjs/distro/index.d.ts.map +1 -0
- package/dist/commonjs/distro/index.js +11 -0
- package/dist/commonjs/distro/index.js.map +1 -0
- package/dist/commonjs/distro/types.d.ts +41 -0
- package/dist/commonjs/distro/types.d.ts.map +1 -0
- package/dist/commonjs/distro/types.js +10 -0
- package/dist/commonjs/distro/types.js.map +1 -0
- package/dist/commonjs/genai/index.d.ts +2 -0
- package/dist/commonjs/genai/index.d.ts.map +1 -0
- package/dist/commonjs/genai/index.js +20 -0
- package/dist/commonjs/genai/index.js.map +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/index.d.ts +3 -0
- package/dist/commonjs/genai/instrumentations/langchain/index.d.ts.map +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/index.js +10 -0
- package/dist/commonjs/genai/instrumentations/langchain/index.js.map +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/langchainTraceInstrumentor.d.ts +34 -0
- package/dist/commonjs/genai/instrumentations/langchain/langchainTraceInstrumentor.d.ts.map +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/langchainTraceInstrumentor.js +164 -0
- package/dist/commonjs/genai/instrumentations/langchain/langchainTraceInstrumentor.js.map +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/tracer.d.ts +59 -0
- package/dist/commonjs/genai/instrumentations/langchain/tracer.d.ts.map +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/tracer.js +218 -0
- package/dist/commonjs/genai/instrumentations/langchain/tracer.js.map +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/utils.d.ts +16 -0
- package/dist/commonjs/genai/instrumentations/langchain/utils.d.ts.map +1 -0
- package/dist/commonjs/genai/instrumentations/langchain/utils.js +320 -0
- package/dist/commonjs/genai/instrumentations/langchain/utils.js.map +1 -0
- package/dist/commonjs/genai/semconv.d.ts +33 -0
- package/dist/commonjs/genai/semconv.d.ts.map +1 -0
- package/dist/commonjs/genai/semconv.js +46 -0
- package/dist/commonjs/genai/semconv.js.map +1 -0
- package/dist/commonjs/genai/utils.d.ts +13 -0
- package/dist/commonjs/genai/utils.d.ts.map +1 -0
- package/dist/commonjs/genai/utils.js +39 -0
- package/dist/commonjs/genai/utils.js.map +1 -0
- package/dist/commonjs/generated/api/index.d.ts +4 -0
- package/dist/commonjs/generated/api/index.d.ts.map +1 -0
- package/dist/commonjs/generated/api/index.js +11 -0
- package/dist/commonjs/generated/api/index.js.map +1 -0
- package/dist/commonjs/generated/api/operations.d.ts +13 -0
- package/dist/commonjs/generated/api/operations.d.ts.map +1 -0
- package/dist/commonjs/generated/api/operations.js +107 -0
- package/dist/commonjs/generated/api/operations.js.map +1 -0
- package/dist/commonjs/generated/api/options.d.ts +31 -0
- package/dist/commonjs/generated/api/options.d.ts.map +1 -0
- package/dist/commonjs/generated/api/options.js +5 -0
- package/dist/commonjs/generated/api/options.js.map +1 -0
- package/dist/commonjs/generated/api/quickpulseContext.d.ts +17 -0
- package/dist/commonjs/generated/api/quickpulseContext.d.ts.map +1 -0
- package/dist/commonjs/generated/api/quickpulseContext.js +26 -0
- package/dist/commonjs/generated/api/quickpulseContext.js.map +1 -0
- package/dist/commonjs/generated/index.d.ts +4 -0
- package/dist/commonjs/generated/index.d.ts.map +1 -0
- package/dist/commonjs/generated/index.js +10 -0
- package/dist/commonjs/generated/index.js.map +1 -0
- package/dist/commonjs/generated/logger.d.ts +2 -0
- package/dist/commonjs/generated/logger.d.ts.map +1 -0
- package/dist/commonjs/generated/logger.js +8 -0
- package/dist/commonjs/generated/logger.js.map +1 -0
- package/dist/commonjs/generated/models/index.d.ts +2 -0
- package/dist/commonjs/generated/models/index.d.ts.map +1 -0
- package/dist/commonjs/generated/models/index.js +8 -0
- package/dist/commonjs/generated/models/index.js.map +1 -0
- package/dist/commonjs/generated/models/models.d.ts +265 -0
- package/dist/commonjs/generated/models/models.d.ts.map +1 -0
- package/dist/commonjs/generated/models/models.js +393 -0
- package/dist/commonjs/generated/models/models.js.map +1 -0
- package/dist/commonjs/generated/quickpulseClient.d.ts +18 -0
- package/dist/commonjs/generated/quickpulseClient.d.ts.map +1 -0
- package/dist/commonjs/generated/quickpulseClient.js +34 -0
- package/dist/commonjs/generated/quickpulseClient.js.map +1 -0
- package/dist/commonjs/generated/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/commonjs/generated/static-helpers/urlTemplate.d.ts.map +1 -0
- package/dist/commonjs/generated/static-helpers/urlTemplate.js +203 -0
- package/dist/commonjs/generated/static-helpers/urlTemplate.js.map +1 -0
- package/dist/commonjs/index.d.ts +20 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +32 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/loader.d.ts +2 -0
- package/dist/commonjs/loader.d.ts.map +1 -0
- package/dist/commonjs/loader.js +72 -0
- package/dist/commonjs/loader.js.map +1 -0
- package/dist/commonjs/logs/batchLogRecordProcessor.d.ts +14 -0
- package/dist/commonjs/logs/batchLogRecordProcessor.d.ts.map +1 -0
- package/dist/commonjs/logs/batchLogRecordProcessor.js +32 -0
- package/dist/commonjs/logs/batchLogRecordProcessor.js.map +1 -0
- package/dist/commonjs/logs/handler.d.ts +30 -0
- package/dist/commonjs/logs/handler.d.ts.map +1 -0
- package/dist/commonjs/logs/handler.js +67 -0
- package/dist/commonjs/logs/handler.js.map +1 -0
- package/dist/commonjs/logs/index.d.ts +2 -0
- package/dist/commonjs/logs/index.d.ts.map +1 -0
- package/dist/commonjs/logs/index.js +8 -0
- package/dist/commonjs/logs/index.js.map +1 -0
- package/dist/commonjs/logs/logRecordProcessor.d.ts +14 -0
- package/dist/commonjs/logs/logRecordProcessor.d.ts.map +1 -0
- package/dist/commonjs/logs/logRecordProcessor.js +32 -0
- package/dist/commonjs/logs/logRecordProcessor.js.map +1 -0
- package/dist/commonjs/metrics/handler.d.ts +33 -0
- package/dist/commonjs/metrics/handler.d.ts.map +1 -0
- package/dist/commonjs/metrics/handler.js +130 -0
- package/dist/commonjs/metrics/handler.js.map +1 -0
- package/dist/commonjs/metrics/index.d.ts +2 -0
- package/dist/commonjs/metrics/index.d.ts.map +1 -0
- package/dist/commonjs/metrics/index.js +8 -0
- package/dist/commonjs/metrics/index.js.map +1 -0
- package/dist/commonjs/metrics/performanceCounters.d.ts +77 -0
- package/dist/commonjs/metrics/performanceCounters.d.ts.map +1 -0
- package/dist/commonjs/metrics/performanceCounters.js +336 -0
- package/dist/commonjs/metrics/performanceCounters.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/export/exporter.d.ts +46 -0
- package/dist/commonjs/metrics/quickpulse/export/exporter.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/export/exporter.js +100 -0
- package/dist/commonjs/metrics/quickpulse/export/exporter.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/export/sender.d.ts +47 -0
- package/dist/commonjs/metrics/quickpulse/export/sender.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/export/sender.js +125 -0
- package/dist/commonjs/metrics/quickpulse/export/sender.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.d.ts +22 -0
- package/dist/commonjs/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.js +40 -0
- package/dist/commonjs/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/filter.d.ts +12 -0
- package/dist/commonjs/metrics/quickpulse/filtering/filter.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/filter.js +158 -0
- package/dist/commonjs/metrics/quickpulse/filtering/filter.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/projection.d.ts +13 -0
- package/dist/commonjs/metrics/quickpulse/filtering/projection.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/projection.js +120 -0
- package/dist/commonjs/metrics/quickpulse/filtering/projection.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/quickpulseErrors.d.ts +13 -0
- package/dist/commonjs/metrics/quickpulse/filtering/quickpulseErrors.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/quickpulseErrors.js +34 -0
- package/dist/commonjs/metrics/quickpulse/filtering/quickpulseErrors.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/validator.d.ts +11 -0
- package/dist/commonjs/metrics/quickpulse/filtering/validator.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/filtering/validator.js +160 -0
- package/dist/commonjs/metrics/quickpulse/filtering/validator.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/liveMetrics.d.ts +112 -0
- package/dist/commonjs/metrics/quickpulse/liveMetrics.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/liveMetrics.js +716 -0
- package/dist/commonjs/metrics/quickpulse/liveMetrics.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/types.d.ts +110 -0
- package/dist/commonjs/metrics/quickpulse/types.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/types.js +121 -0
- package/dist/commonjs/metrics/quickpulse/types.js.map +1 -0
- package/dist/commonjs/metrics/quickpulse/utils.d.ts +43 -0
- package/dist/commonjs/metrics/quickpulse/utils.d.ts.map +1 -0
- package/dist/commonjs/metrics/quickpulse/utils.js +563 -0
- package/dist/commonjs/metrics/quickpulse/utils.js.map +1 -0
- package/dist/commonjs/metrics/standardMetrics.d.ts +56 -0
- package/dist/commonjs/metrics/standardMetrics.d.ts.map +1 -0
- package/dist/commonjs/metrics/standardMetrics.js +138 -0
- package/dist/commonjs/metrics/standardMetrics.js.map +1 -0
- package/dist/commonjs/metrics/types.d.ts +48 -0
- package/dist/commonjs/metrics/types.d.ts.map +1 -0
- package/dist/commonjs/metrics/types.js +50 -0
- package/dist/commonjs/metrics/types.js.map +1 -0
- package/dist/commonjs/metrics/utils.d.ts +35 -0
- package/dist/commonjs/metrics/utils.d.ts.map +1 -0
- package/dist/commonjs/metrics/utils.js +273 -0
- package/dist/commonjs/metrics/utils.js.map +1 -0
- package/dist/commonjs/otlp/handler.d.ts +100 -0
- package/dist/commonjs/otlp/handler.d.ts.map +1 -0
- package/dist/commonjs/otlp/handler.js +142 -0
- package/dist/commonjs/otlp/handler.js.map +1 -0
- package/dist/commonjs/otlp/index.d.ts +3 -0
- package/dist/commonjs/otlp/index.d.ts.map +1 -0
- package/dist/commonjs/otlp/index.js +9 -0
- package/dist/commonjs/otlp/index.js.map +1 -0
- package/dist/commonjs/shared/config.d.ts +57 -0
- package/dist/commonjs/shared/config.d.ts.map +1 -0
- package/dist/commonjs/shared/config.js +218 -0
- package/dist/commonjs/shared/config.js.map +1 -0
- package/dist/commonjs/shared/envConfig.d.ts +25 -0
- package/dist/commonjs/shared/envConfig.d.ts.map +1 -0
- package/dist/commonjs/shared/envConfig.js +129 -0
- package/dist/commonjs/shared/envConfig.js.map +1 -0
- package/dist/commonjs/shared/index.d.ts +2 -0
- package/dist/commonjs/shared/index.d.ts.map +1 -0
- package/dist/commonjs/shared/index.js +8 -0
- package/dist/commonjs/shared/index.js.map +1 -0
- package/dist/commonjs/shared/jsonConfig.d.ts +35 -0
- package/dist/commonjs/shared/jsonConfig.d.ts.map +1 -0
- package/dist/commonjs/shared/jsonConfig.js +122 -0
- package/dist/commonjs/shared/jsonConfig.js.map +1 -0
- package/dist/commonjs/shared/logging/diagFileConsoleLogger.d.ts +32 -0
- package/dist/commonjs/shared/logging/diagFileConsoleLogger.d.ts.map +1 -0
- package/dist/commonjs/shared/logging/diagFileConsoleLogger.js +246 -0
- package/dist/commonjs/shared/logging/diagFileConsoleLogger.js.map +1 -0
- package/dist/commonjs/shared/logging/index.d.ts +2 -0
- package/dist/commonjs/shared/logging/index.d.ts.map +1 -0
- package/dist/commonjs/shared/logging/index.js +8 -0
- package/dist/commonjs/shared/logging/index.js.map +1 -0
- package/dist/commonjs/shared/logging/logger.d.ts +18 -0
- package/dist/commonjs/shared/logging/logger.d.ts.map +1 -0
- package/dist/commonjs/shared/logging/logger.js +132 -0
- package/dist/commonjs/shared/logging/logger.js.map +1 -0
- package/dist/commonjs/shared/module-cjs.cjs +34 -0
- package/dist/commonjs/shared/module-cjs.cjs.map +1 -0
- package/dist/commonjs/shared/module-cjs.d.cts +12 -0
- package/dist/commonjs/shared/module-cjs.d.cts.map +1 -0
- package/dist/commonjs/shared/module.d.ts +13 -0
- package/dist/commonjs/shared/module.d.ts.map +1 -0
- package/dist/commonjs/shared/module.js +30 -0
- package/dist/commonjs/shared/module.js.map +1 -0
- package/dist/commonjs/traces/handler.d.ts +37 -0
- package/dist/commonjs/traces/handler.d.ts.map +1 -0
- package/dist/commonjs/traces/handler.js +125 -0
- package/dist/commonjs/traces/handler.js.map +1 -0
- package/dist/commonjs/traces/index.d.ts +2 -0
- package/dist/commonjs/traces/index.d.ts.map +1 -0
- package/dist/commonjs/traces/index.js +8 -0
- package/dist/commonjs/traces/index.js.map +1 -0
- package/dist/commonjs/traces/sampler.d.ts +42 -0
- package/dist/commonjs/traces/sampler.d.ts.map +1 -0
- package/dist/commonjs/traces/sampler.js +88 -0
- package/dist/commonjs/traces/sampler.js.map +1 -0
- package/dist/commonjs/traces/spanProcessor.d.ts +16 -0
- package/dist/commonjs/traces/spanProcessor.d.ts.map +1 -0
- package/dist/commonjs/traces/spanProcessor.js +35 -0
- package/dist/commonjs/traces/spanProcessor.js.map +1 -0
- package/dist/commonjs/types.d.ts +259 -0
- package/dist/commonjs/types.d.ts.map +1 -0
- package/dist/commonjs/types.js +143 -0
- package/dist/commonjs/types.js.map +1 -0
- package/dist/commonjs/utils/common.d.ts +37 -0
- package/dist/commonjs/utils/common.d.ts.map +1 -0
- package/dist/commonjs/utils/common.js +148 -0
- package/dist/commonjs/utils/common.js.map +1 -0
- package/dist/commonjs/utils/connectionStringParser.d.ts +13 -0
- package/dist/commonjs/utils/connectionStringParser.d.ts.map +1 -0
- package/dist/commonjs/utils/connectionStringParser.js +82 -0
- package/dist/commonjs/utils/connectionStringParser.js.map +1 -0
- package/dist/commonjs/utils/fileSystem.d.ts +27 -0
- package/dist/commonjs/utils/fileSystem.d.ts.map +1 -0
- package/dist/commonjs/utils/fileSystem.js +86 -0
- package/dist/commonjs/utils/fileSystem.js.map +1 -0
- package/dist/commonjs/utils/index.d.ts +3 -0
- package/dist/commonjs/utils/index.d.ts.map +1 -0
- package/dist/commonjs/utils/index.js +22 -0
- package/dist/commonjs/utils/index.js.map +1 -0
- package/dist/commonjs/utils/logUtils.d.ts +7 -0
- package/dist/commonjs/utils/logUtils.d.ts.map +1 -0
- package/dist/commonjs/utils/logUtils.js +35 -0
- package/dist/commonjs/utils/logUtils.js.map +1 -0
- package/dist/commonjs/utils/opentelemetryInstrumentationPatcher.d.ts +6 -0
- package/dist/commonjs/utils/opentelemetryInstrumentationPatcher.d.ts.map +1 -0
- package/dist/commonjs/utils/opentelemetryInstrumentationPatcher.js +44 -0
- package/dist/commonjs/utils/opentelemetryInstrumentationPatcher.js.map +1 -0
- package/dist/commonjs/utils/statsbeat.d.ts +15 -0
- package/dist/commonjs/utils/statsbeat.d.ts.map +1 -0
- package/dist/commonjs/utils/statsbeat.js +127 -0
- package/dist/commonjs/utils/statsbeat.js.map +1 -0
- package/dist/commonjs/utils/types.d.ts +14 -0
- package/dist/commonjs/utils/types.d.ts.map +1 -0
- package/dist/commonjs/utils/types.js +5 -0
- package/dist/commonjs/utils/types.js.map +1 -0
- package/dist/esm/_a365/configuration/A365Configuration.d.ts +42 -0
- package/dist/esm/_a365/configuration/A365Configuration.d.ts.map +1 -0
- package/dist/esm/_a365/configuration/A365Configuration.js +142 -0
- package/dist/esm/_a365/configuration/A365Configuration.js.map +1 -0
- package/dist/esm/_a365/configuration/A365ConfigurationOptions.d.ts +53 -0
- package/dist/esm/_a365/configuration/A365ConfigurationOptions.d.ts.map +1 -0
- package/dist/esm/_a365/configuration/A365ConfigurationOptions.js +4 -0
- package/dist/esm/_a365/configuration/A365ConfigurationOptions.js.map +1 -0
- package/dist/esm/_a365/configuration/index.d.ts +3 -0
- package/dist/esm/_a365/configuration/index.d.ts.map +1 -0
- package/dist/esm/_a365/configuration/index.js +4 -0
- package/dist/esm/_a365/configuration/index.js.map +1 -0
- package/dist/esm/_a365/exporter/Agent365Exporter.d.ts +25 -0
- package/dist/esm/_a365/exporter/Agent365Exporter.d.ts.map +1 -0
- package/dist/esm/_a365/exporter/Agent365Exporter.js +216 -0
- package/dist/esm/_a365/exporter/Agent365Exporter.js.map +1 -0
- package/dist/esm/_a365/exporter/Agent365ExporterOptions.d.ts +43 -0
- package/dist/esm/_a365/exporter/Agent365ExporterOptions.d.ts.map +1 -0
- package/dist/esm/_a365/exporter/Agent365ExporterOptions.js +26 -0
- package/dist/esm/_a365/exporter/Agent365ExporterOptions.js.map +1 -0
- package/dist/esm/_a365/exporter/ExporterEventNames.d.ts +9 -0
- package/dist/esm/_a365/exporter/ExporterEventNames.d.ts.map +1 -0
- package/dist/esm/_a365/exporter/ExporterEventNames.js +12 -0
- package/dist/esm/_a365/exporter/ExporterEventNames.js.map +1 -0
- package/dist/esm/_a365/exporter/index.d.ts +6 -0
- package/dist/esm/_a365/exporter/index.d.ts.map +1 -0
- package/dist/esm/_a365/exporter/index.js +7 -0
- package/dist/esm/_a365/exporter/index.js.map +1 -0
- package/dist/esm/_a365/exporter/utils.d.ts +41 -0
- package/dist/esm/_a365/exporter/utils.d.ts.map +1 -0
- package/dist/esm/_a365/exporter/utils.js +398 -0
- package/dist/esm/_a365/exporter/utils.js.map +1 -0
- package/dist/esm/_a365/index.d.ts +6 -0
- package/dist/esm/_a365/index.d.ts.map +1 -0
- package/dist/esm/_a365/index.js +6 -0
- package/dist/esm/_a365/index.js.map +1 -0
- package/dist/esm/_a365/utils/utils.d.ts +6 -0
- package/dist/esm/_a365/utils/utils.d.ts.map +1 -0
- package/dist/esm/_a365/utils/utils.js +11 -0
- package/dist/esm/_a365/utils/utils.js.map +1 -0
- package/dist/esm/azureMonitorSetup.d.ts +14 -0
- package/dist/esm/azureMonitorSetup.d.ts.map +1 -0
- package/dist/esm/azureMonitorSetup.js +53 -0
- package/dist/esm/azureMonitorSetup.js.map +1 -0
- package/dist/esm/browserSdkLoader/browserSdkLoader.d.ts +31 -0
- package/dist/esm/browserSdkLoader/browserSdkLoader.d.ts.map +1 -0
- package/dist/esm/browserSdkLoader/browserSdkLoader.js +334 -0
- package/dist/esm/browserSdkLoader/browserSdkLoader.js.map +1 -0
- package/dist/esm/browserSdkLoader/browserSdkLoaderHelper.d.ts +24 -0
- package/dist/esm/browserSdkLoader/browserSdkLoaderHelper.d.ts.map +1 -0
- package/dist/esm/browserSdkLoader/browserSdkLoaderHelper.js +136 -0
- package/dist/esm/browserSdkLoader/browserSdkLoaderHelper.js.map +1 -0
- package/dist/esm/distro/autoAttach.d.ts +6 -0
- package/dist/esm/distro/autoAttach.d.ts.map +1 -0
- package/dist/esm/distro/autoAttach.js +27 -0
- package/dist/esm/distro/autoAttach.js.map +1 -0
- package/dist/esm/distro/distro.d.ts +24 -0
- package/dist/esm/distro/distro.d.ts.map +1 -0
- package/dist/esm/distro/distro.js +120 -0
- package/dist/esm/distro/distro.js.map +1 -0
- package/dist/esm/distro/index.d.ts +4 -0
- package/dist/esm/distro/index.d.ts.map +1 -0
- package/dist/esm/distro/index.js +5 -0
- package/dist/esm/distro/index.js.map +1 -0
- package/dist/esm/distro/types.d.ts +41 -0
- package/dist/esm/distro/types.d.ts.map +1 -0
- package/dist/esm/distro/types.js +7 -0
- package/dist/esm/distro/types.js.map +1 -0
- package/dist/esm/genai/index.d.ts +2 -0
- package/dist/esm/genai/index.d.ts.map +1 -0
- package/dist/esm/genai/index.js +4 -0
- package/dist/esm/genai/index.js.map +1 -0
- package/dist/esm/genai/instrumentations/langchain/index.d.ts +3 -0
- package/dist/esm/genai/instrumentations/langchain/index.d.ts.map +1 -0
- package/dist/esm/genai/instrumentations/langchain/index.js +5 -0
- package/dist/esm/genai/instrumentations/langchain/index.js.map +1 -0
- package/dist/esm/genai/instrumentations/langchain/langchainTraceInstrumentor.d.ts +34 -0
- package/dist/esm/genai/instrumentations/langchain/langchainTraceInstrumentor.d.ts.map +1 -0
- package/dist/esm/genai/instrumentations/langchain/langchainTraceInstrumentor.js +159 -0
- package/dist/esm/genai/instrumentations/langchain/langchainTraceInstrumentor.js.map +1 -0
- package/dist/esm/genai/instrumentations/langchain/tracer.d.ts +59 -0
- package/dist/esm/genai/instrumentations/langchain/tracer.d.ts.map +1 -0
- package/dist/esm/genai/instrumentations/langchain/tracer.js +181 -0
- package/dist/esm/genai/instrumentations/langchain/tracer.js.map +1 -0
- package/dist/esm/genai/instrumentations/langchain/utils.d.ts +16 -0
- package/dist/esm/genai/instrumentations/langchain/utils.d.ts.map +1 -0
- package/dist/esm/genai/instrumentations/langchain/utils.js +305 -0
- package/dist/esm/genai/instrumentations/langchain/utils.js.map +1 -0
- package/dist/esm/genai/semconv.d.ts +33 -0
- package/dist/esm/genai/semconv.d.ts.map +1 -0
- package/dist/esm/genai/semconv.js +43 -0
- package/dist/esm/genai/semconv.js.map +1 -0
- package/dist/esm/genai/utils.d.ts +13 -0
- package/dist/esm/genai/utils.d.ts.map +1 -0
- package/dist/esm/genai/utils.js +35 -0
- package/dist/esm/genai/utils.js.map +1 -0
- package/dist/esm/generated/api/index.d.ts +4 -0
- package/dist/esm/generated/api/index.d.ts.map +1 -0
- package/dist/esm/generated/api/index.js +5 -0
- package/dist/esm/generated/api/index.js.map +1 -0
- package/dist/esm/generated/api/operations.d.ts +13 -0
- package/dist/esm/generated/api/operations.d.ts.map +1 -0
- package/dist/esm/generated/api/operations.js +99 -0
- package/dist/esm/generated/api/operations.js.map +1 -0
- package/dist/esm/generated/api/options.d.ts +31 -0
- package/dist/esm/generated/api/options.d.ts.map +1 -0
- package/dist/esm/generated/api/options.js +4 -0
- package/dist/esm/generated/api/options.js.map +1 -0
- package/dist/esm/generated/api/quickpulseContext.d.ts +17 -0
- package/dist/esm/generated/api/quickpulseContext.d.ts.map +1 -0
- package/dist/esm/generated/api/quickpulseContext.js +23 -0
- package/dist/esm/generated/api/quickpulseContext.js.map +1 -0
- package/dist/esm/generated/index.d.ts +4 -0
- package/dist/esm/generated/index.d.ts.map +1 -0
- package/dist/esm/generated/index.js +5 -0
- package/dist/esm/generated/index.js.map +1 -0
- package/dist/esm/generated/logger.d.ts +2 -0
- package/dist/esm/generated/logger.d.ts.map +1 -0
- package/dist/esm/generated/logger.js +5 -0
- package/dist/esm/generated/logger.js.map +1 -0
- package/dist/esm/generated/models/index.d.ts +2 -0
- package/dist/esm/generated/models/index.d.ts.map +1 -0
- package/dist/esm/generated/models/index.js +4 -0
- package/dist/esm/generated/models/index.js.map +1 -0
- package/dist/esm/generated/models/models.d.ts +265 -0
- package/dist/esm/generated/models/models.d.ts.map +1 -0
- package/dist/esm/generated/models/models.js +347 -0
- package/dist/esm/generated/models/models.js.map +1 -0
- package/dist/esm/generated/quickpulseClient.d.ts +18 -0
- package/dist/esm/generated/quickpulseClient.d.ts.map +1 -0
- package/dist/esm/generated/quickpulseClient.js +30 -0
- package/dist/esm/generated/quickpulseClient.js.map +1 -0
- package/dist/esm/generated/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/esm/generated/static-helpers/urlTemplate.d.ts.map +1 -0
- package/dist/esm/generated/static-helpers/urlTemplate.js +200 -0
- package/dist/esm/generated/static-helpers/urlTemplate.js.map +1 -0
- package/dist/esm/index.d.ts +20 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +23 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.d.ts +2 -0
- package/dist/esm/loader.d.ts.map +1 -0
- package/dist/esm/loader.js +37 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/logs/batchLogRecordProcessor.d.ts +14 -0
- package/dist/esm/logs/batchLogRecordProcessor.d.ts.map +1 -0
- package/dist/esm/logs/batchLogRecordProcessor.js +28 -0
- package/dist/esm/logs/batchLogRecordProcessor.js.map +1 -0
- package/dist/esm/logs/handler.d.ts +30 -0
- package/dist/esm/logs/handler.d.ts.map +1 -0
- package/dist/esm/logs/handler.js +63 -0
- package/dist/esm/logs/handler.js.map +1 -0
- package/dist/esm/logs/index.d.ts +2 -0
- package/dist/esm/logs/index.d.ts.map +1 -0
- package/dist/esm/logs/index.js +4 -0
- package/dist/esm/logs/index.js.map +1 -0
- package/dist/esm/logs/logRecordProcessor.d.ts +14 -0
- package/dist/esm/logs/logRecordProcessor.d.ts.map +1 -0
- package/dist/esm/logs/logRecordProcessor.js +28 -0
- package/dist/esm/logs/logRecordProcessor.js.map +1 -0
- package/dist/esm/metrics/handler.d.ts +33 -0
- package/dist/esm/metrics/handler.d.ts.map +1 -0
- package/dist/esm/metrics/handler.js +126 -0
- package/dist/esm/metrics/handler.js.map +1 -0
- package/dist/esm/metrics/index.d.ts +2 -0
- package/dist/esm/metrics/index.d.ts.map +1 -0
- package/dist/esm/metrics/index.js +4 -0
- package/dist/esm/metrics/index.js.map +1 -0
- package/dist/esm/metrics/performanceCounters.d.ts +77 -0
- package/dist/esm/metrics/performanceCounters.d.ts.map +1 -0
- package/dist/esm/metrics/performanceCounters.js +329 -0
- package/dist/esm/metrics/performanceCounters.js.map +1 -0
- package/dist/esm/metrics/quickpulse/export/exporter.d.ts +46 -0
- package/dist/esm/metrics/quickpulse/export/exporter.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/export/exporter.js +96 -0
- package/dist/esm/metrics/quickpulse/export/exporter.js.map +1 -0
- package/dist/esm/metrics/quickpulse/export/sender.d.ts +47 -0
- package/dist/esm/metrics/quickpulse/export/sender.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/export/sender.js +118 -0
- package/dist/esm/metrics/quickpulse/export/sender.js.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.d.ts +22 -0
- package/dist/esm/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.js +36 -0
- package/dist/esm/metrics/quickpulse/filtering/collectionConfigurationErrorTracker.js.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/filter.d.ts +12 -0
- package/dist/esm/metrics/quickpulse/filtering/filter.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/filter.js +154 -0
- package/dist/esm/metrics/quickpulse/filtering/filter.js.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/projection.d.ts +13 -0
- package/dist/esm/metrics/quickpulse/filtering/projection.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/projection.js +116 -0
- package/dist/esm/metrics/quickpulse/filtering/projection.js.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/quickpulseErrors.d.ts +13 -0
- package/dist/esm/metrics/quickpulse/filtering/quickpulseErrors.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/quickpulseErrors.js +27 -0
- package/dist/esm/metrics/quickpulse/filtering/quickpulseErrors.js.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/validator.d.ts +11 -0
- package/dist/esm/metrics/quickpulse/filtering/validator.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/filtering/validator.js +156 -0
- package/dist/esm/metrics/quickpulse/filtering/validator.js.map +1 -0
- package/dist/esm/metrics/quickpulse/liveMetrics.d.ts +112 -0
- package/dist/esm/metrics/quickpulse/liveMetrics.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/liveMetrics.js +709 -0
- package/dist/esm/metrics/quickpulse/liveMetrics.js.map +1 -0
- package/dist/esm/metrics/quickpulse/types.d.ts +110 -0
- package/dist/esm/metrics/quickpulse/types.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/types.js +118 -0
- package/dist/esm/metrics/quickpulse/types.js.map +1 -0
- package/dist/esm/metrics/quickpulse/utils.d.ts +43 -0
- package/dist/esm/metrics/quickpulse/utils.d.ts.map +1 -0
- package/dist/esm/metrics/quickpulse/utils.js +535 -0
- package/dist/esm/metrics/quickpulse/utils.js.map +1 -0
- package/dist/esm/metrics/standardMetrics.d.ts +56 -0
- package/dist/esm/metrics/standardMetrics.d.ts.map +1 -0
- package/dist/esm/metrics/standardMetrics.js +134 -0
- package/dist/esm/metrics/standardMetrics.js.map +1 -0
- package/dist/esm/metrics/types.d.ts +48 -0
- package/dist/esm/metrics/types.d.ts.map +1 -0
- package/dist/esm/metrics/types.js +47 -0
- package/dist/esm/metrics/types.js.map +1 -0
- package/dist/esm/metrics/utils.d.ts +35 -0
- package/dist/esm/metrics/utils.d.ts.map +1 -0
- package/dist/esm/metrics/utils.js +251 -0
- package/dist/esm/metrics/utils.js.map +1 -0
- package/dist/esm/otlp/handler.d.ts +100 -0
- package/dist/esm/otlp/handler.d.ts.map +1 -0
- package/dist/esm/otlp/handler.js +138 -0
- package/dist/esm/otlp/handler.js.map +1 -0
- package/dist/esm/otlp/index.d.ts +3 -0
- package/dist/esm/otlp/index.d.ts.map +1 -0
- package/dist/esm/otlp/index.js +4 -0
- package/dist/esm/otlp/index.js.map +1 -0
- package/dist/esm/shared/config.d.ts +57 -0
- package/dist/esm/shared/config.d.ts.map +1 -0
- package/dist/esm/shared/config.js +214 -0
- package/dist/esm/shared/config.js.map +1 -0
- package/dist/esm/shared/envConfig.d.ts +25 -0
- package/dist/esm/shared/envConfig.d.ts.map +1 -0
- package/dist/esm/shared/envConfig.js +125 -0
- package/dist/esm/shared/envConfig.js.map +1 -0
- package/dist/esm/shared/index.d.ts +2 -0
- package/dist/esm/shared/index.d.ts.map +1 -0
- package/dist/esm/shared/index.js +4 -0
- package/dist/esm/shared/index.js.map +1 -0
- package/dist/esm/shared/jsonConfig.d.ts +35 -0
- package/dist/esm/shared/jsonConfig.d.ts.map +1 -0
- package/dist/esm/shared/jsonConfig.js +115 -0
- package/dist/esm/shared/jsonConfig.js.map +1 -0
- package/dist/esm/shared/logging/diagFileConsoleLogger.d.ts +32 -0
- package/dist/esm/shared/logging/diagFileConsoleLogger.d.ts.map +1 -0
- package/dist/esm/shared/logging/diagFileConsoleLogger.js +239 -0
- package/dist/esm/shared/logging/diagFileConsoleLogger.js.map +1 -0
- package/dist/esm/shared/logging/index.d.ts +2 -0
- package/dist/esm/shared/logging/index.d.ts.map +1 -0
- package/dist/esm/shared/logging/index.js +4 -0
- package/dist/esm/shared/logging/index.js.map +1 -0
- package/dist/esm/shared/logging/logger.d.ts +18 -0
- package/dist/esm/shared/logging/logger.d.ts.map +1 -0
- package/dist/esm/shared/logging/logger.js +128 -0
- package/dist/esm/shared/logging/logger.js.map +1 -0
- package/dist/esm/shared/module-cjs.cjs +34 -0
- package/dist/esm/shared/module-cjs.cjs.map +1 -0
- package/dist/esm/shared/module-cjs.d.cts +12 -0
- package/dist/esm/shared/module-cjs.d.cts.map +1 -0
- package/dist/esm/shared/module.d.ts +13 -0
- package/dist/esm/shared/module.d.ts.map +1 -0
- package/dist/esm/shared/module.js +26 -0
- package/dist/esm/shared/module.js.map +1 -0
- package/dist/esm/traces/handler.d.ts +37 -0
- package/dist/esm/traces/handler.d.ts.map +1 -0
- package/dist/esm/traces/handler.js +121 -0
- package/dist/esm/traces/handler.js.map +1 -0
- package/dist/esm/traces/index.d.ts +2 -0
- package/dist/esm/traces/index.d.ts.map +1 -0
- package/dist/esm/traces/index.js +4 -0
- package/dist/esm/traces/index.js.map +1 -0
- package/dist/esm/traces/sampler.d.ts +42 -0
- package/dist/esm/traces/sampler.d.ts.map +1 -0
- package/dist/esm/traces/sampler.js +84 -0
- package/dist/esm/traces/sampler.js.map +1 -0
- package/dist/esm/traces/spanProcessor.d.ts +16 -0
- package/dist/esm/traces/spanProcessor.d.ts.map +1 -0
- package/dist/esm/traces/spanProcessor.js +31 -0
- package/dist/esm/traces/spanProcessor.js.map +1 -0
- package/dist/esm/types.d.ts +259 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +140 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/common.d.ts +37 -0
- package/dist/esm/utils/common.d.ts.map +1 -0
- package/dist/esm/utils/common.js +134 -0
- package/dist/esm/utils/common.js.map +1 -0
- package/dist/esm/utils/connectionStringParser.d.ts +13 -0
- package/dist/esm/utils/connectionStringParser.d.ts.map +1 -0
- package/dist/esm/utils/connectionStringParser.js +78 -0
- package/dist/esm/utils/connectionStringParser.js.map +1 -0
- package/dist/esm/utils/fileSystem.d.ts +27 -0
- package/dist/esm/utils/fileSystem.d.ts.map +1 -0
- package/dist/esm/utils/fileSystem.js +76 -0
- package/dist/esm/utils/fileSystem.js.map +1 -0
- package/dist/esm/utils/index.d.ts +3 -0
- package/dist/esm/utils/index.d.ts.map +1 -0
- package/dist/esm/utils/index.js +5 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/logUtils.d.ts +7 -0
- package/dist/esm/utils/logUtils.d.ts.map +1 -0
- package/dist/esm/utils/logUtils.js +32 -0
- package/dist/esm/utils/logUtils.js.map +1 -0
- package/dist/esm/utils/opentelemetryInstrumentationPatcher.d.ts +6 -0
- package/dist/esm/utils/opentelemetryInstrumentationPatcher.d.ts.map +1 -0
- package/dist/esm/utils/opentelemetryInstrumentationPatcher.js +41 -0
- package/dist/esm/utils/opentelemetryInstrumentationPatcher.js.map +1 -0
- package/dist/esm/utils/statsbeat.d.ts +15 -0
- package/dist/esm/utils/statsbeat.d.ts.map +1 -0
- package/dist/esm/utils/statsbeat.js +124 -0
- package/dist/esm/utils/statsbeat.js.map +1 -0
- package/dist/esm/utils/types.d.ts +14 -0
- package/dist/esm/utils/types.d.ts.map +1 -0
- package/dist/esm/utils/types.js +4 -0
- package/dist/esm/utils/types.js.map +1 -0
- package/package.json +120 -0
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import { MeterProvider, PeriodicExportingMetricReader } from "@opentelemetry/sdk-metrics";
|
|
5
|
+
import { SpanKind, SpanStatusCode, ValueType, context } from "@opentelemetry/api";
|
|
6
|
+
import { RandomIdGenerator } from "@opentelemetry/sdk-trace-base";
|
|
7
|
+
import { getLogDocument, getSdkVersion, getSpanData, getLogData, getSpanDocument, getTransmissionTime, isRequestData, getSpanExceptionColumns, isExceptionData, isDependencyData, } from "./utils.js";
|
|
8
|
+
import { QuickpulseMetricExporter } from "./export/exporter.js";
|
|
9
|
+
import { QuickpulseSender } from "./export/sender.js";
|
|
10
|
+
import { ConnectionStringParser } from "../../utils/connectionStringParser.js";
|
|
11
|
+
import { DEFAULT_LIVEMETRICS_ENDPOINT } from "../../types.js";
|
|
12
|
+
import { QuickPulseOpenTelemetryMetricNames } from "./types.js";
|
|
13
|
+
import { hrTimeToMilliseconds, suppressTracing } from "@opentelemetry/core";
|
|
14
|
+
import { getInstance } from "../../utils/statsbeat.js";
|
|
15
|
+
import { Filter } from "./filtering/filter.js";
|
|
16
|
+
import { Validator } from "./filtering/validator.js";
|
|
17
|
+
import { CollectionConfigurationErrorTracker } from "./filtering/collectionConfigurationErrorTracker.js";
|
|
18
|
+
import { Projection } from "./filtering/projection.js";
|
|
19
|
+
import { TelemetryTypeError, UnexpectedFilterCreateError, DuplicateMetricIdError, MetricFailureToCreateError, } from "./filtering/quickpulseErrors.js";
|
|
20
|
+
import { SEMATTRS_EXCEPTION_TYPE } from "@opentelemetry/semantic-conventions";
|
|
21
|
+
import { getPhysicalMemory, getProcessorTimeNormalized } from "../utils.js";
|
|
22
|
+
import { getCloudRole, getCloudRoleInstance } from "../utils.js";
|
|
23
|
+
import { Logger } from "../../shared/logging/logger.js";
|
|
24
|
+
const POST_INTERVAL = 1000;
|
|
25
|
+
const MAX_POST_WAIT_TIME = 20000;
|
|
26
|
+
const PING_INTERVAL = 5000;
|
|
27
|
+
const MAX_PING_WAIT_TIME = 60000;
|
|
28
|
+
const FALLBACK_INTERVAL = 60000;
|
|
29
|
+
/**
|
|
30
|
+
* Azure Monitor Live Metrics
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export class LiveMetrics {
|
|
34
|
+
config;
|
|
35
|
+
meterProvider;
|
|
36
|
+
metricReader;
|
|
37
|
+
meter;
|
|
38
|
+
requestDurationGauge;
|
|
39
|
+
dependencyDurationGauge;
|
|
40
|
+
requestRateGauge;
|
|
41
|
+
requestFailedRateGauge;
|
|
42
|
+
dependencyRateGauge;
|
|
43
|
+
dependencyFailedRateGauge;
|
|
44
|
+
processPhysicalBytesGauge;
|
|
45
|
+
percentProcessorTimeNormalizedGauge;
|
|
46
|
+
exceptionsRateGauge;
|
|
47
|
+
documents = [];
|
|
48
|
+
pingInterval;
|
|
49
|
+
postInterval;
|
|
50
|
+
quickpulseExporter;
|
|
51
|
+
pingSender;
|
|
52
|
+
isCollectingData;
|
|
53
|
+
lastSuccessTime = Date.now();
|
|
54
|
+
handle;
|
|
55
|
+
// Monitoring data point with common properties
|
|
56
|
+
baseMonitoringDataPoint;
|
|
57
|
+
totalRequestCount = 0;
|
|
58
|
+
totalFailedRequestCount = 0;
|
|
59
|
+
totalDependencyCount = 0;
|
|
60
|
+
totalFailedDependencyCount = 0;
|
|
61
|
+
totalExceptionCount = 0;
|
|
62
|
+
requestDuration = 0;
|
|
63
|
+
dependencyDuration = 0;
|
|
64
|
+
lastRequestDuration = {
|
|
65
|
+
count: 0,
|
|
66
|
+
duration: 0,
|
|
67
|
+
time: 0,
|
|
68
|
+
};
|
|
69
|
+
lastRequestRate = { count: 0, time: 0 };
|
|
70
|
+
lastFailedRequestRate = { count: 0, time: 0 };
|
|
71
|
+
lastDependencyDuration = {
|
|
72
|
+
count: 0,
|
|
73
|
+
duration: 0,
|
|
74
|
+
time: 0,
|
|
75
|
+
};
|
|
76
|
+
lastDependencyRate = { count: 0, time: 0 };
|
|
77
|
+
lastFailedDependencyRate = { count: 0, time: 0 };
|
|
78
|
+
lastExceptionRate = { count: 0, time: 0 };
|
|
79
|
+
lastCpuUsage;
|
|
80
|
+
lastHrTime;
|
|
81
|
+
statsbeatOptionsUpdated = false;
|
|
82
|
+
etag = "";
|
|
83
|
+
errorTracker = new CollectionConfigurationErrorTracker();
|
|
84
|
+
// For tracking of duplicate metric ids in the same configuration.
|
|
85
|
+
seenMetricIds = new Set();
|
|
86
|
+
validDerivedMetrics = new Map();
|
|
87
|
+
derivedMetricProjection = new Projection();
|
|
88
|
+
validator = new Validator();
|
|
89
|
+
filter = new Filter();
|
|
90
|
+
// type: Map<telemetryType, Map<id, FilterConjunctionGroupInfo[]>>
|
|
91
|
+
validDocumentFilterConjuctionGroupInfos = new Map();
|
|
92
|
+
/**
|
|
93
|
+
* Initializes a new instance of the StandardMetrics class.
|
|
94
|
+
* @param config - Distro configuration.
|
|
95
|
+
* @param options - Standard Metrics options.
|
|
96
|
+
*/
|
|
97
|
+
constructor(config) {
|
|
98
|
+
this.config = config;
|
|
99
|
+
const idGenerator = new RandomIdGenerator();
|
|
100
|
+
const streamId = idGenerator.generateTraceId();
|
|
101
|
+
const machineName = os.hostname();
|
|
102
|
+
const instance = getCloudRoleInstance(this.config.resource);
|
|
103
|
+
const roleName = getCloudRole(this.config.resource);
|
|
104
|
+
const version = getSdkVersion();
|
|
105
|
+
this.baseMonitoringDataPoint = {
|
|
106
|
+
version: version,
|
|
107
|
+
invariantVersion: 5, // 5 means we support live metrics filtering of metrics and documents
|
|
108
|
+
instance: instance,
|
|
109
|
+
roleName: roleName,
|
|
110
|
+
machineName: machineName,
|
|
111
|
+
streamId: streamId,
|
|
112
|
+
performanceCollectionSupported: true,
|
|
113
|
+
isWebApp: process.env["WEBSITE_SITE_NAME"] ? true : false,
|
|
114
|
+
};
|
|
115
|
+
const parsedConnectionString = ConnectionStringParser.parse(this.config.azureMonitorExporterOptions.connectionString ||
|
|
116
|
+
process.env["APPLICATIONINSIGHTS_CONNECTION_STRING"]);
|
|
117
|
+
this.pingSender = new QuickpulseSender({
|
|
118
|
+
endpointUrl: parsedConnectionString.liveendpoint || DEFAULT_LIVEMETRICS_ENDPOINT,
|
|
119
|
+
instrumentationKey: parsedConnectionString.instrumentationkey || "",
|
|
120
|
+
credential: this.config.azureMonitorExporterOptions.credential,
|
|
121
|
+
credentialScopes: parsedConnectionString.aadaudience ||
|
|
122
|
+
this.config.azureMonitorExporterOptions.credentialScopes,
|
|
123
|
+
});
|
|
124
|
+
const exporterOptions = {
|
|
125
|
+
endpointUrl: parsedConnectionString.liveendpoint || DEFAULT_LIVEMETRICS_ENDPOINT,
|
|
126
|
+
instrumentationKey: parsedConnectionString.instrumentationkey || "",
|
|
127
|
+
credential: this.config.azureMonitorExporterOptions.credential,
|
|
128
|
+
credentialScopes: parsedConnectionString.aadaudience ||
|
|
129
|
+
this.config.azureMonitorExporterOptions.credentialScopes,
|
|
130
|
+
postCallback: this.quickPulseDone.bind(this),
|
|
131
|
+
getDocumentsFn: this.getDocuments.bind(this),
|
|
132
|
+
getErrorsFn: this.getErrors.bind(this),
|
|
133
|
+
getDerivedMetricValuesFn: this.getDerivedMetricValues.bind(this),
|
|
134
|
+
baseMonitoringDataPoint: this.baseMonitoringDataPoint,
|
|
135
|
+
};
|
|
136
|
+
this.quickpulseExporter = new QuickpulseMetricExporter(exporterOptions);
|
|
137
|
+
this.isCollectingData = false;
|
|
138
|
+
this.pingInterval = PING_INTERVAL; // Default
|
|
139
|
+
this.postInterval = POST_INTERVAL;
|
|
140
|
+
this.handle = setTimeout(this.goQuickpulse.bind(this), this.pingInterval);
|
|
141
|
+
this.handle.unref(); // Don't block apps from terminating
|
|
142
|
+
this.lastCpuUsage = process.cpuUsage();
|
|
143
|
+
this.lastHrTime = process.hrtime.bigint();
|
|
144
|
+
}
|
|
145
|
+
shutdown() {
|
|
146
|
+
this.meterProvider?.shutdown();
|
|
147
|
+
}
|
|
148
|
+
async goQuickpulse() {
|
|
149
|
+
if (!this.isCollectingData) {
|
|
150
|
+
// If not collecting, Ping
|
|
151
|
+
try {
|
|
152
|
+
const params = {
|
|
153
|
+
transmissionTime: getTransmissionTime(),
|
|
154
|
+
monitoringDataPoint: this.baseMonitoringDataPoint,
|
|
155
|
+
configurationEtag: this.etag,
|
|
156
|
+
};
|
|
157
|
+
await context.with(suppressTracing(context.active()), async () => {
|
|
158
|
+
const response = await this.pingSender.isSubscribed(params);
|
|
159
|
+
this.quickPulseDone(response);
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
catch (_error) {
|
|
163
|
+
this.quickPulseDone(undefined);
|
|
164
|
+
}
|
|
165
|
+
this.handle = setTimeout(this.goQuickpulse.bind(this), this.pingInterval);
|
|
166
|
+
this.handle.unref();
|
|
167
|
+
}
|
|
168
|
+
if (this.isCollectingData) {
|
|
169
|
+
this.activateMetrics({ collectionInterval: this.postInterval });
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
async quickPulseDone(response) {
|
|
173
|
+
if (!response) {
|
|
174
|
+
if (!this.isCollectingData) {
|
|
175
|
+
if (Date.now() - this.lastSuccessTime >= MAX_PING_WAIT_TIME) {
|
|
176
|
+
this.pingInterval = FALLBACK_INTERVAL;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
if (Date.now() - this.lastSuccessTime >= MAX_POST_WAIT_TIME) {
|
|
181
|
+
this.postInterval = FALLBACK_INTERVAL;
|
|
182
|
+
this.deactivateMetrics();
|
|
183
|
+
this.activateMetrics({ collectionInterval: this.postInterval });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
this.postInterval = POST_INTERVAL;
|
|
189
|
+
// Update using response if needed
|
|
190
|
+
this.lastSuccessTime = Date.now();
|
|
191
|
+
this.isCollectingData =
|
|
192
|
+
response.xMsQpsSubscribed && response.xMsQpsSubscribed === "true" ? true : false;
|
|
193
|
+
if (response.xMsQpsConfigurationEtag && this.etag !== response.xMsQpsConfigurationEtag) {
|
|
194
|
+
this.updateConfiguration(response);
|
|
195
|
+
}
|
|
196
|
+
// If collecting was stoped
|
|
197
|
+
if (!this.isCollectingData && this.meterProvider) {
|
|
198
|
+
this.etag = "";
|
|
199
|
+
this.deactivateMetrics();
|
|
200
|
+
this.handle = setTimeout(this.goQuickpulse.bind(this), this.pingInterval);
|
|
201
|
+
this.handle.unref();
|
|
202
|
+
}
|
|
203
|
+
const endpointRedirect = response.xMsQpsServiceEndpointRedirectV2;
|
|
204
|
+
if (endpointRedirect) {
|
|
205
|
+
this.pingSender.handlePermanentRedirect(endpointRedirect);
|
|
206
|
+
this.quickpulseExporter.getSender().handlePermanentRedirect(endpointRedirect);
|
|
207
|
+
}
|
|
208
|
+
const pollingInterval = response.xMsQpsServicePollingIntervalHint;
|
|
209
|
+
if (pollingInterval) {
|
|
210
|
+
this.pingInterval = Number(pollingInterval);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
this.pingInterval = PING_INTERVAL;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
// Activate live metrics collection
|
|
218
|
+
activateMetrics(options) {
|
|
219
|
+
if (this.meterProvider) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
// Turn on live metrics active collection for statsbeat
|
|
223
|
+
if (!this.statsbeatOptionsUpdated) {
|
|
224
|
+
getInstance().setStatsbeatFeatures({}, { liveMetrics: true });
|
|
225
|
+
this.statsbeatOptionsUpdated = true;
|
|
226
|
+
}
|
|
227
|
+
this.totalDependencyCount = 0;
|
|
228
|
+
this.totalExceptionCount = 0;
|
|
229
|
+
this.totalFailedDependencyCount = 0;
|
|
230
|
+
this.totalFailedRequestCount = 0;
|
|
231
|
+
this.totalRequestCount = 0;
|
|
232
|
+
this.requestDuration = 0;
|
|
233
|
+
this.dependencyDuration = 0;
|
|
234
|
+
this.lastRequestDuration = { count: 0, duration: 0, time: 0 };
|
|
235
|
+
this.lastRequestRate = { count: 0, time: 0 };
|
|
236
|
+
this.lastFailedRequestRate = { count: 0, time: 0 };
|
|
237
|
+
this.lastDependencyDuration = { count: 0, duration: 0, time: 0 };
|
|
238
|
+
this.lastDependencyRate = { count: 0, time: 0 };
|
|
239
|
+
this.lastFailedDependencyRate = { count: 0, time: 0 };
|
|
240
|
+
this.lastExceptionRate = { count: 0, time: 0 };
|
|
241
|
+
const metricReaderOptions = {
|
|
242
|
+
exporter: this.quickpulseExporter,
|
|
243
|
+
exportIntervalMillis: options?.collectionInterval,
|
|
244
|
+
};
|
|
245
|
+
this.metricReader = new PeriodicExportingMetricReader(metricReaderOptions);
|
|
246
|
+
const meterProviderConfig = {
|
|
247
|
+
resource: this.config.resource,
|
|
248
|
+
readers: [this.metricReader],
|
|
249
|
+
};
|
|
250
|
+
this.meterProvider = new MeterProvider(meterProviderConfig);
|
|
251
|
+
this.meter = this.meterProvider.getMeter("AzureMonitorLiveMetricsMeter");
|
|
252
|
+
this.requestDurationGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.REQUEST_DURATION, {
|
|
253
|
+
valueType: ValueType.DOUBLE,
|
|
254
|
+
});
|
|
255
|
+
this.requestRateGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.REQUEST_RATE, {
|
|
256
|
+
valueType: ValueType.DOUBLE,
|
|
257
|
+
});
|
|
258
|
+
this.requestFailedRateGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.REQUEST_FAILURE_RATE, {
|
|
259
|
+
valueType: ValueType.DOUBLE,
|
|
260
|
+
});
|
|
261
|
+
this.dependencyDurationGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.DEPENDENCY_DURATION, {
|
|
262
|
+
valueType: ValueType.DOUBLE,
|
|
263
|
+
});
|
|
264
|
+
this.dependencyRateGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.DEPENDENCY_RATE, {
|
|
265
|
+
valueType: ValueType.DOUBLE,
|
|
266
|
+
});
|
|
267
|
+
this.dependencyFailedRateGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.DEPENDENCY_FAILURE_RATE, {
|
|
268
|
+
valueType: ValueType.DOUBLE,
|
|
269
|
+
});
|
|
270
|
+
this.processPhysicalBytesGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.PHYSICAL_BYTES, {
|
|
271
|
+
valueType: ValueType.INT,
|
|
272
|
+
});
|
|
273
|
+
this.percentProcessorTimeNormalizedGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.PROCESSOR_TIME_NORMALIZED, {
|
|
274
|
+
valueType: ValueType.DOUBLE,
|
|
275
|
+
});
|
|
276
|
+
this.exceptionsRateGauge = this.meter.createObservableGauge(QuickPulseOpenTelemetryMetricNames.EXCEPTION_RATE, {
|
|
277
|
+
valueType: ValueType.DOUBLE,
|
|
278
|
+
});
|
|
279
|
+
this.requestDurationGauge.addCallback(this.getRequestDuration.bind(this));
|
|
280
|
+
this.requestRateGauge.addCallback(this.getRequestRate.bind(this));
|
|
281
|
+
this.requestFailedRateGauge.addCallback(this.getRequestFailedRate.bind(this));
|
|
282
|
+
this.dependencyDurationGauge.addCallback(this.getDependencyDuration.bind(this));
|
|
283
|
+
this.dependencyRateGauge.addCallback(this.getDependencyRate.bind(this));
|
|
284
|
+
this.dependencyFailedRateGauge.addCallback(this.getDependencyFailedRate.bind(this));
|
|
285
|
+
this.exceptionsRateGauge.addCallback(this.getExceptionRate.bind(this));
|
|
286
|
+
this.processPhysicalBytesGauge.addCallback(this.getPhysicalMemory.bind(this));
|
|
287
|
+
this.percentProcessorTimeNormalizedGauge.addCallback(this.getProcessorTimeNormalized.bind(this));
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Deactivate metric collection
|
|
291
|
+
*/
|
|
292
|
+
deactivateMetrics() {
|
|
293
|
+
this.documents = [];
|
|
294
|
+
this.validDocumentFilterConjuctionGroupInfos.clear();
|
|
295
|
+
this.errorTracker.clearRunTimeErrors();
|
|
296
|
+
this.errorTracker.clearValidationTimeErrors();
|
|
297
|
+
this.validDerivedMetrics.clear();
|
|
298
|
+
this.derivedMetricProjection.clearProjectionMaps();
|
|
299
|
+
this.seenMetricIds.clear();
|
|
300
|
+
this.meterProvider?.shutdown();
|
|
301
|
+
this.meterProvider = undefined;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Force flush Meter Provider.
|
|
305
|
+
*/
|
|
306
|
+
async flush() {
|
|
307
|
+
await this.meterProvider?.forceFlush();
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
*Get OpenTelemetry MeterProvider
|
|
311
|
+
*/
|
|
312
|
+
getMeterProvider() {
|
|
313
|
+
return this.meterProvider;
|
|
314
|
+
}
|
|
315
|
+
getDocuments() {
|
|
316
|
+
const result = this.documents;
|
|
317
|
+
this.documents = [];
|
|
318
|
+
return result;
|
|
319
|
+
}
|
|
320
|
+
getErrors() {
|
|
321
|
+
const result = this.errorTracker.getErrors();
|
|
322
|
+
this.errorTracker.clearRunTimeErrors();
|
|
323
|
+
return result;
|
|
324
|
+
}
|
|
325
|
+
getDerivedMetricValues() {
|
|
326
|
+
return this.derivedMetricProjection.getMetricValues();
|
|
327
|
+
}
|
|
328
|
+
addDocument(document) {
|
|
329
|
+
if (document) {
|
|
330
|
+
// Limit risk of memory leak by limiting doc length to something manageable
|
|
331
|
+
if (this.documents.length > 20) {
|
|
332
|
+
this.documents.shift(); // Remove oldest document
|
|
333
|
+
}
|
|
334
|
+
this.documents.push(document);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Record Span metrics
|
|
339
|
+
* @internal
|
|
340
|
+
*/
|
|
341
|
+
recordSpan(span) {
|
|
342
|
+
if (this.isCollectingData) {
|
|
343
|
+
const columns = getSpanData(span);
|
|
344
|
+
let documentConfiguration;
|
|
345
|
+
let derivedMetricInfos;
|
|
346
|
+
if (isRequestData(columns)) {
|
|
347
|
+
documentConfiguration =
|
|
348
|
+
this.validDocumentFilterConjuctionGroupInfos.get("Request") ||
|
|
349
|
+
new Map();
|
|
350
|
+
derivedMetricInfos = this.validDerivedMetrics.get("Request") || [];
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
documentConfiguration =
|
|
354
|
+
this.validDocumentFilterConjuctionGroupInfos.get("Dependency") ||
|
|
355
|
+
new Map();
|
|
356
|
+
derivedMetricInfos = this.validDerivedMetrics.get("Dependency") || [];
|
|
357
|
+
}
|
|
358
|
+
this.applyDocumentFilters(documentConfiguration, columns);
|
|
359
|
+
this.checkMetricFilterAndCreateProjection(derivedMetricInfos, columns);
|
|
360
|
+
const durationMs = hrTimeToMilliseconds(span.duration);
|
|
361
|
+
const success = span.status.code !== SpanStatusCode.ERROR;
|
|
362
|
+
if (span.kind === SpanKind.SERVER || span.kind === SpanKind.CONSUMER) {
|
|
363
|
+
this.totalRequestCount++;
|
|
364
|
+
this.requestDuration += durationMs;
|
|
365
|
+
if (!success) {
|
|
366
|
+
this.totalFailedRequestCount++;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
else {
|
|
370
|
+
this.totalDependencyCount++;
|
|
371
|
+
this.dependencyDuration += durationMs;
|
|
372
|
+
if (!success) {
|
|
373
|
+
this.totalFailedDependencyCount++;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (span.events) {
|
|
377
|
+
span.events.forEach((event) => {
|
|
378
|
+
event.attributes = event.attributes || {};
|
|
379
|
+
if (event.name === "exception") {
|
|
380
|
+
const exceptionColumns = getSpanExceptionColumns(event.attributes, span.attributes);
|
|
381
|
+
documentConfiguration =
|
|
382
|
+
this.validDocumentFilterConjuctionGroupInfos.get("Exception") ||
|
|
383
|
+
new Map();
|
|
384
|
+
this.applyDocumentFilters(documentConfiguration, exceptionColumns, event.attributes[SEMATTRS_EXCEPTION_TYPE]);
|
|
385
|
+
derivedMetricInfos = this.validDerivedMetrics.get("Exception") || [];
|
|
386
|
+
this.checkMetricFilterAndCreateProjection(derivedMetricInfos, exceptionColumns);
|
|
387
|
+
this.totalExceptionCount++;
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Record LogRecord metrics, add attribute so data is not aggregated again in ingestion
|
|
395
|
+
* @internal
|
|
396
|
+
*/
|
|
397
|
+
recordLog(logRecord) {
|
|
398
|
+
if (this.isCollectingData) {
|
|
399
|
+
const columns = getLogData(logRecord);
|
|
400
|
+
let derivedMetricInfos;
|
|
401
|
+
let documentConfiguration;
|
|
402
|
+
if (isExceptionData(columns)) {
|
|
403
|
+
documentConfiguration =
|
|
404
|
+
this.validDocumentFilterConjuctionGroupInfos.get("Exception") ||
|
|
405
|
+
new Map();
|
|
406
|
+
this.applyDocumentFilters(documentConfiguration, columns, logRecord.attributes[SEMATTRS_EXCEPTION_TYPE]);
|
|
407
|
+
derivedMetricInfos = this.validDerivedMetrics.get("Exception") || [];
|
|
408
|
+
this.totalExceptionCount++;
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
// trace
|
|
412
|
+
documentConfiguration =
|
|
413
|
+
this.validDocumentFilterConjuctionGroupInfos.get("Trace") ||
|
|
414
|
+
new Map();
|
|
415
|
+
this.applyDocumentFilters(documentConfiguration, columns);
|
|
416
|
+
derivedMetricInfos = this.validDerivedMetrics.get("Trace") || [];
|
|
417
|
+
}
|
|
418
|
+
this.checkMetricFilterAndCreateProjection(derivedMetricInfos, columns);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
getRequestDuration(observableResult) {
|
|
422
|
+
const currentTime = +new Date();
|
|
423
|
+
const requestInterval = this.totalRequestCount - this.lastRequestDuration.count || 0;
|
|
424
|
+
const durationInterval = this.requestDuration - this.lastRequestDuration.duration || 0;
|
|
425
|
+
const elapsedMs = currentTime - this.lastRequestDuration.time;
|
|
426
|
+
if (elapsedMs > 0) {
|
|
427
|
+
const averageExecutionTime = durationInterval / requestInterval || 0; // default to 0 in case no requests in this interval
|
|
428
|
+
observableResult.observe(averageExecutionTime);
|
|
429
|
+
}
|
|
430
|
+
this.lastRequestDuration = {
|
|
431
|
+
count: this.totalRequestCount,
|
|
432
|
+
duration: this.requestDuration,
|
|
433
|
+
time: currentTime,
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
getRequestRate(observableResult) {
|
|
437
|
+
const currentTime = +new Date();
|
|
438
|
+
const intervalRequests = this.totalRequestCount - this.lastRequestRate.count || 0;
|
|
439
|
+
const elapsedMs = currentTime - this.lastRequestRate.time;
|
|
440
|
+
if (elapsedMs > 0) {
|
|
441
|
+
const elapsedSeconds = elapsedMs / 1000;
|
|
442
|
+
const dataPerSec = intervalRequests / elapsedSeconds;
|
|
443
|
+
observableResult.observe(dataPerSec);
|
|
444
|
+
}
|
|
445
|
+
this.lastRequestRate = {
|
|
446
|
+
count: this.totalRequestCount,
|
|
447
|
+
time: currentTime,
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
getRequestFailedRate(observableResult) {
|
|
451
|
+
const currentTime = +new Date();
|
|
452
|
+
const intervalRequests = this.totalFailedRequestCount - this.lastFailedRequestRate.count || 0;
|
|
453
|
+
const elapsedMs = currentTime - this.lastFailedRequestRate.time;
|
|
454
|
+
if (elapsedMs > 0) {
|
|
455
|
+
const elapsedSeconds = elapsedMs / 1000;
|
|
456
|
+
const dataPerSec = intervalRequests / elapsedSeconds;
|
|
457
|
+
observableResult.observe(dataPerSec);
|
|
458
|
+
}
|
|
459
|
+
this.lastFailedRequestRate = {
|
|
460
|
+
count: this.totalFailedRequestCount,
|
|
461
|
+
time: currentTime,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
getDependencyDuration(observableResult) {
|
|
465
|
+
const currentTime = +new Date();
|
|
466
|
+
const dependencyInterval = this.totalDependencyCount - this.lastDependencyDuration.count || 0;
|
|
467
|
+
const durationInterval = this.dependencyDuration - this.lastDependencyDuration.duration || 0;
|
|
468
|
+
const elapsedMs = currentTime - this.lastDependencyDuration.time;
|
|
469
|
+
if (elapsedMs > 0) {
|
|
470
|
+
const averageExecutionTime = durationInterval / dependencyInterval || 0; // default to 0 in case no dependencies in this interval
|
|
471
|
+
observableResult.observe(averageExecutionTime);
|
|
472
|
+
}
|
|
473
|
+
this.lastDependencyDuration = {
|
|
474
|
+
count: this.totalDependencyCount,
|
|
475
|
+
duration: this.dependencyDuration,
|
|
476
|
+
time: currentTime,
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
getDependencyRate(observableResult) {
|
|
480
|
+
const currentTime = +new Date();
|
|
481
|
+
const intervalData = this.totalDependencyCount - this.lastDependencyRate.count || 0;
|
|
482
|
+
const elapsedMs = currentTime - this.lastDependencyRate.time;
|
|
483
|
+
if (elapsedMs > 0) {
|
|
484
|
+
const elapsedSeconds = elapsedMs / 1000;
|
|
485
|
+
const dataPerSec = intervalData / elapsedSeconds;
|
|
486
|
+
observableResult.observe(dataPerSec);
|
|
487
|
+
}
|
|
488
|
+
this.lastDependencyRate = {
|
|
489
|
+
count: this.totalDependencyCount,
|
|
490
|
+
time: currentTime,
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
getDependencyFailedRate(observableResult) {
|
|
494
|
+
const currentTime = +new Date();
|
|
495
|
+
const intervalData = this.totalFailedDependencyCount - this.lastFailedDependencyRate.count || 0;
|
|
496
|
+
const elapsedMs = currentTime - this.lastFailedDependencyRate.time;
|
|
497
|
+
if (elapsedMs > 0) {
|
|
498
|
+
const elapsedSeconds = elapsedMs / 1000;
|
|
499
|
+
const dataPerSec = intervalData / elapsedSeconds;
|
|
500
|
+
observableResult.observe(dataPerSec);
|
|
501
|
+
}
|
|
502
|
+
this.lastFailedDependencyRate = {
|
|
503
|
+
count: this.totalFailedDependencyCount,
|
|
504
|
+
time: currentTime,
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
getExceptionRate(observableResult) {
|
|
508
|
+
const currentTime = +new Date();
|
|
509
|
+
const intervalData = this.totalExceptionCount - this.lastExceptionRate.count || 0;
|
|
510
|
+
const elapsedMs = currentTime - this.lastExceptionRate.time;
|
|
511
|
+
if (elapsedMs > 0) {
|
|
512
|
+
const elapsedSeconds = elapsedMs / 1000;
|
|
513
|
+
const dataPerSec = intervalData / elapsedSeconds;
|
|
514
|
+
observableResult.observe(dataPerSec);
|
|
515
|
+
}
|
|
516
|
+
this.lastExceptionRate = {
|
|
517
|
+
count: this.totalExceptionCount,
|
|
518
|
+
time: currentTime,
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
getPhysicalMemory(observableResult) {
|
|
522
|
+
const rss = getPhysicalMemory();
|
|
523
|
+
observableResult.observe(rss);
|
|
524
|
+
}
|
|
525
|
+
getProcessorTimeNormalized(observableResult) {
|
|
526
|
+
if (process && process.hrtime) {
|
|
527
|
+
const cpuUsagePercent = getProcessorTimeNormalized(this.lastHrTime, this.lastCpuUsage);
|
|
528
|
+
observableResult.observe(cpuUsagePercent);
|
|
529
|
+
this.lastHrTime = process.hrtime.bigint();
|
|
530
|
+
this.lastCpuUsage = process.cpuUsage();
|
|
531
|
+
}
|
|
532
|
+
else {
|
|
533
|
+
Logger.getInstance().debug("Getting Normalized Processor Time Failed. No process available.");
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
updateConfiguration(response) {
|
|
537
|
+
this.etag = response.xMsQpsConfigurationEtag || "";
|
|
538
|
+
this.quickpulseExporter.setEtag(this.etag);
|
|
539
|
+
this.errorTracker.clearValidationTimeErrors();
|
|
540
|
+
this.validDocumentFilterConjuctionGroupInfos.clear();
|
|
541
|
+
this.validDerivedMetrics.clear();
|
|
542
|
+
this.derivedMetricProjection.clearProjectionMaps();
|
|
543
|
+
this.seenMetricIds.clear();
|
|
544
|
+
this.parseDocumentFilterConfiguration(response);
|
|
545
|
+
this.parseMetricFilterConfiguration(response);
|
|
546
|
+
}
|
|
547
|
+
parseDocumentFilterConfiguration(response) {
|
|
548
|
+
if (!response?.documentStreams || typeof response.documentStreams.forEach !== "function") {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
response.documentStreams.forEach((documentStreamInfo) => {
|
|
552
|
+
documentStreamInfo.documentFilterGroups.forEach((documentFilterGroupInfo) => {
|
|
553
|
+
try {
|
|
554
|
+
this.validator.validateTelemetryType(documentFilterGroupInfo.telemetryType);
|
|
555
|
+
this.validator.validateDocumentFilters(documentFilterGroupInfo);
|
|
556
|
+
this.filter.renameExceptionFieldNamesForFiltering(documentFilterGroupInfo.filters);
|
|
557
|
+
if (!this.validDocumentFilterConjuctionGroupInfos.has(documentFilterGroupInfo.telemetryType)) {
|
|
558
|
+
this.validDocumentFilterConjuctionGroupInfos.set(documentFilterGroupInfo.telemetryType, new Map());
|
|
559
|
+
}
|
|
560
|
+
const innerMap = this.validDocumentFilterConjuctionGroupInfos.get(documentFilterGroupInfo.telemetryType);
|
|
561
|
+
if (!innerMap?.has(documentStreamInfo.id)) {
|
|
562
|
+
innerMap?.set(documentStreamInfo.id, [documentFilterGroupInfo.filters]);
|
|
563
|
+
}
|
|
564
|
+
else {
|
|
565
|
+
innerMap.get(documentStreamInfo.id)?.push(documentFilterGroupInfo.filters);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
catch (error) {
|
|
569
|
+
const configError = {
|
|
570
|
+
collectionConfigurationErrorType: "Unknown",
|
|
571
|
+
message: "",
|
|
572
|
+
fullException: "",
|
|
573
|
+
data: [],
|
|
574
|
+
};
|
|
575
|
+
if (error instanceof TelemetryTypeError) {
|
|
576
|
+
configError.collectionConfigurationErrorType =
|
|
577
|
+
"CollectionConfigurationFailureToCreateUnexpected";
|
|
578
|
+
}
|
|
579
|
+
else if (error instanceof UnexpectedFilterCreateError) {
|
|
580
|
+
configError.collectionConfigurationErrorType =
|
|
581
|
+
"DocumentStreamFailureToCreateFilterUnexpected";
|
|
582
|
+
}
|
|
583
|
+
if (error instanceof Error) {
|
|
584
|
+
configError.message = error.message;
|
|
585
|
+
configError.fullException = error.stack || "";
|
|
586
|
+
}
|
|
587
|
+
const data = [];
|
|
588
|
+
data.push({ key: "DocumentStreamInfoId", value: documentStreamInfo.id });
|
|
589
|
+
data.push({ key: "ETag", value: this.etag });
|
|
590
|
+
configError.data = data;
|
|
591
|
+
this.errorTracker.addValidationError(configError);
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
applyDocumentFilters(documentConfiguration, data, exceptionType) {
|
|
597
|
+
const streamIds = new Set();
|
|
598
|
+
documentConfiguration.forEach((filterConjunctionGroupInfoList, streamId) => {
|
|
599
|
+
filterConjunctionGroupInfoList.forEach((filterConjunctionGroupInfo) => {
|
|
600
|
+
// by going though each filterConjuctionGroupInfo, we are implicitly -OR-ing
|
|
601
|
+
// different filterConjunctionGroupInfo within documentStreamInfo. If there are multiple
|
|
602
|
+
// documentStreamInfos, this logic will -OR- the filtering results of each documentStreamInfo.
|
|
603
|
+
if (this.filter.checkFilterConjunctionGroup(filterConjunctionGroupInfo, data)) {
|
|
604
|
+
streamIds.add(streamId);
|
|
605
|
+
}
|
|
606
|
+
});
|
|
607
|
+
});
|
|
608
|
+
// Emit a document when a telemetry data matches a particular filtering configuration,
|
|
609
|
+
// or when filtering configuration is empty.
|
|
610
|
+
if (streamIds.size > 0 || documentConfiguration.size === 0) {
|
|
611
|
+
let document;
|
|
612
|
+
if (isRequestData(data) || isDependencyData(data)) {
|
|
613
|
+
document = getSpanDocument(data);
|
|
614
|
+
}
|
|
615
|
+
else if (isExceptionData(data) && exceptionType) {
|
|
616
|
+
document = getLogDocument(data, exceptionType);
|
|
617
|
+
}
|
|
618
|
+
else {
|
|
619
|
+
document = getLogDocument(data);
|
|
620
|
+
}
|
|
621
|
+
document.documentStreamIds = [...streamIds];
|
|
622
|
+
this.addDocument(document);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
parseMetricFilterConfiguration(response) {
|
|
626
|
+
if (!response?.documentStreams || typeof response.documentStreams.forEach !== "function") {
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
response.metrics.forEach((derivedMetricInfo) => {
|
|
630
|
+
try {
|
|
631
|
+
if (!this.seenMetricIds.has(derivedMetricInfo.id)) {
|
|
632
|
+
this.seenMetricIds.add(derivedMetricInfo.id);
|
|
633
|
+
this.validator.validateTelemetryType(derivedMetricInfo.telemetryType);
|
|
634
|
+
this.validator.checkCustomMetricProjection(derivedMetricInfo);
|
|
635
|
+
this.validator.validateMetricFilters(derivedMetricInfo);
|
|
636
|
+
derivedMetricInfo.filterGroups.forEach((filterConjunctionGroupInfo) => {
|
|
637
|
+
this.filter.renameExceptionFieldNamesForFiltering(filterConjunctionGroupInfo);
|
|
638
|
+
});
|
|
639
|
+
if (this.validDerivedMetrics.has(derivedMetricInfo.telemetryType)) {
|
|
640
|
+
this.validDerivedMetrics.get(derivedMetricInfo.telemetryType)?.push(derivedMetricInfo);
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
this.validDerivedMetrics.set(derivedMetricInfo.telemetryType, [derivedMetricInfo]);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
else {
|
|
647
|
+
throw new DuplicateMetricIdError(`Duplicate Metric Id: ${derivedMetricInfo.id}`);
|
|
648
|
+
}
|
|
649
|
+
this.derivedMetricProjection.initDerivedMetricProjection(derivedMetricInfo);
|
|
650
|
+
}
|
|
651
|
+
catch (error) {
|
|
652
|
+
const configError = {
|
|
653
|
+
collectionConfigurationErrorType: "Unknown",
|
|
654
|
+
message: "",
|
|
655
|
+
fullException: "",
|
|
656
|
+
data: [],
|
|
657
|
+
};
|
|
658
|
+
if (error instanceof TelemetryTypeError) {
|
|
659
|
+
configError.collectionConfigurationErrorType = "MetricTelemetryTypeUnsupported";
|
|
660
|
+
}
|
|
661
|
+
else if (error instanceof UnexpectedFilterCreateError) {
|
|
662
|
+
configError.collectionConfigurationErrorType = "MetricFailureToCreateFilterUnexpected";
|
|
663
|
+
}
|
|
664
|
+
else if (error instanceof DuplicateMetricIdError) {
|
|
665
|
+
configError.collectionConfigurationErrorType = "MetricDuplicateIds";
|
|
666
|
+
}
|
|
667
|
+
if (error instanceof Error) {
|
|
668
|
+
configError.message = error.message;
|
|
669
|
+
configError.fullException = error.stack || "";
|
|
670
|
+
}
|
|
671
|
+
const data = [];
|
|
672
|
+
data.push({ key: "MetricId", value: derivedMetricInfo.id });
|
|
673
|
+
data.push({ key: "ETag", value: this.etag });
|
|
674
|
+
configError.data = data;
|
|
675
|
+
this.errorTracker.addValidationError(configError);
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
checkMetricFilterAndCreateProjection(derivedMetricInfoList, data) {
|
|
680
|
+
derivedMetricInfoList.forEach((derivedMetricInfo) => {
|
|
681
|
+
if (this.filter.checkMetricFilters(derivedMetricInfo, data)) {
|
|
682
|
+
try {
|
|
683
|
+
this.derivedMetricProjection.calculateProjection(derivedMetricInfo, data);
|
|
684
|
+
}
|
|
685
|
+
catch (error) {
|
|
686
|
+
const configError = {
|
|
687
|
+
collectionConfigurationErrorType: "Unknown",
|
|
688
|
+
message: "",
|
|
689
|
+
fullException: "",
|
|
690
|
+
data: [],
|
|
691
|
+
};
|
|
692
|
+
if (error instanceof MetricFailureToCreateError) {
|
|
693
|
+
configError.collectionConfigurationErrorType = "MetricFailureToCreate";
|
|
694
|
+
if (error instanceof Error) {
|
|
695
|
+
configError.message = error.message;
|
|
696
|
+
configError.fullException = error.stack || "";
|
|
697
|
+
}
|
|
698
|
+
const errorData = [];
|
|
699
|
+
errorData.push({ key: "MetricId", value: derivedMetricInfo.id });
|
|
700
|
+
errorData.push({ key: "ETag", value: this.etag });
|
|
701
|
+
configError.data = errorData;
|
|
702
|
+
this.errorTracker.addRunTimeError(configError);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
//# sourceMappingURL=liveMetrics.js.map
|