@azure/monitor-opentelemetry-exporter 1.0.0-beta.3 → 1.0.0-beta.31
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/README.md +119 -44
- package/dist/commonjs/Declarations/Constants.d.ts +149 -0
- package/dist/commonjs/Declarations/Constants.d.ts.map +1 -0
- package/dist/commonjs/Declarations/Constants.js +167 -0
- package/dist/commonjs/Declarations/Constants.js.map +1 -0
- package/dist/commonjs/Declarations/Contracts/Constants.d.ts +14 -0
- package/dist/commonjs/Declarations/Contracts/Constants.d.ts.map +1 -0
- package/dist/commonjs/Declarations/Contracts/Constants.js +5 -0
- package/dist/commonjs/Declarations/Contracts/Constants.js.map +1 -0
- package/dist/commonjs/Declarations/Contracts/index.d.ts +2 -0
- package/dist/commonjs/Declarations/Contracts/index.d.ts.map +1 -0
- package/dist/commonjs/Declarations/Contracts/index.js +7 -0
- package/dist/commonjs/Declarations/Contracts/index.js.map +1 -0
- package/dist/commonjs/config.d.ts +30 -0
- package/dist/commonjs/config.d.ts.map +1 -0
- package/dist/commonjs/config.js +3 -0
- package/dist/commonjs/config.js.map +1 -0
- package/dist/commonjs/export/base.d.ts +36 -0
- package/dist/commonjs/export/base.d.ts.map +1 -0
- package/dist/commonjs/export/base.js +59 -0
- package/dist/commonjs/export/base.js.map +1 -0
- package/dist/commonjs/export/log.d.ts +30 -0
- package/dist/commonjs/export/log.d.ts.map +1 -0
- package/dist/commonjs/export/log.js +68 -0
- package/dist/commonjs/export/log.js.map +1 -0
- package/dist/commonjs/export/metric.d.ts +39 -0
- package/dist/commonjs/export/metric.d.ts.map +1 -0
- package/dist/commonjs/export/metric.js +79 -0
- package/dist/commonjs/export/metric.js.map +1 -0
- package/dist/commonjs/export/statsbeat/longIntervalStatsbeatMetrics.d.ts +39 -0
- package/dist/commonjs/export/statsbeat/longIntervalStatsbeatMetrics.d.ts.map +1 -0
- package/dist/commonjs/export/statsbeat/longIntervalStatsbeatMetrics.js +127 -0
- package/dist/commonjs/export/statsbeat/longIntervalStatsbeatMetrics.js.map +1 -0
- package/dist/commonjs/export/statsbeat/networkStatsbeatMetrics.d.ts +51 -0
- package/dist/commonjs/export/statsbeat/networkStatsbeatMetrics.d.ts.map +1 -0
- package/dist/commonjs/export/statsbeat/networkStatsbeatMetrics.js +289 -0
- package/dist/commonjs/export/statsbeat/networkStatsbeatMetrics.js.map +1 -0
- package/dist/commonjs/export/statsbeat/statsbeatExporter.d.ts +32 -0
- package/dist/commonjs/export/statsbeat/statsbeatExporter.d.ts.map +1 -0
- package/dist/commonjs/export/statsbeat/statsbeatExporter.js +62 -0
- package/dist/commonjs/export/statsbeat/statsbeatExporter.js.map +1 -0
- package/dist/commonjs/export/statsbeat/statsbeatMetrics.d.ts +11 -0
- package/dist/commonjs/export/statsbeat/statsbeatMetrics.d.ts.map +1 -0
- package/dist/commonjs/export/statsbeat/statsbeatMetrics.js +106 -0
- package/dist/commonjs/export/statsbeat/statsbeatMetrics.js.map +1 -0
- package/dist/commonjs/export/statsbeat/types.d.ts +102 -0
- package/dist/commonjs/export/statsbeat/types.d.ts.map +1 -0
- package/dist/commonjs/export/statsbeat/types.js +89 -0
- package/dist/commonjs/export/statsbeat/types.js.map +1 -0
- package/dist/commonjs/export/trace.d.ts +31 -0
- package/dist/commonjs/export/trace.d.ts.map +1 -0
- package/dist/commonjs/export/trace.js +76 -0
- package/dist/commonjs/export/trace.js.map +1 -0
- package/dist/commonjs/generated/applicationInsightsClient.d.ts +17 -0
- package/dist/commonjs/generated/applicationInsightsClient.d.ts.map +1 -0
- package/dist/commonjs/generated/applicationInsightsClient.js +89 -0
- package/dist/commonjs/generated/applicationInsightsClient.js.map +1 -0
- package/dist/commonjs/generated/index.d.ts +3 -0
- package/dist/commonjs/generated/index.d.ts.map +1 -0
- package/dist/commonjs/generated/index.js +15 -0
- package/dist/commonjs/generated/index.js.map +1 -0
- package/dist/commonjs/generated/models/index.d.ts +429 -0
- package/dist/commonjs/generated/models/index.d.ts.map +1 -0
- package/dist/commonjs/generated/models/index.js +93 -0
- package/dist/commonjs/generated/models/index.js.map +1 -0
- package/dist/commonjs/generated/models/mappers.d.ts +19 -0
- package/dist/commonjs/generated/models/mappers.d.ts.map +1 -0
- package/dist/commonjs/generated/models/mappers.js +848 -0
- package/dist/commonjs/generated/models/mappers.js.map +1 -0
- package/dist/commonjs/generated/models/parameters.d.ts +6 -0
- package/dist/commonjs/generated/models/parameters.d.ts.map +1 -0
- package/dist/commonjs/generated/models/parameters.js +60 -0
- package/dist/commonjs/generated/models/parameters.js.map +1 -0
- package/dist/commonjs/index.d.ts +10 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +20 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/platform/index.d.ts +2 -0
- package/dist/commonjs/platform/index.d.ts.map +1 -0
- package/dist/commonjs/platform/index.js +10 -0
- package/dist/commonjs/platform/index.js.map +1 -0
- package/dist/commonjs/platform/nodejs/baseSender.d.ts +49 -0
- package/dist/commonjs/platform/nodejs/baseSender.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/baseSender.js +244 -0
- package/dist/commonjs/platform/nodejs/baseSender.js.map +1 -0
- package/dist/commonjs/platform/nodejs/constants.d.ts +10 -0
- package/dist/commonjs/platform/nodejs/constants.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/constants.js +15 -0
- package/dist/commonjs/platform/nodejs/constants.js.map +1 -0
- package/dist/commonjs/platform/nodejs/context/context.d.ts +21 -0
- package/dist/commonjs/platform/nodejs/context/context.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/context/context.js +66 -0
- package/dist/commonjs/platform/nodejs/context/context.js.map +1 -0
- package/dist/commonjs/platform/nodejs/context/index.d.ts +2 -0
- package/dist/commonjs/platform/nodejs/context/index.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/context/index.js +7 -0
- package/dist/commonjs/platform/nodejs/context/index.js.map +1 -0
- package/dist/commonjs/platform/nodejs/httpSender.d.ts +32 -0
- package/dist/commonjs/platform/nodejs/httpSender.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/httpSender.js +70 -0
- package/dist/commonjs/platform/nodejs/httpSender.js.map +1 -0
- package/dist/commonjs/platform/nodejs/index.d.ts +8 -0
- package/dist/commonjs/platform/nodejs/index.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/index.js +13 -0
- package/dist/commonjs/platform/nodejs/index.js.map +1 -0
- package/dist/commonjs/platform/nodejs/persist/fileAccessControl.d.ts +18 -0
- package/dist/commonjs/platform/nodejs/persist/fileAccessControl.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/persist/fileAccessControl.js +177 -0
- package/dist/commonjs/platform/nodejs/persist/fileAccessControl.js.map +1 -0
- package/dist/commonjs/platform/nodejs/persist/fileSystemHelpers.d.ts +11 -0
- package/dist/commonjs/platform/nodejs/persist/fileSystemHelpers.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/persist/fileSystemHelpers.js +60 -0
- package/dist/commonjs/platform/nodejs/persist/fileSystemHelpers.js.map +1 -0
- package/dist/commonjs/platform/nodejs/persist/fileSystemPersist.d.ts +29 -0
- package/dist/commonjs/platform/nodejs/persist/fileSystemPersist.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/persist/fileSystemPersist.js +184 -0
- package/dist/commonjs/platform/nodejs/persist/fileSystemPersist.js.map +1 -0
- package/dist/commonjs/platform/nodejs/persist/index.d.ts +2 -0
- package/dist/commonjs/platform/nodejs/persist/index.d.ts.map +1 -0
- package/dist/commonjs/platform/nodejs/persist/index.js +7 -0
- package/dist/commonjs/platform/nodejs/persist/index.js.map +1 -0
- package/dist/commonjs/sampling.d.ts +38 -0
- package/dist/commonjs/sampling.d.ts.map +1 -0
- package/dist/commonjs/sampling.js +92 -0
- package/dist/commonjs/sampling.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/commonjs/types.d.ts +112 -0
- package/dist/commonjs/types.d.ts.map +1 -0
- package/dist/commonjs/types.js +124 -0
- package/dist/commonjs/types.js.map +1 -0
- package/dist/commonjs/utils/breezeUtils.d.ts +25 -0
- package/dist/commonjs/utils/breezeUtils.d.ts.map +1 -0
- package/dist/commonjs/utils/breezeUtils.js +39 -0
- package/dist/commonjs/utils/breezeUtils.js.map +1 -0
- package/dist/commonjs/utils/common.d.ts +15 -0
- package/dist/commonjs/utils/common.d.ts.map +1 -0
- package/dist/commonjs/utils/common.js +256 -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 +83 -0
- package/dist/commonjs/utils/connectionStringParser.js.map +1 -0
- package/dist/commonjs/utils/constants/applicationinsights.d.ts +42 -0
- package/dist/commonjs/utils/constants/applicationinsights.d.ts.map +1 -0
- package/dist/commonjs/utils/constants/applicationinsights.js +48 -0
- package/dist/commonjs/utils/constants/applicationinsights.js.map +1 -0
- package/dist/commonjs/utils/constants/span/azAttributes.d.ts +16 -0
- package/dist/commonjs/utils/constants/span/azAttributes.d.ts.map +1 -0
- package/dist/commonjs/utils/constants/span/azAttributes.js +21 -0
- package/dist/commonjs/utils/constants/span/azAttributes.js.map +1 -0
- package/dist/commonjs/utils/eventhub.d.ts +10 -0
- package/dist/commonjs/utils/eventhub.d.ts.map +1 -0
- package/dist/commonjs/utils/eventhub.js +57 -0
- package/dist/commonjs/utils/eventhub.js.map +1 -0
- package/dist/commonjs/utils/logUtils.d.ts +8 -0
- package/dist/commonjs/utils/logUtils.d.ts.map +1 -0
- package/dist/commonjs/utils/logUtils.js +222 -0
- package/dist/commonjs/utils/logUtils.js.map +1 -0
- package/dist/commonjs/utils/metricUtils.d.ts +13 -0
- package/dist/commonjs/utils/metricUtils.d.ts.map +1 -0
- package/dist/commonjs/utils/metricUtils.js +140 -0
- package/dist/commonjs/utils/metricUtils.js.map +1 -0
- package/dist/commonjs/utils/spanUtils.d.ts +27 -0
- package/dist/commonjs/utils/spanUtils.d.ts.map +1 -0
- package/dist/commonjs/utils/spanUtils.js +521 -0
- package/dist/commonjs/utils/spanUtils.js.map +1 -0
- package/dist/esm/Declarations/Constants.d.ts +149 -0
- package/dist/esm/Declarations/Constants.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/Declarations/Constants.js +110 -21
- package/dist/esm/Declarations/Constants.js.map +1 -0
- package/dist/esm/Declarations/Contracts/Constants.d.ts +14 -0
- package/dist/esm/Declarations/Contracts/Constants.d.ts.map +1 -0
- package/dist/esm/Declarations/Contracts/Constants.js +4 -0
- package/dist/esm/Declarations/Contracts/Constants.js.map +1 -0
- package/dist/esm/Declarations/Contracts/index.d.ts +2 -0
- package/dist/esm/Declarations/Contracts/index.d.ts.map +1 -0
- package/dist/esm/Declarations/Contracts/index.js +4 -0
- package/dist/esm/Declarations/Contracts/index.js.map +1 -0
- package/dist/esm/config.d.ts +30 -0
- package/dist/esm/config.d.ts.map +1 -0
- package/dist/esm/config.js +2 -0
- package/dist/esm/config.js.map +1 -0
- package/dist/esm/export/base.d.ts +36 -0
- package/dist/esm/export/base.d.ts.map +1 -0
- package/dist/esm/export/base.js +55 -0
- package/dist/esm/export/base.js.map +1 -0
- package/dist/esm/export/log.d.ts +30 -0
- package/dist/esm/export/log.d.ts.map +1 -0
- package/dist/esm/export/log.js +64 -0
- package/dist/esm/export/log.js.map +1 -0
- package/dist/esm/export/metric.d.ts +39 -0
- package/dist/esm/export/metric.d.ts.map +1 -0
- package/dist/esm/export/metric.js +75 -0
- package/dist/esm/export/metric.js.map +1 -0
- package/dist/esm/export/statsbeat/longIntervalStatsbeatMetrics.d.ts +39 -0
- package/dist/esm/export/statsbeat/longIntervalStatsbeatMetrics.d.ts.map +1 -0
- package/dist/esm/export/statsbeat/longIntervalStatsbeatMetrics.js +123 -0
- package/dist/esm/export/statsbeat/longIntervalStatsbeatMetrics.js.map +1 -0
- package/dist/esm/export/statsbeat/networkStatsbeatMetrics.d.ts +51 -0
- package/dist/esm/export/statsbeat/networkStatsbeatMetrics.d.ts.map +1 -0
- package/dist/esm/export/statsbeat/networkStatsbeatMetrics.js +284 -0
- package/dist/esm/export/statsbeat/networkStatsbeatMetrics.js.map +1 -0
- package/dist/esm/export/statsbeat/statsbeatExporter.d.ts +32 -0
- package/dist/esm/export/statsbeat/statsbeatExporter.d.ts.map +1 -0
- package/dist/esm/export/statsbeat/statsbeatExporter.js +58 -0
- package/dist/esm/export/statsbeat/statsbeatExporter.js.map +1 -0
- package/dist/esm/export/statsbeat/statsbeatMetrics.d.ts +11 -0
- package/dist/esm/export/statsbeat/statsbeatMetrics.d.ts.map +1 -0
- package/dist/esm/export/statsbeat/statsbeatMetrics.js +101 -0
- package/dist/esm/export/statsbeat/statsbeatMetrics.js.map +1 -0
- package/dist/esm/export/statsbeat/types.d.ts +102 -0
- package/dist/esm/export/statsbeat/types.d.ts.map +1 -0
- package/dist/esm/export/statsbeat/types.js +84 -0
- package/dist/esm/export/statsbeat/types.js.map +1 -0
- package/dist/esm/export/trace.d.ts +31 -0
- package/dist/esm/export/trace.d.ts.map +1 -0
- package/dist/esm/export/trace.js +72 -0
- package/dist/esm/export/trace.js.map +1 -0
- package/dist/esm/generated/applicationInsightsClient.d.ts +17 -0
- package/dist/esm/generated/applicationInsightsClient.d.ts.map +1 -0
- package/dist/esm/generated/applicationInsightsClient.js +84 -0
- package/dist/esm/generated/applicationInsightsClient.js.map +1 -0
- package/dist/esm/generated/index.d.ts +3 -0
- package/dist/esm/generated/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/generated/index.js +2 -3
- package/dist/esm/generated/index.js.map +1 -0
- package/dist/esm/generated/models/index.d.ts +429 -0
- package/dist/esm/generated/models/index.d.ts.map +1 -0
- package/dist/esm/generated/models/index.js +90 -0
- package/dist/esm/generated/models/index.js.map +1 -0
- package/dist/esm/generated/models/mappers.d.ts +19 -0
- package/dist/esm/generated/models/mappers.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/generated/models/mappers.js +291 -270
- package/dist/esm/generated/models/mappers.js.map +1 -0
- package/dist/esm/generated/models/parameters.d.ts +6 -0
- package/dist/esm/generated/models/parameters.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/generated/models/parameters.js +17 -12
- package/dist/esm/generated/models/parameters.js.map +1 -0
- package/dist/esm/index.d.ts +10 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/platform/index.d.ts +2 -0
- package/dist/esm/platform/index.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/platform/index.js +2 -2
- package/dist/esm/platform/index.js.map +1 -0
- package/dist/esm/platform/nodejs/baseSender.d.ts +49 -0
- package/dist/esm/platform/nodejs/baseSender.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/baseSender.js +240 -0
- package/dist/esm/platform/nodejs/baseSender.js.map +1 -0
- package/dist/esm/platform/nodejs/constants.d.ts +10 -0
- package/dist/esm/platform/nodejs/constants.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/constants.js +12 -0
- package/dist/esm/platform/nodejs/constants.js.map +1 -0
- package/dist/esm/platform/nodejs/context/context.d.ts +21 -0
- package/dist/esm/platform/nodejs/context/context.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/context/context.js +60 -0
- package/dist/esm/platform/nodejs/context/context.js.map +1 -0
- package/dist/esm/platform/nodejs/context/index.d.ts +2 -0
- package/dist/esm/platform/nodejs/context/index.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/context/index.js +4 -0
- package/{dist-esm/src → dist/esm}/platform/nodejs/context/index.js.map +1 -1
- package/dist/esm/platform/nodejs/httpSender.d.ts +32 -0
- package/dist/esm/platform/nodejs/httpSender.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/httpSender.js +65 -0
- package/dist/esm/platform/nodejs/httpSender.js.map +1 -0
- package/dist/esm/platform/nodejs/index.d.ts +8 -0
- package/dist/esm/platform/nodejs/index.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/index.js +10 -0
- package/dist/esm/platform/nodejs/index.js.map +1 -0
- package/dist/esm/platform/nodejs/persist/fileAccessControl.d.ts +18 -0
- package/dist/esm/platform/nodejs/persist/fileAccessControl.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/persist/fileAccessControl.js +172 -0
- package/dist/esm/platform/nodejs/persist/fileAccessControl.js.map +1 -0
- package/dist/esm/platform/nodejs/persist/fileSystemHelpers.d.ts +11 -0
- package/dist/esm/platform/nodejs/persist/fileSystemHelpers.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/persist/fileSystemHelpers.js +55 -0
- package/dist/esm/platform/nodejs/persist/fileSystemHelpers.js.map +1 -0
- package/dist/esm/platform/nodejs/persist/fileSystemPersist.d.ts +29 -0
- package/dist/esm/platform/nodejs/persist/fileSystemPersist.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/persist/fileSystemPersist.js +180 -0
- package/dist/esm/platform/nodejs/persist/fileSystemPersist.js.map +1 -0
- package/dist/esm/platform/nodejs/persist/index.d.ts +2 -0
- package/dist/esm/platform/nodejs/persist/index.d.ts.map +1 -0
- package/dist/esm/platform/nodejs/persist/index.js +4 -0
- package/{dist-esm/src → dist/esm}/platform/nodejs/persist/index.js.map +1 -1
- package/dist/esm/sampling.d.ts +38 -0
- package/dist/esm/sampling.d.ts.map +1 -0
- package/dist/esm/sampling.js +88 -0
- package/dist/esm/sampling.js.map +1 -0
- package/dist/esm/types.d.ts +112 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +121 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/utils/breezeUtils.d.ts +25 -0
- package/dist/esm/utils/breezeUtils.d.ts.map +1 -0
- package/dist/esm/utils/breezeUtils.js +35 -0
- package/dist/esm/utils/breezeUtils.js.map +1 -0
- package/dist/esm/utils/common.d.ts +15 -0
- package/dist/esm/utils/common.d.ts.map +1 -0
- package/dist/esm/utils/common.js +244 -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/src → dist/esm}/utils/connectionStringParser.js +22 -8
- package/dist/esm/utils/connectionStringParser.js.map +1 -0
- package/dist/esm/utils/constants/applicationinsights.d.ts +42 -0
- package/dist/esm/utils/constants/applicationinsights.d.ts.map +1 -0
- package/dist/esm/utils/constants/applicationinsights.js +45 -0
- package/dist/esm/utils/constants/applicationinsights.js.map +1 -0
- package/dist/esm/utils/constants/span/azAttributes.d.ts +16 -0
- package/dist/esm/utils/constants/span/azAttributes.d.ts.map +1 -0
- package/dist/esm/utils/constants/span/azAttributes.js +18 -0
- package/dist/esm/utils/constants/span/azAttributes.js.map +1 -0
- package/dist/esm/utils/eventhub.d.ts +10 -0
- package/dist/esm/utils/eventhub.d.ts.map +1 -0
- package/{dist-esm/src → dist/esm}/utils/eventhub.js +6 -5
- package/dist/esm/utils/eventhub.js.map +1 -0
- package/dist/esm/utils/logUtils.d.ts +8 -0
- package/dist/esm/utils/logUtils.d.ts.map +1 -0
- package/dist/esm/utils/logUtils.js +219 -0
- package/dist/esm/utils/logUtils.js.map +1 -0
- package/dist/esm/utils/metricUtils.d.ts +13 -0
- package/dist/esm/utils/metricUtils.d.ts.map +1 -0
- package/dist/esm/utils/metricUtils.js +133 -0
- package/dist/esm/utils/metricUtils.js.map +1 -0
- package/dist/esm/utils/spanUtils.d.ts +27 -0
- package/dist/esm/utils/spanUtils.d.ts.map +1 -0
- package/dist/esm/utils/spanUtils.js +505 -0
- package/dist/esm/utils/spanUtils.js.map +1 -0
- package/package.json +98 -57
- package/CHANGELOG.md +0 -22
- package/dist/index.js +0 -1855
- package/dist-esm/src/Declarations/Constants.js.map +0 -1
- package/dist-esm/src/Declarations/Contracts/Constants.js +0 -4
- package/dist-esm/src/Declarations/Contracts/Constants.js.map +0 -1
- package/dist-esm/src/Declarations/Contracts/index.js +0 -4
- package/dist-esm/src/Declarations/Contracts/index.js.map +0 -1
- package/dist-esm/src/config.js +0 -13
- package/dist-esm/src/config.js.map +0 -1
- package/dist-esm/src/export/trace.js +0 -135
- package/dist-esm/src/export/trace.js.map +0 -1
- package/dist-esm/src/generated/applicationInsightsClient.js +0 -64
- package/dist-esm/src/generated/applicationInsightsClient.js.map +0 -1
- package/dist-esm/src/generated/applicationInsightsClientContext.js +0 -32
- package/dist-esm/src/generated/applicationInsightsClientContext.js.map +0 -1
- package/dist-esm/src/generated/index.js.map +0 -1
- package/dist-esm/src/generated/models/index.js +0 -9
- package/dist-esm/src/generated/models/index.js.map +0 -1
- package/dist-esm/src/generated/models/mappers.js.map +0 -1
- package/dist-esm/src/generated/models/parameters.js.map +0 -1
- package/dist-esm/src/index.js +0 -5
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/platform/index.js.map +0 -1
- package/dist-esm/src/platform/nodejs/constants.js +0 -8
- package/dist-esm/src/platform/nodejs/constants.js.map +0 -1
- package/dist-esm/src/platform/nodejs/context/context.js +0 -105
- package/dist-esm/src/platform/nodejs/context/context.js.map +0 -1
- package/dist-esm/src/platform/nodejs/context/index.js +0 -4
- package/dist-esm/src/platform/nodejs/httpSender.js +0 -34
- package/dist-esm/src/platform/nodejs/httpSender.js.map +0 -1
- package/dist-esm/src/platform/nodejs/index.js +0 -10
- package/dist-esm/src/platform/nodejs/index.js.map +0 -1
- package/dist-esm/src/platform/nodejs/persist/fileSystemHelpers.js +0 -48
- package/dist-esm/src/platform/nodejs/persist/fileSystemHelpers.js.map +0 -1
- package/dist-esm/src/platform/nodejs/persist/fileSystemPersist.js +0 -121
- package/dist-esm/src/platform/nodejs/persist/fileSystemPersist.js.map +0 -1
- package/dist-esm/src/platform/nodejs/persist/index.js +0 -4
- package/dist-esm/src/types.js +0 -4
- package/dist-esm/src/types.js.map +0 -1
- package/dist-esm/src/utils/breezeUtils.js +0 -27
- package/dist-esm/src/utils/breezeUtils.js.map +0 -1
- package/dist-esm/src/utils/connectionStringParser.js.map +0 -1
- package/dist-esm/src/utils/constants/applicationinsights.js +0 -13
- package/dist-esm/src/utils/constants/applicationinsights.js.map +0 -1
- package/dist-esm/src/utils/constants/span/azAttributes.js +0 -6
- package/dist-esm/src/utils/constants/span/azAttributes.js.map +0 -1
- package/dist-esm/src/utils/constants/span/dbAttributes.js +0 -14
- package/dist-esm/src/utils/constants/span/dbAttributes.js.map +0 -1
- package/dist-esm/src/utils/constants/span/grpcAttributes.js +0 -9
- package/dist-esm/src/utils/constants/span/grpcAttributes.js.map +0 -1
- package/dist-esm/src/utils/constants/span/httpAttributes.js +0 -8
- package/dist-esm/src/utils/constants/span/httpAttributes.js.map +0 -1
- package/dist-esm/src/utils/eventhub.js.map +0 -1
- package/dist-esm/src/utils/spanUtils.js +0 -214
- package/dist-esm/src/utils/spanUtils.js.map +0 -1
- package/types/monitor-opentelemetry-exporter.d.ts +0 -29
package/dist/index.js
DELETED
|
@@ -1,1855 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var tslib = require('tslib');
|
|
6
|
-
var core = require('@opentelemetry/core');
|
|
7
|
-
var coreHttp = require('@azure/core-http');
|
|
8
|
-
var api = require('@opentelemetry/api');
|
|
9
|
-
var fs = require('fs');
|
|
10
|
-
var os = require('os');
|
|
11
|
-
var path = require('path');
|
|
12
|
-
var util = require('util');
|
|
13
|
-
var url = require('url');
|
|
14
|
-
var resources = require('@opentelemetry/resources');
|
|
15
|
-
var conventions = require('@opentelemetry/semantic-conventions');
|
|
16
|
-
|
|
17
|
-
// Copyright (c) Microsoft Corporation.
|
|
18
|
-
(function (ServiceApiVersion) {
|
|
19
|
-
ServiceApiVersion["V2"] = "2020-09-15_Preview";
|
|
20
|
-
})(exports.ServiceApiVersion || (exports.ServiceApiVersion = {}));
|
|
21
|
-
const DEFAULT_BREEZE_ENDPOINT = "https://dc.services.visualstudio.com";
|
|
22
|
-
const DEFAULT_BREEZE_API_VERSION = exports.ServiceApiVersion.V2;
|
|
23
|
-
const DEFAULT_LIVEMETRICS_ENDPOINT = "https://rt.services.visualstudio.com";
|
|
24
|
-
const ENV_CONNECTION_STRING = "APPLICATIONINSIGHTS_CONNECTION_STRING";
|
|
25
|
-
var QuickPulseCounter;
|
|
26
|
-
(function (QuickPulseCounter) {
|
|
27
|
-
// Memory
|
|
28
|
-
QuickPulseCounter["COMMITTED_BYTES"] = "\\Memory\\Committed Bytes";
|
|
29
|
-
// CPU
|
|
30
|
-
QuickPulseCounter["PROCESSOR_TIME"] = "\\Processor(_Total)\\% Processor Time";
|
|
31
|
-
// Request
|
|
32
|
-
QuickPulseCounter["REQUEST_RATE"] = "\\ApplicationInsights\\Requests/Sec";
|
|
33
|
-
QuickPulseCounter["REQUEST_FAILURE_RATE"] = "\\ApplicationInsights\\Requests Failed/Sec";
|
|
34
|
-
QuickPulseCounter["REQUEST_DURATION"] = "\\ApplicationInsights\\Request Duration";
|
|
35
|
-
// Dependency
|
|
36
|
-
QuickPulseCounter["DEPENDENCY_RATE"] = "\\ApplicationInsights\\Dependency Calls/Sec";
|
|
37
|
-
QuickPulseCounter["DEPENDENCY_FAILURE_RATE"] = "\\ApplicationInsights\\Dependency Calls Failed/Sec";
|
|
38
|
-
QuickPulseCounter["DEPENDENCY_DURATION"] = "\\ApplicationInsights\\Dependency Call Duration";
|
|
39
|
-
// Exception
|
|
40
|
-
QuickPulseCounter["EXCEPTION_RATE"] = "\\ApplicationInsights\\Exceptions/Sec";
|
|
41
|
-
})(QuickPulseCounter || (QuickPulseCounter = {}));
|
|
42
|
-
var PerformanceCounter;
|
|
43
|
-
(function (PerformanceCounter) {
|
|
44
|
-
// Memory
|
|
45
|
-
PerformanceCounter["PRIVATE_BYTES"] = "\\Process(??APP_WIN32_PROC??)\\Private Bytes";
|
|
46
|
-
PerformanceCounter["AVAILABLE_BYTES"] = "\\Memory\\Available Bytes";
|
|
47
|
-
// CPU
|
|
48
|
-
PerformanceCounter["PROCESSOR_TIME"] = "\\Processor(_Total)\\% Processor Time";
|
|
49
|
-
PerformanceCounter["PROCESS_TIME"] = "\\Process(??APP_WIN32_PROC??)\\% Processor Time";
|
|
50
|
-
// Requests
|
|
51
|
-
PerformanceCounter["REQUEST_RATE"] = "\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec";
|
|
52
|
-
PerformanceCounter["REQUEST_DURATION"] = "\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time";
|
|
53
|
-
})(PerformanceCounter || (PerformanceCounter = {}));
|
|
54
|
-
/**
|
|
55
|
-
* Map a PerformanceCounter/QuickPulseCounter to a QuickPulseCounter. If no mapping exists, mapping is *undefined*
|
|
56
|
-
*/
|
|
57
|
-
const PerformanceToQuickPulseCounter = {
|
|
58
|
-
[PerformanceCounter.PROCESSOR_TIME]: QuickPulseCounter.PROCESSOR_TIME,
|
|
59
|
-
[PerformanceCounter.REQUEST_RATE]: QuickPulseCounter.REQUEST_RATE,
|
|
60
|
-
[PerformanceCounter.REQUEST_DURATION]: QuickPulseCounter.REQUEST_DURATION,
|
|
61
|
-
// Remap quick pulse only counters
|
|
62
|
-
[QuickPulseCounter.COMMITTED_BYTES]: QuickPulseCounter.COMMITTED_BYTES,
|
|
63
|
-
[QuickPulseCounter.REQUEST_FAILURE_RATE]: QuickPulseCounter.REQUEST_FAILURE_RATE,
|
|
64
|
-
[QuickPulseCounter.DEPENDENCY_RATE]: QuickPulseCounter.DEPENDENCY_RATE,
|
|
65
|
-
[QuickPulseCounter.DEPENDENCY_FAILURE_RATE]: QuickPulseCounter.DEPENDENCY_FAILURE_RATE,
|
|
66
|
-
[QuickPulseCounter.DEPENDENCY_DURATION]: QuickPulseCounter.DEPENDENCY_DURATION,
|
|
67
|
-
[QuickPulseCounter.EXCEPTION_RATE]: QuickPulseCounter.EXCEPTION_RATE
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// Copyright (c) Microsoft Corporation.
|
|
71
|
-
class ConnectionStringParser {
|
|
72
|
-
static parse(connectionString, logger = new api.NoopLogger()) {
|
|
73
|
-
if (!connectionString) {
|
|
74
|
-
return {};
|
|
75
|
-
}
|
|
76
|
-
const kvPairs = connectionString.split(ConnectionStringParser.FIELDS_SEPARATOR);
|
|
77
|
-
let isValid = true;
|
|
78
|
-
const result = kvPairs.reduce((fields, kv) => {
|
|
79
|
-
const kvParts = kv.split(ConnectionStringParser.FIELD_KEY_VALUE_SEPARATOR);
|
|
80
|
-
if (kvParts.length === 2) {
|
|
81
|
-
// only save fields with valid formats
|
|
82
|
-
const key = kvParts[0].toLowerCase();
|
|
83
|
-
const value = kvParts[1];
|
|
84
|
-
return Object.assign(Object.assign({}, fields), { [key]: value });
|
|
85
|
-
}
|
|
86
|
-
logger.error(`Connection string key-value pair is invalid: ${kv}`, `Entire connection string will be discarded`, connectionString);
|
|
87
|
-
isValid = false;
|
|
88
|
-
return fields;
|
|
89
|
-
}, {});
|
|
90
|
-
if (isValid && Object.keys(result).length > 0) {
|
|
91
|
-
// this is a valid connection string, so parse the results
|
|
92
|
-
if (result.endpointsuffix) {
|
|
93
|
-
// use endpoint suffix where overrides are not provided
|
|
94
|
-
const locationPrefix = result.location ? `${result.location}.` : "";
|
|
95
|
-
result.ingestionendpoint =
|
|
96
|
-
result.ingestionendpoint || `https://${locationPrefix}dc.${result.endpointsuffix}`;
|
|
97
|
-
result.liveendpoint =
|
|
98
|
-
result.liveendpoint || `https://${locationPrefix}live.${result.endpointsuffix}`;
|
|
99
|
-
}
|
|
100
|
-
result.ingestionendpoint = result.ingestionendpoint
|
|
101
|
-
? ConnectionStringParser.sanitizeUrl(result.ingestionendpoint)
|
|
102
|
-
: DEFAULT_BREEZE_ENDPOINT;
|
|
103
|
-
result.liveendpoint = result.liveendpoint
|
|
104
|
-
? ConnectionStringParser.sanitizeUrl(result.liveendpoint)
|
|
105
|
-
: DEFAULT_LIVEMETRICS_ENDPOINT;
|
|
106
|
-
if (result.authorization && result.authorization.toLowerCase() !== "ikey") {
|
|
107
|
-
logger.warn(`Connection String contains an unsupported 'Authorization' value: ${result.authorization}. Defaulting to 'Authorization=ikey'. Instrumentation Key ${result.instrumentationkey}`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
logger.error("An invalid connection string was passed in. There may be telemetry loss", connectionString);
|
|
112
|
-
}
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
115
|
-
static sanitizeUrl(url) {
|
|
116
|
-
let newUrl = url.trim();
|
|
117
|
-
if (newUrl.indexOf("https://") < 0) {
|
|
118
|
-
// Try to update http to https
|
|
119
|
-
newUrl = newUrl.replace("http://", "https://");
|
|
120
|
-
}
|
|
121
|
-
// Remove final slash if present
|
|
122
|
-
if (newUrl[newUrl.length - 1] == "/") {
|
|
123
|
-
newUrl = newUrl.slice(0, -1);
|
|
124
|
-
}
|
|
125
|
-
return newUrl;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
ConnectionStringParser.FIELDS_SEPARATOR = ";";
|
|
129
|
-
ConnectionStringParser.FIELD_KEY_VALUE_SEPARATOR = "=";
|
|
130
|
-
|
|
131
|
-
// Copyright (c) Microsoft Corporation.
|
|
132
|
-
const DEFAULT_BATCH_SEND_RETRY_INTERVAL_MS = 60000;
|
|
133
|
-
const DEFAULT_MAX_CONSECUTIVE_FAILURES_BEFORE_WARNING = 10;
|
|
134
|
-
const DEFAULT_EXPORTER_CONFIG = {
|
|
135
|
-
instrumentationKey: "",
|
|
136
|
-
endpointUrl: DEFAULT_BREEZE_ENDPOINT,
|
|
137
|
-
batchSendRetryIntervalMs: DEFAULT_BATCH_SEND_RETRY_INTERVAL_MS,
|
|
138
|
-
maxConsecutiveFailuresBeforeWarning: DEFAULT_MAX_CONSECUTIVE_FAILURES_BEFORE_WARNING,
|
|
139
|
-
serviceApiVersion: DEFAULT_BREEZE_API_VERSION
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// Copyright (c) Microsoft Corporation.
|
|
143
|
-
const readdirAsync = util.promisify(fs.readdir);
|
|
144
|
-
const statAsync = util.promisify(fs.stat);
|
|
145
|
-
const lstatAsync = util.promisify(fs.lstat);
|
|
146
|
-
const mkdirAsync = util.promisify(fs.mkdir);
|
|
147
|
-
/**
|
|
148
|
-
* Computes the size (in bytes) of all files in a directory at the root level. Asynchronously.
|
|
149
|
-
*/
|
|
150
|
-
const getShallowDirectorySize = (directory) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
151
|
-
// Get the directory listing
|
|
152
|
-
const files = yield readdirAsync(directory);
|
|
153
|
-
let totalSize = 0;
|
|
154
|
-
// Query all file sizes
|
|
155
|
-
for (const file of files) {
|
|
156
|
-
const fileStats = yield statAsync(path.join(directory, file));
|
|
157
|
-
if (fileStats.isFile()) {
|
|
158
|
-
totalSize += fileStats.size;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
return totalSize;
|
|
162
|
-
});
|
|
163
|
-
const confirmDirExists = (directory) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
164
|
-
try {
|
|
165
|
-
const stats = yield lstatAsync(directory);
|
|
166
|
-
if (!stats.isDirectory()) {
|
|
167
|
-
throw new Error("Path existed but was not a directory");
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
catch (err) {
|
|
171
|
-
if (err && err.code === "ENOENT") {
|
|
172
|
-
try {
|
|
173
|
-
yield mkdirAsync(directory);
|
|
174
|
-
}
|
|
175
|
-
catch (mkdirErr) {
|
|
176
|
-
if (mkdirErr && mkdirErr.code !== "EEXIST") {
|
|
177
|
-
// Handle race condition by ignoring EEXIST
|
|
178
|
-
throw mkdirErr;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
// Copyright (c) Microsoft Corporation.
|
|
186
|
-
const statAsync$1 = util.promisify(fs.stat);
|
|
187
|
-
const readdirAsync$1 = util.promisify(fs.readdir);
|
|
188
|
-
const readFileAsync = util.promisify(fs.readFile);
|
|
189
|
-
const unlinkAsync = util.promisify(fs.unlink);
|
|
190
|
-
const writeFileAsync = util.promisify(fs.writeFile);
|
|
191
|
-
class FileSystemPersist {
|
|
192
|
-
constructor(options = {}) {
|
|
193
|
-
this.maxBytesOnDisk = 50000000; // ~50MB
|
|
194
|
-
this._options = Object.assign(Object.assign({}, DEFAULT_EXPORTER_CONFIG), options);
|
|
195
|
-
this._logger = options.logger || new api.NoopLogger();
|
|
196
|
-
if (!this._options.instrumentationKey) {
|
|
197
|
-
this._logger.error(`No instrumentation key was provided to FileSystemPersister. Files may not be properly persisted`);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
push(value) {
|
|
201
|
-
this._logger.debug("Pushing value to persistent storage", value.toString());
|
|
202
|
-
return this._storeToDisk(JSON.stringify(value));
|
|
203
|
-
}
|
|
204
|
-
shift() {
|
|
205
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
206
|
-
this._logger.debug("Searching for filesystem persisted files");
|
|
207
|
-
try {
|
|
208
|
-
const buffer = yield this._getFirstFileOnDisk();
|
|
209
|
-
if (buffer) {
|
|
210
|
-
return JSON.parse(buffer.toString("utf8"));
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
catch (e) {
|
|
214
|
-
this._logger.debug("Failed to read persisted file", e);
|
|
215
|
-
}
|
|
216
|
-
return null;
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Check for temp telemetry files
|
|
221
|
-
* reads the first file if exist, deletes it and tries to send its load
|
|
222
|
-
*/
|
|
223
|
-
_getFirstFileOnDisk() {
|
|
224
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
225
|
-
const tempDir = path.join(os.tmpdir(), FileSystemPersist.TEMPDIR_PREFIX + this._options.instrumentationKey);
|
|
226
|
-
try {
|
|
227
|
-
const stats = yield statAsync$1(tempDir);
|
|
228
|
-
if (stats.isDirectory()) {
|
|
229
|
-
const origFiles = yield readdirAsync$1(tempDir);
|
|
230
|
-
const files = origFiles.filter((f) => path.basename(f).includes(FileSystemPersist.FILENAME_SUFFIX));
|
|
231
|
-
if (files.length === 0) {
|
|
232
|
-
return null;
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
const firstFile = files[0];
|
|
236
|
-
const filePath = path.join(tempDir, firstFile);
|
|
237
|
-
const payload = yield readFileAsync(filePath);
|
|
238
|
-
// delete the file first to prevent double sending
|
|
239
|
-
yield unlinkAsync(filePath);
|
|
240
|
-
return payload;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return null;
|
|
244
|
-
}
|
|
245
|
-
catch (e) {
|
|
246
|
-
if (e.code === "ENOENT") {
|
|
247
|
-
// File does not exist -- return null instead of throwing
|
|
248
|
-
return null;
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
throw e;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
_storeToDisk(payload) {
|
|
257
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
258
|
-
const directory = path.join(os.tmpdir(), FileSystemPersist.TEMPDIR_PREFIX + this._options.instrumentationKey);
|
|
259
|
-
try {
|
|
260
|
-
yield confirmDirExists(directory);
|
|
261
|
-
}
|
|
262
|
-
catch (error) {
|
|
263
|
-
this._logger.warn(`Error while checking/creating directory: `, error && error.message);
|
|
264
|
-
return false;
|
|
265
|
-
}
|
|
266
|
-
try {
|
|
267
|
-
const size = yield getShallowDirectorySize(directory);
|
|
268
|
-
if (size > this.maxBytesOnDisk) {
|
|
269
|
-
this._logger.warn(`Not saving data due to max size limit being met. Directory size in bytes is: ${size}`);
|
|
270
|
-
return false;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
catch (error) {
|
|
274
|
-
this._logger.warn(`Error while checking size of persistence directory: `, error && error.message);
|
|
275
|
-
return false;
|
|
276
|
-
}
|
|
277
|
-
// create file - file name for now is the timestamp, @todo: a better approach would be a UUID but that
|
|
278
|
-
// would require an external dependency
|
|
279
|
-
const fileName = `${new Date().getTime()}${FileSystemPersist.FILENAME_SUFFIX}`;
|
|
280
|
-
const fileFullPath = path.join(directory, fileName);
|
|
281
|
-
// Mode 600 is w/r for creator and no read access for others
|
|
282
|
-
this._logger.info(`saving data to disk at: ${fileFullPath}`);
|
|
283
|
-
try {
|
|
284
|
-
yield writeFileAsync(fileFullPath, payload, { mode: 0o600 });
|
|
285
|
-
}
|
|
286
|
-
catch (writeError) {
|
|
287
|
-
this._logger.warn(`Error writing file to persistent file storage`, writeError);
|
|
288
|
-
return false;
|
|
289
|
-
}
|
|
290
|
-
return true;
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
FileSystemPersist.TEMPDIR_PREFIX = "ot-azure-exporter-";
|
|
295
|
-
FileSystemPersist.FILENAME_SUFFIX = ".ai.json";
|
|
296
|
-
|
|
297
|
-
/*
|
|
298
|
-
* Copyright (c) Microsoft Corporation.
|
|
299
|
-
* Licensed under the MIT License.
|
|
300
|
-
*
|
|
301
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
302
|
-
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
303
|
-
*/
|
|
304
|
-
const contentType = {
|
|
305
|
-
parameterPath: ["options", "contentType"],
|
|
306
|
-
mapper: {
|
|
307
|
-
defaultValue: "application/json",
|
|
308
|
-
isConstant: true,
|
|
309
|
-
serializedName: "Content-Type",
|
|
310
|
-
type: {
|
|
311
|
-
name: "String"
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
const body = {
|
|
316
|
-
parameterPath: "body",
|
|
317
|
-
mapper: {
|
|
318
|
-
serializedName: "body",
|
|
319
|
-
required: true,
|
|
320
|
-
type: {
|
|
321
|
-
name: "Sequence",
|
|
322
|
-
element: { type: { name: "Composite", className: "TelemetryItem" } }
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
const accept = {
|
|
327
|
-
parameterPath: "accept",
|
|
328
|
-
mapper: {
|
|
329
|
-
defaultValue: "application/json",
|
|
330
|
-
isConstant: true,
|
|
331
|
-
serializedName: "Accept",
|
|
332
|
-
type: {
|
|
333
|
-
name: "String"
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
const host = {
|
|
338
|
-
parameterPath: "host",
|
|
339
|
-
mapper: {
|
|
340
|
-
serializedName: "Host",
|
|
341
|
-
required: true,
|
|
342
|
-
type: {
|
|
343
|
-
name: "String"
|
|
344
|
-
}
|
|
345
|
-
},
|
|
346
|
-
skipEncoding: true
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
/*
|
|
350
|
-
* Copyright (c) Microsoft Corporation.
|
|
351
|
-
* Licensed under the MIT License.
|
|
352
|
-
*
|
|
353
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
354
|
-
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
355
|
-
*/
|
|
356
|
-
const TelemetryItem = {
|
|
357
|
-
type: {
|
|
358
|
-
name: "Composite",
|
|
359
|
-
className: "TelemetryItem",
|
|
360
|
-
modelProperties: {
|
|
361
|
-
version: {
|
|
362
|
-
defaultValue: 1,
|
|
363
|
-
serializedName: "ver",
|
|
364
|
-
type: {
|
|
365
|
-
name: "Number"
|
|
366
|
-
}
|
|
367
|
-
},
|
|
368
|
-
name: {
|
|
369
|
-
serializedName: "name",
|
|
370
|
-
required: true,
|
|
371
|
-
type: {
|
|
372
|
-
name: "String"
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
time: {
|
|
376
|
-
serializedName: "time",
|
|
377
|
-
required: true,
|
|
378
|
-
type: {
|
|
379
|
-
name: "DateTime"
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
sampleRate: {
|
|
383
|
-
defaultValue: 100,
|
|
384
|
-
serializedName: "sampleRate",
|
|
385
|
-
type: {
|
|
386
|
-
name: "Number"
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
sequence: {
|
|
390
|
-
constraints: {
|
|
391
|
-
MaxLength: 64
|
|
392
|
-
},
|
|
393
|
-
serializedName: "seq",
|
|
394
|
-
type: {
|
|
395
|
-
name: "String"
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
instrumentationKey: {
|
|
399
|
-
serializedName: "iKey",
|
|
400
|
-
type: {
|
|
401
|
-
name: "String"
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
tags: {
|
|
405
|
-
serializedName: "tags",
|
|
406
|
-
type: {
|
|
407
|
-
name: "Dictionary",
|
|
408
|
-
value: { type: { name: "String" } }
|
|
409
|
-
}
|
|
410
|
-
},
|
|
411
|
-
data: {
|
|
412
|
-
serializedName: "data",
|
|
413
|
-
type: {
|
|
414
|
-
name: "Composite",
|
|
415
|
-
className: "MonitorBase"
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
const MonitorBase = {
|
|
422
|
-
type: {
|
|
423
|
-
name: "Composite",
|
|
424
|
-
className: "MonitorBase",
|
|
425
|
-
modelProperties: {
|
|
426
|
-
baseType: {
|
|
427
|
-
serializedName: "baseType",
|
|
428
|
-
type: {
|
|
429
|
-
name: "String"
|
|
430
|
-
}
|
|
431
|
-
},
|
|
432
|
-
baseData: {
|
|
433
|
-
serializedName: "baseData",
|
|
434
|
-
type: {
|
|
435
|
-
name: "Composite",
|
|
436
|
-
className: "MonitorDomain"
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
|
-
const MonitorDomain = {
|
|
443
|
-
type: {
|
|
444
|
-
name: "Composite",
|
|
445
|
-
className: "MonitorDomain",
|
|
446
|
-
additionalProperties: { type: { name: "Object" } },
|
|
447
|
-
modelProperties: {
|
|
448
|
-
version: {
|
|
449
|
-
defaultValue: 2,
|
|
450
|
-
serializedName: "ver",
|
|
451
|
-
required: true,
|
|
452
|
-
type: {
|
|
453
|
-
name: "Number"
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
const TrackResponse = {
|
|
460
|
-
type: {
|
|
461
|
-
name: "Composite",
|
|
462
|
-
className: "TrackResponse",
|
|
463
|
-
modelProperties: {
|
|
464
|
-
itemsReceived: {
|
|
465
|
-
serializedName: "itemsReceived",
|
|
466
|
-
type: {
|
|
467
|
-
name: "Number"
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
itemsAccepted: {
|
|
471
|
-
serializedName: "itemsAccepted",
|
|
472
|
-
type: {
|
|
473
|
-
name: "Number"
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
errors: {
|
|
477
|
-
serializedName: "errors",
|
|
478
|
-
type: {
|
|
479
|
-
name: "Sequence",
|
|
480
|
-
element: {
|
|
481
|
-
type: { name: "Composite", className: "TelemetryErrorDetails" }
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
const TelemetryErrorDetails = {
|
|
489
|
-
type: {
|
|
490
|
-
name: "Composite",
|
|
491
|
-
className: "TelemetryErrorDetails",
|
|
492
|
-
modelProperties: {
|
|
493
|
-
index: {
|
|
494
|
-
serializedName: "index",
|
|
495
|
-
type: {
|
|
496
|
-
name: "Number"
|
|
497
|
-
}
|
|
498
|
-
},
|
|
499
|
-
statusCode: {
|
|
500
|
-
serializedName: "statusCode",
|
|
501
|
-
type: {
|
|
502
|
-
name: "Number"
|
|
503
|
-
}
|
|
504
|
-
},
|
|
505
|
-
message: {
|
|
506
|
-
serializedName: "message",
|
|
507
|
-
type: {
|
|
508
|
-
name: "String"
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
};
|
|
514
|
-
const MetricDataPoint = {
|
|
515
|
-
type: {
|
|
516
|
-
name: "Composite",
|
|
517
|
-
className: "MetricDataPoint",
|
|
518
|
-
modelProperties: {
|
|
519
|
-
namespace: {
|
|
520
|
-
constraints: {
|
|
521
|
-
MaxLength: 256
|
|
522
|
-
},
|
|
523
|
-
serializedName: "ns",
|
|
524
|
-
type: {
|
|
525
|
-
name: "String"
|
|
526
|
-
}
|
|
527
|
-
},
|
|
528
|
-
name: {
|
|
529
|
-
constraints: {
|
|
530
|
-
MaxLength: 1024
|
|
531
|
-
},
|
|
532
|
-
serializedName: "name",
|
|
533
|
-
required: true,
|
|
534
|
-
type: {
|
|
535
|
-
name: "String"
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
dataPointType: {
|
|
539
|
-
serializedName: "kind",
|
|
540
|
-
type: {
|
|
541
|
-
name: "String"
|
|
542
|
-
}
|
|
543
|
-
},
|
|
544
|
-
value: {
|
|
545
|
-
serializedName: "value",
|
|
546
|
-
required: true,
|
|
547
|
-
type: {
|
|
548
|
-
name: "Number"
|
|
549
|
-
}
|
|
550
|
-
},
|
|
551
|
-
count: {
|
|
552
|
-
serializedName: "count",
|
|
553
|
-
type: {
|
|
554
|
-
name: "Number"
|
|
555
|
-
}
|
|
556
|
-
},
|
|
557
|
-
min: {
|
|
558
|
-
serializedName: "min",
|
|
559
|
-
type: {
|
|
560
|
-
name: "Number"
|
|
561
|
-
}
|
|
562
|
-
},
|
|
563
|
-
max: {
|
|
564
|
-
serializedName: "max",
|
|
565
|
-
type: {
|
|
566
|
-
name: "Number"
|
|
567
|
-
}
|
|
568
|
-
},
|
|
569
|
-
stdDev: {
|
|
570
|
-
serializedName: "stdDev",
|
|
571
|
-
type: {
|
|
572
|
-
name: "Number"
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
const TelemetryExceptionDetails = {
|
|
579
|
-
type: {
|
|
580
|
-
name: "Composite",
|
|
581
|
-
className: "TelemetryExceptionDetails",
|
|
582
|
-
modelProperties: {
|
|
583
|
-
id: {
|
|
584
|
-
serializedName: "id",
|
|
585
|
-
type: {
|
|
586
|
-
name: "Number"
|
|
587
|
-
}
|
|
588
|
-
},
|
|
589
|
-
outerId: {
|
|
590
|
-
serializedName: "outerId",
|
|
591
|
-
type: {
|
|
592
|
-
name: "Number"
|
|
593
|
-
}
|
|
594
|
-
},
|
|
595
|
-
typeName: {
|
|
596
|
-
constraints: {
|
|
597
|
-
MaxLength: 1024
|
|
598
|
-
},
|
|
599
|
-
serializedName: "typeName",
|
|
600
|
-
type: {
|
|
601
|
-
name: "String"
|
|
602
|
-
}
|
|
603
|
-
},
|
|
604
|
-
message: {
|
|
605
|
-
constraints: {
|
|
606
|
-
MaxLength: 32768
|
|
607
|
-
},
|
|
608
|
-
serializedName: "message",
|
|
609
|
-
required: true,
|
|
610
|
-
type: {
|
|
611
|
-
name: "String"
|
|
612
|
-
}
|
|
613
|
-
},
|
|
614
|
-
hasFullStack: {
|
|
615
|
-
defaultValue: true,
|
|
616
|
-
serializedName: "hasFullStack",
|
|
617
|
-
type: {
|
|
618
|
-
name: "Boolean"
|
|
619
|
-
}
|
|
620
|
-
},
|
|
621
|
-
stack: {
|
|
622
|
-
constraints: {
|
|
623
|
-
MaxLength: 32768
|
|
624
|
-
},
|
|
625
|
-
serializedName: "stack",
|
|
626
|
-
type: {
|
|
627
|
-
name: "String"
|
|
628
|
-
}
|
|
629
|
-
},
|
|
630
|
-
parsedStack: {
|
|
631
|
-
serializedName: "parsedStack",
|
|
632
|
-
type: {
|
|
633
|
-
name: "Sequence",
|
|
634
|
-
element: { type: { name: "Composite", className: "StackFrame" } }
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
|
-
};
|
|
640
|
-
const StackFrame = {
|
|
641
|
-
type: {
|
|
642
|
-
name: "Composite",
|
|
643
|
-
className: "StackFrame",
|
|
644
|
-
modelProperties: {
|
|
645
|
-
level: {
|
|
646
|
-
serializedName: "level",
|
|
647
|
-
required: true,
|
|
648
|
-
type: {
|
|
649
|
-
name: "Number"
|
|
650
|
-
}
|
|
651
|
-
},
|
|
652
|
-
method: {
|
|
653
|
-
constraints: {
|
|
654
|
-
MaxLength: 1024
|
|
655
|
-
},
|
|
656
|
-
serializedName: "method",
|
|
657
|
-
required: true,
|
|
658
|
-
type: {
|
|
659
|
-
name: "String"
|
|
660
|
-
}
|
|
661
|
-
},
|
|
662
|
-
assembly: {
|
|
663
|
-
constraints: {
|
|
664
|
-
MaxLength: 1024
|
|
665
|
-
},
|
|
666
|
-
serializedName: "assembly",
|
|
667
|
-
type: {
|
|
668
|
-
name: "String"
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
fileName: {
|
|
672
|
-
constraints: {
|
|
673
|
-
MaxLength: 1024
|
|
674
|
-
},
|
|
675
|
-
serializedName: "fileName",
|
|
676
|
-
type: {
|
|
677
|
-
name: "String"
|
|
678
|
-
}
|
|
679
|
-
},
|
|
680
|
-
line: {
|
|
681
|
-
serializedName: "line",
|
|
682
|
-
type: {
|
|
683
|
-
name: "Number"
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
};
|
|
689
|
-
const AvailabilityData = {
|
|
690
|
-
type: {
|
|
691
|
-
name: "Composite",
|
|
692
|
-
className: "AvailabilityData",
|
|
693
|
-
additionalProperties: { type: { name: "Object" } },
|
|
694
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { id: {
|
|
695
|
-
constraints: {
|
|
696
|
-
MaxLength: 512
|
|
697
|
-
},
|
|
698
|
-
serializedName: "id",
|
|
699
|
-
required: true,
|
|
700
|
-
type: {
|
|
701
|
-
name: "String"
|
|
702
|
-
}
|
|
703
|
-
}, name: {
|
|
704
|
-
constraints: {
|
|
705
|
-
MaxLength: 1024
|
|
706
|
-
},
|
|
707
|
-
serializedName: "name",
|
|
708
|
-
required: true,
|
|
709
|
-
type: {
|
|
710
|
-
name: "String"
|
|
711
|
-
}
|
|
712
|
-
}, duration: {
|
|
713
|
-
serializedName: "duration",
|
|
714
|
-
required: true,
|
|
715
|
-
type: {
|
|
716
|
-
name: "String"
|
|
717
|
-
}
|
|
718
|
-
}, success: {
|
|
719
|
-
serializedName: "success",
|
|
720
|
-
required: true,
|
|
721
|
-
type: {
|
|
722
|
-
name: "Boolean"
|
|
723
|
-
}
|
|
724
|
-
}, runLocation: {
|
|
725
|
-
constraints: {
|
|
726
|
-
MaxLength: 1024
|
|
727
|
-
},
|
|
728
|
-
serializedName: "runLocation",
|
|
729
|
-
type: {
|
|
730
|
-
name: "String"
|
|
731
|
-
}
|
|
732
|
-
}, message: {
|
|
733
|
-
constraints: {
|
|
734
|
-
MaxLength: 8192
|
|
735
|
-
},
|
|
736
|
-
serializedName: "message",
|
|
737
|
-
type: {
|
|
738
|
-
name: "String"
|
|
739
|
-
}
|
|
740
|
-
}, properties: {
|
|
741
|
-
serializedName: "properties",
|
|
742
|
-
type: {
|
|
743
|
-
name: "Dictionary",
|
|
744
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
745
|
-
}
|
|
746
|
-
}, measurements: {
|
|
747
|
-
serializedName: "measurements",
|
|
748
|
-
type: {
|
|
749
|
-
name: "Dictionary",
|
|
750
|
-
value: { type: { name: "Number" } }
|
|
751
|
-
}
|
|
752
|
-
} })
|
|
753
|
-
}
|
|
754
|
-
};
|
|
755
|
-
const TelemetryEventData = {
|
|
756
|
-
type: {
|
|
757
|
-
name: "Composite",
|
|
758
|
-
className: "TelemetryEventData",
|
|
759
|
-
additionalProperties: { type: { name: "Object" } },
|
|
760
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { name: {
|
|
761
|
-
constraints: {
|
|
762
|
-
MaxLength: 512
|
|
763
|
-
},
|
|
764
|
-
serializedName: "name",
|
|
765
|
-
required: true,
|
|
766
|
-
type: {
|
|
767
|
-
name: "String"
|
|
768
|
-
}
|
|
769
|
-
}, properties: {
|
|
770
|
-
serializedName: "properties",
|
|
771
|
-
type: {
|
|
772
|
-
name: "Dictionary",
|
|
773
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
774
|
-
}
|
|
775
|
-
}, measurements: {
|
|
776
|
-
serializedName: "measurements",
|
|
777
|
-
type: {
|
|
778
|
-
name: "Dictionary",
|
|
779
|
-
value: { type: { name: "Number" } }
|
|
780
|
-
}
|
|
781
|
-
} })
|
|
782
|
-
}
|
|
783
|
-
};
|
|
784
|
-
const TelemetryExceptionData = {
|
|
785
|
-
type: {
|
|
786
|
-
name: "Composite",
|
|
787
|
-
className: "TelemetryExceptionData",
|
|
788
|
-
additionalProperties: { type: { name: "Object" } },
|
|
789
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { exceptions: {
|
|
790
|
-
serializedName: "exceptions",
|
|
791
|
-
required: true,
|
|
792
|
-
type: {
|
|
793
|
-
name: "Sequence",
|
|
794
|
-
element: {
|
|
795
|
-
type: { name: "Composite", className: "TelemetryExceptionDetails" }
|
|
796
|
-
}
|
|
797
|
-
}
|
|
798
|
-
}, severityLevel: {
|
|
799
|
-
serializedName: "severityLevel",
|
|
800
|
-
type: {
|
|
801
|
-
name: "String"
|
|
802
|
-
}
|
|
803
|
-
}, problemId: {
|
|
804
|
-
constraints: {
|
|
805
|
-
MaxLength: 1024
|
|
806
|
-
},
|
|
807
|
-
serializedName: "problemId",
|
|
808
|
-
type: {
|
|
809
|
-
name: "String"
|
|
810
|
-
}
|
|
811
|
-
}, properties: {
|
|
812
|
-
serializedName: "properties",
|
|
813
|
-
type: {
|
|
814
|
-
name: "Dictionary",
|
|
815
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
816
|
-
}
|
|
817
|
-
}, measurements: {
|
|
818
|
-
serializedName: "measurements",
|
|
819
|
-
type: {
|
|
820
|
-
name: "Dictionary",
|
|
821
|
-
value: { type: { name: "Number" } }
|
|
822
|
-
}
|
|
823
|
-
} })
|
|
824
|
-
}
|
|
825
|
-
};
|
|
826
|
-
const MessageData = {
|
|
827
|
-
type: {
|
|
828
|
-
name: "Composite",
|
|
829
|
-
className: "MessageData",
|
|
830
|
-
additionalProperties: { type: { name: "Object" } },
|
|
831
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { message: {
|
|
832
|
-
constraints: {
|
|
833
|
-
MaxLength: 32768
|
|
834
|
-
},
|
|
835
|
-
serializedName: "message",
|
|
836
|
-
required: true,
|
|
837
|
-
type: {
|
|
838
|
-
name: "String"
|
|
839
|
-
}
|
|
840
|
-
}, severityLevel: {
|
|
841
|
-
serializedName: "severityLevel",
|
|
842
|
-
type: {
|
|
843
|
-
name: "String"
|
|
844
|
-
}
|
|
845
|
-
}, properties: {
|
|
846
|
-
serializedName: "properties",
|
|
847
|
-
type: {
|
|
848
|
-
name: "Dictionary",
|
|
849
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
850
|
-
}
|
|
851
|
-
}, measurements: {
|
|
852
|
-
serializedName: "measurements",
|
|
853
|
-
type: {
|
|
854
|
-
name: "Dictionary",
|
|
855
|
-
value: { type: { name: "Number" } }
|
|
856
|
-
}
|
|
857
|
-
} })
|
|
858
|
-
}
|
|
859
|
-
};
|
|
860
|
-
const MetricsData = {
|
|
861
|
-
type: {
|
|
862
|
-
name: "Composite",
|
|
863
|
-
className: "MetricsData",
|
|
864
|
-
additionalProperties: { type: { name: "Object" } },
|
|
865
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { metrics: {
|
|
866
|
-
serializedName: "metrics",
|
|
867
|
-
required: true,
|
|
868
|
-
type: {
|
|
869
|
-
name: "Sequence",
|
|
870
|
-
element: { type: { name: "Composite", className: "MetricDataPoint" } }
|
|
871
|
-
}
|
|
872
|
-
}, properties: {
|
|
873
|
-
serializedName: "properties",
|
|
874
|
-
type: {
|
|
875
|
-
name: "Dictionary",
|
|
876
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
877
|
-
}
|
|
878
|
-
} })
|
|
879
|
-
}
|
|
880
|
-
};
|
|
881
|
-
const PageViewData = {
|
|
882
|
-
type: {
|
|
883
|
-
name: "Composite",
|
|
884
|
-
className: "PageViewData",
|
|
885
|
-
additionalProperties: { type: { name: "Object" } },
|
|
886
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { id: {
|
|
887
|
-
constraints: {
|
|
888
|
-
MaxLength: 512
|
|
889
|
-
},
|
|
890
|
-
serializedName: "id",
|
|
891
|
-
required: true,
|
|
892
|
-
type: {
|
|
893
|
-
name: "String"
|
|
894
|
-
}
|
|
895
|
-
}, name: {
|
|
896
|
-
constraints: {
|
|
897
|
-
MaxLength: 1024
|
|
898
|
-
},
|
|
899
|
-
serializedName: "name",
|
|
900
|
-
required: true,
|
|
901
|
-
type: {
|
|
902
|
-
name: "String"
|
|
903
|
-
}
|
|
904
|
-
}, url: {
|
|
905
|
-
constraints: {
|
|
906
|
-
MaxLength: 2048
|
|
907
|
-
},
|
|
908
|
-
serializedName: "url",
|
|
909
|
-
type: {
|
|
910
|
-
name: "String"
|
|
911
|
-
}
|
|
912
|
-
}, duration: {
|
|
913
|
-
serializedName: "duration",
|
|
914
|
-
type: {
|
|
915
|
-
name: "String"
|
|
916
|
-
}
|
|
917
|
-
}, referredUri: {
|
|
918
|
-
constraints: {
|
|
919
|
-
MaxLength: 2048
|
|
920
|
-
},
|
|
921
|
-
serializedName: "referredUri",
|
|
922
|
-
type: {
|
|
923
|
-
name: "String"
|
|
924
|
-
}
|
|
925
|
-
}, properties: {
|
|
926
|
-
serializedName: "properties",
|
|
927
|
-
type: {
|
|
928
|
-
name: "Dictionary",
|
|
929
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
930
|
-
}
|
|
931
|
-
}, measurements: {
|
|
932
|
-
serializedName: "measurements",
|
|
933
|
-
type: {
|
|
934
|
-
name: "Dictionary",
|
|
935
|
-
value: { type: { name: "Number" } }
|
|
936
|
-
}
|
|
937
|
-
} })
|
|
938
|
-
}
|
|
939
|
-
};
|
|
940
|
-
const PageViewPerfData = {
|
|
941
|
-
type: {
|
|
942
|
-
name: "Composite",
|
|
943
|
-
className: "PageViewPerfData",
|
|
944
|
-
additionalProperties: { type: { name: "Object" } },
|
|
945
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { id: {
|
|
946
|
-
constraints: {
|
|
947
|
-
MaxLength: 512
|
|
948
|
-
},
|
|
949
|
-
serializedName: "id",
|
|
950
|
-
required: true,
|
|
951
|
-
type: {
|
|
952
|
-
name: "String"
|
|
953
|
-
}
|
|
954
|
-
}, name: {
|
|
955
|
-
constraints: {
|
|
956
|
-
MaxLength: 1024
|
|
957
|
-
},
|
|
958
|
-
serializedName: "name",
|
|
959
|
-
required: true,
|
|
960
|
-
type: {
|
|
961
|
-
name: "String"
|
|
962
|
-
}
|
|
963
|
-
}, url: {
|
|
964
|
-
constraints: {
|
|
965
|
-
MaxLength: 2048
|
|
966
|
-
},
|
|
967
|
-
serializedName: "url",
|
|
968
|
-
type: {
|
|
969
|
-
name: "String"
|
|
970
|
-
}
|
|
971
|
-
}, duration: {
|
|
972
|
-
serializedName: "duration",
|
|
973
|
-
type: {
|
|
974
|
-
name: "String"
|
|
975
|
-
}
|
|
976
|
-
}, perfTotal: {
|
|
977
|
-
serializedName: "perfTotal",
|
|
978
|
-
type: {
|
|
979
|
-
name: "String"
|
|
980
|
-
}
|
|
981
|
-
}, networkConnect: {
|
|
982
|
-
serializedName: "networkConnect",
|
|
983
|
-
type: {
|
|
984
|
-
name: "String"
|
|
985
|
-
}
|
|
986
|
-
}, sentRequest: {
|
|
987
|
-
serializedName: "sentRequest",
|
|
988
|
-
type: {
|
|
989
|
-
name: "String"
|
|
990
|
-
}
|
|
991
|
-
}, receivedResponse: {
|
|
992
|
-
serializedName: "receivedResponse",
|
|
993
|
-
type: {
|
|
994
|
-
name: "String"
|
|
995
|
-
}
|
|
996
|
-
}, domProcessing: {
|
|
997
|
-
serializedName: "domProcessing",
|
|
998
|
-
type: {
|
|
999
|
-
name: "String"
|
|
1000
|
-
}
|
|
1001
|
-
}, properties: {
|
|
1002
|
-
serializedName: "properties",
|
|
1003
|
-
type: {
|
|
1004
|
-
name: "Dictionary",
|
|
1005
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
1006
|
-
}
|
|
1007
|
-
}, measurements: {
|
|
1008
|
-
serializedName: "measurements",
|
|
1009
|
-
type: {
|
|
1010
|
-
name: "Dictionary",
|
|
1011
|
-
value: { type: { name: "Number" } }
|
|
1012
|
-
}
|
|
1013
|
-
} })
|
|
1014
|
-
}
|
|
1015
|
-
};
|
|
1016
|
-
const RemoteDependencyData = {
|
|
1017
|
-
type: {
|
|
1018
|
-
name: "Composite",
|
|
1019
|
-
className: "RemoteDependencyData",
|
|
1020
|
-
additionalProperties: { type: { name: "Object" } },
|
|
1021
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { id: {
|
|
1022
|
-
constraints: {
|
|
1023
|
-
MaxLength: 512
|
|
1024
|
-
},
|
|
1025
|
-
serializedName: "id",
|
|
1026
|
-
type: {
|
|
1027
|
-
name: "String"
|
|
1028
|
-
}
|
|
1029
|
-
}, name: {
|
|
1030
|
-
constraints: {
|
|
1031
|
-
MaxLength: 1024
|
|
1032
|
-
},
|
|
1033
|
-
serializedName: "name",
|
|
1034
|
-
required: true,
|
|
1035
|
-
type: {
|
|
1036
|
-
name: "String"
|
|
1037
|
-
}
|
|
1038
|
-
}, resultCode: {
|
|
1039
|
-
constraints: {
|
|
1040
|
-
MaxLength: 1024
|
|
1041
|
-
},
|
|
1042
|
-
serializedName: "resultCode",
|
|
1043
|
-
type: {
|
|
1044
|
-
name: "String"
|
|
1045
|
-
}
|
|
1046
|
-
}, data: {
|
|
1047
|
-
constraints: {
|
|
1048
|
-
MaxLength: 8192
|
|
1049
|
-
},
|
|
1050
|
-
serializedName: "data",
|
|
1051
|
-
type: {
|
|
1052
|
-
name: "String"
|
|
1053
|
-
}
|
|
1054
|
-
}, type: {
|
|
1055
|
-
constraints: {
|
|
1056
|
-
MaxLength: 1024
|
|
1057
|
-
},
|
|
1058
|
-
serializedName: "type",
|
|
1059
|
-
type: {
|
|
1060
|
-
name: "String"
|
|
1061
|
-
}
|
|
1062
|
-
}, target: {
|
|
1063
|
-
constraints: {
|
|
1064
|
-
MaxLength: 1024
|
|
1065
|
-
},
|
|
1066
|
-
serializedName: "target",
|
|
1067
|
-
type: {
|
|
1068
|
-
name: "String"
|
|
1069
|
-
}
|
|
1070
|
-
}, duration: {
|
|
1071
|
-
serializedName: "duration",
|
|
1072
|
-
required: true,
|
|
1073
|
-
type: {
|
|
1074
|
-
name: "String"
|
|
1075
|
-
}
|
|
1076
|
-
}, success: {
|
|
1077
|
-
defaultValue: true,
|
|
1078
|
-
serializedName: "success",
|
|
1079
|
-
type: {
|
|
1080
|
-
name: "Boolean"
|
|
1081
|
-
}
|
|
1082
|
-
}, properties: {
|
|
1083
|
-
serializedName: "properties",
|
|
1084
|
-
type: {
|
|
1085
|
-
name: "Dictionary",
|
|
1086
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
1087
|
-
}
|
|
1088
|
-
}, measurements: {
|
|
1089
|
-
serializedName: "measurements",
|
|
1090
|
-
type: {
|
|
1091
|
-
name: "Dictionary",
|
|
1092
|
-
value: { type: { name: "Number" } }
|
|
1093
|
-
}
|
|
1094
|
-
} })
|
|
1095
|
-
}
|
|
1096
|
-
};
|
|
1097
|
-
const RequestData = {
|
|
1098
|
-
type: {
|
|
1099
|
-
name: "Composite",
|
|
1100
|
-
className: "RequestData",
|
|
1101
|
-
additionalProperties: { type: { name: "Object" } },
|
|
1102
|
-
modelProperties: Object.assign(Object.assign({}, MonitorDomain.type.modelProperties), { id: {
|
|
1103
|
-
constraints: {
|
|
1104
|
-
MaxLength: 512
|
|
1105
|
-
},
|
|
1106
|
-
serializedName: "id",
|
|
1107
|
-
required: true,
|
|
1108
|
-
type: {
|
|
1109
|
-
name: "String"
|
|
1110
|
-
}
|
|
1111
|
-
}, name: {
|
|
1112
|
-
constraints: {
|
|
1113
|
-
MaxLength: 1024
|
|
1114
|
-
},
|
|
1115
|
-
serializedName: "name",
|
|
1116
|
-
type: {
|
|
1117
|
-
name: "String"
|
|
1118
|
-
}
|
|
1119
|
-
}, duration: {
|
|
1120
|
-
serializedName: "duration",
|
|
1121
|
-
required: true,
|
|
1122
|
-
type: {
|
|
1123
|
-
name: "String"
|
|
1124
|
-
}
|
|
1125
|
-
}, success: {
|
|
1126
|
-
defaultValue: true,
|
|
1127
|
-
serializedName: "success",
|
|
1128
|
-
required: true,
|
|
1129
|
-
type: {
|
|
1130
|
-
name: "Boolean"
|
|
1131
|
-
}
|
|
1132
|
-
}, responseCode: {
|
|
1133
|
-
constraints: {
|
|
1134
|
-
MaxLength: 1024
|
|
1135
|
-
},
|
|
1136
|
-
serializedName: "responseCode",
|
|
1137
|
-
required: true,
|
|
1138
|
-
type: {
|
|
1139
|
-
name: "String"
|
|
1140
|
-
}
|
|
1141
|
-
}, source: {
|
|
1142
|
-
constraints: {
|
|
1143
|
-
MaxLength: 1024
|
|
1144
|
-
},
|
|
1145
|
-
serializedName: "source",
|
|
1146
|
-
type: {
|
|
1147
|
-
name: "String"
|
|
1148
|
-
}
|
|
1149
|
-
}, url: {
|
|
1150
|
-
constraints: {
|
|
1151
|
-
MaxLength: 2048
|
|
1152
|
-
},
|
|
1153
|
-
serializedName: "url",
|
|
1154
|
-
type: {
|
|
1155
|
-
name: "String"
|
|
1156
|
-
}
|
|
1157
|
-
}, properties: {
|
|
1158
|
-
serializedName: "properties",
|
|
1159
|
-
type: {
|
|
1160
|
-
name: "Dictionary",
|
|
1161
|
-
value: { type: { name: "String" }, constraints: { MaxLength: 8192 } }
|
|
1162
|
-
}
|
|
1163
|
-
}, measurements: {
|
|
1164
|
-
serializedName: "measurements",
|
|
1165
|
-
type: {
|
|
1166
|
-
name: "Dictionary",
|
|
1167
|
-
value: { type: { name: "Number" } }
|
|
1168
|
-
}
|
|
1169
|
-
} })
|
|
1170
|
-
}
|
|
1171
|
-
};
|
|
1172
|
-
|
|
1173
|
-
var Mappers = /*#__PURE__*/Object.freeze({
|
|
1174
|
-
__proto__: null,
|
|
1175
|
-
TelemetryItem: TelemetryItem,
|
|
1176
|
-
MonitorBase: MonitorBase,
|
|
1177
|
-
MonitorDomain: MonitorDomain,
|
|
1178
|
-
TrackResponse: TrackResponse,
|
|
1179
|
-
TelemetryErrorDetails: TelemetryErrorDetails,
|
|
1180
|
-
MetricDataPoint: MetricDataPoint,
|
|
1181
|
-
TelemetryExceptionDetails: TelemetryExceptionDetails,
|
|
1182
|
-
StackFrame: StackFrame,
|
|
1183
|
-
AvailabilityData: AvailabilityData,
|
|
1184
|
-
TelemetryEventData: TelemetryEventData,
|
|
1185
|
-
TelemetryExceptionData: TelemetryExceptionData,
|
|
1186
|
-
MessageData: MessageData,
|
|
1187
|
-
MetricsData: MetricsData,
|
|
1188
|
-
PageViewData: PageViewData,
|
|
1189
|
-
PageViewPerfData: PageViewPerfData,
|
|
1190
|
-
RemoteDependencyData: RemoteDependencyData,
|
|
1191
|
-
RequestData: RequestData
|
|
1192
|
-
});
|
|
1193
|
-
|
|
1194
|
-
/*
|
|
1195
|
-
* Copyright (c) Microsoft Corporation.
|
|
1196
|
-
* Licensed under the MIT License.
|
|
1197
|
-
*
|
|
1198
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
1199
|
-
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
1200
|
-
*/
|
|
1201
|
-
const packageName = "@azure/monitor-opentelemetry-exporter";
|
|
1202
|
-
const packageVersion = "1.0.0-beta.2";
|
|
1203
|
-
class ApplicationInsightsClientContext extends coreHttp.ServiceClient {
|
|
1204
|
-
/**
|
|
1205
|
-
* Initializes a new instance of the ApplicationInsightsClientContext class.
|
|
1206
|
-
* @param options The parameter options
|
|
1207
|
-
*/
|
|
1208
|
-
constructor(options) {
|
|
1209
|
-
// Initializing default values for options
|
|
1210
|
-
if (!options) {
|
|
1211
|
-
options = {};
|
|
1212
|
-
}
|
|
1213
|
-
if (!options.userAgent) {
|
|
1214
|
-
const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
|
|
1215
|
-
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
|
|
1216
|
-
}
|
|
1217
|
-
super(undefined, options);
|
|
1218
|
-
this.requestContentType = "application/json; charset=utf-8";
|
|
1219
|
-
this.baseUri = options.endpoint || "{Host}/v2";
|
|
1220
|
-
// Assigning values to Constant parameters
|
|
1221
|
-
this.host = options.host || "https://dc.services.visualstudio.com";
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
/*
|
|
1226
|
-
* Copyright (c) Microsoft Corporation.
|
|
1227
|
-
* Licensed under the MIT License.
|
|
1228
|
-
*
|
|
1229
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
1230
|
-
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
1231
|
-
*/
|
|
1232
|
-
class ApplicationInsightsClient extends ApplicationInsightsClientContext {
|
|
1233
|
-
/**
|
|
1234
|
-
* Initializes a new instance of the ApplicationInsightsClient class.
|
|
1235
|
-
* @param options The parameter options
|
|
1236
|
-
*/
|
|
1237
|
-
constructor(options) {
|
|
1238
|
-
super(options);
|
|
1239
|
-
}
|
|
1240
|
-
/**
|
|
1241
|
-
* This operation sends a sequence of telemetry events that will be monitored by Azure Monitor.
|
|
1242
|
-
* @param body The list of telemetry events to track.
|
|
1243
|
-
* @param options The options parameters.
|
|
1244
|
-
*/
|
|
1245
|
-
track(body, options) {
|
|
1246
|
-
const operationOptions = coreHttp.operationOptionsToRequestOptionsBase(options || {});
|
|
1247
|
-
return this.sendOperationRequest({ body, options: operationOptions }, trackOperationSpec);
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
// Operation Specifications
|
|
1251
|
-
const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);
|
|
1252
|
-
const trackOperationSpec = {
|
|
1253
|
-
path: "/track",
|
|
1254
|
-
httpMethod: "POST",
|
|
1255
|
-
responses: {
|
|
1256
|
-
200: {
|
|
1257
|
-
bodyMapper: TrackResponse
|
|
1258
|
-
},
|
|
1259
|
-
206: {
|
|
1260
|
-
bodyMapper: TrackResponse
|
|
1261
|
-
},
|
|
1262
|
-
400: {
|
|
1263
|
-
bodyMapper: TrackResponse
|
|
1264
|
-
},
|
|
1265
|
-
402: {
|
|
1266
|
-
bodyMapper: TrackResponse
|
|
1267
|
-
},
|
|
1268
|
-
429: {
|
|
1269
|
-
bodyMapper: TrackResponse
|
|
1270
|
-
},
|
|
1271
|
-
500: {
|
|
1272
|
-
bodyMapper: TrackResponse
|
|
1273
|
-
},
|
|
1274
|
-
503: {
|
|
1275
|
-
bodyMapper: TrackResponse
|
|
1276
|
-
}
|
|
1277
|
-
},
|
|
1278
|
-
requestBody: body,
|
|
1279
|
-
urlParameters: [host],
|
|
1280
|
-
headerParameters: [contentType, accept],
|
|
1281
|
-
mediaType: "json",
|
|
1282
|
-
serializer
|
|
1283
|
-
};
|
|
1284
|
-
|
|
1285
|
-
// Copyright (c) Microsoft Corporation.
|
|
1286
|
-
class HttpSender {
|
|
1287
|
-
constructor(_exporterOptions) {
|
|
1288
|
-
this._exporterOptions = _exporterOptions;
|
|
1289
|
-
this._logger = this._exporterOptions.logger || new core.ConsoleLogger(core.LogLevel.ERROR);
|
|
1290
|
-
// Build endpoint using provided configuration or default values
|
|
1291
|
-
this._appInsightsClientOptions = {
|
|
1292
|
-
host: this._exporterOptions.endpointUrl
|
|
1293
|
-
};
|
|
1294
|
-
this._appInsightsClient = new ApplicationInsightsClient(Object.assign({}, this._appInsightsClientOptions));
|
|
1295
|
-
}
|
|
1296
|
-
send(envelopes) {
|
|
1297
|
-
var _a;
|
|
1298
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1299
|
-
try {
|
|
1300
|
-
const { _response: res } = yield this._appInsightsClient.track(envelopes);
|
|
1301
|
-
return { statusCode: res.status, result: (_a = res.bodyAsText) !== null && _a !== void 0 ? _a : "" };
|
|
1302
|
-
}
|
|
1303
|
-
catch (e) {
|
|
1304
|
-
throw e;
|
|
1305
|
-
}
|
|
1306
|
-
});
|
|
1307
|
-
}
|
|
1308
|
-
shutdown() {
|
|
1309
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1310
|
-
this._logger.info("HttpSender shutting down");
|
|
1311
|
-
});
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
// Copyright (c) Microsoft Corporation.
|
|
1316
|
-
let instance = null;
|
|
1317
|
-
class Context {
|
|
1318
|
-
constructor(_logger = new core.ConsoleLogger(core.LogLevel.WARN),
|
|
1319
|
-
/**
|
|
1320
|
-
* Path to this module's `package.json` relative to
|
|
1321
|
-
* `Context.ROOT_PATH`
|
|
1322
|
-
*/
|
|
1323
|
-
_exporterPrefix = "./",
|
|
1324
|
-
/**
|
|
1325
|
-
* Path to end user application folder which contains `package.json`
|
|
1326
|
-
* relative to `Context.ROOT_PATH`
|
|
1327
|
-
*/
|
|
1328
|
-
_appPrefix = "../../../") {
|
|
1329
|
-
this._logger = _logger;
|
|
1330
|
-
this._exporterPrefix = _exporterPrefix;
|
|
1331
|
-
this._appPrefix = _appPrefix;
|
|
1332
|
-
this.tags = {};
|
|
1333
|
-
this._loadApplicationContext();
|
|
1334
|
-
this._loadDeviceContext();
|
|
1335
|
-
this._loadInternalContext();
|
|
1336
|
-
}
|
|
1337
|
-
_loadApplicationContext() {
|
|
1338
|
-
if (Object.keys(Context.appVersion).length === 0) {
|
|
1339
|
-
// note: this should return the host package.json
|
|
1340
|
-
let packageJson = null;
|
|
1341
|
-
const packageJsonPath = path.resolve(__dirname, Context.JS_NODE_PREFIX, this._appPrefix, Context.ROOT_PATH, "./package.json");
|
|
1342
|
-
const packageJsonPathTsNode = path.resolve(__dirname, this._appPrefix, Context.ROOT_PATH, "./package.json");
|
|
1343
|
-
Context.appVersion[packageJsonPath] = "unknown";
|
|
1344
|
-
try {
|
|
1345
|
-
packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
1346
|
-
}
|
|
1347
|
-
catch (_) {
|
|
1348
|
-
try {
|
|
1349
|
-
packageJson = JSON.parse(fs.readFileSync(packageJsonPathTsNode, "utf8"));
|
|
1350
|
-
}
|
|
1351
|
-
catch (exception) {
|
|
1352
|
-
this._logger.warn("Failed to load Application version", exception);
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
if (packageJson && typeof packageJson.version === "string") {
|
|
1356
|
-
Context.appVersion[packageJsonPath] = packageJson.version;
|
|
1357
|
-
}
|
|
1358
|
-
this.tags["ai.application.ver"] = Context.appVersion[packageJsonPath];
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
_loadDeviceContext() {
|
|
1362
|
-
this.tags["ai.device.id"] = "";
|
|
1363
|
-
this.tags["ai.device.osVersion"] = os && `${os.type()} ${os.release()}`;
|
|
1364
|
-
// not yet supported tags
|
|
1365
|
-
this.tags["ai.device.osArchitecture"] = os && os.arch();
|
|
1366
|
-
this.tags["ai.device.osPlatform"] = os && os.platform();
|
|
1367
|
-
}
|
|
1368
|
-
_loadInternalContext() {
|
|
1369
|
-
if (!Context.sdkVersion) {
|
|
1370
|
-
let packageJson = null;
|
|
1371
|
-
const { node } = process.versions;
|
|
1372
|
-
[Context.nodeVersion] = node.split(".");
|
|
1373
|
-
// note: this should return the sdk package.json
|
|
1374
|
-
const packageJsonPath = path.resolve(__dirname, Context.JS_NODE_PREFIX, this._exporterPrefix, Context.ROOT_PATH, "./package.json");
|
|
1375
|
-
const packageJsonPathTsNode = path.resolve(__dirname, this._exporterPrefix, Context.ROOT_PATH, "./package.json");
|
|
1376
|
-
Context.sdkVersion = "unknown";
|
|
1377
|
-
try {
|
|
1378
|
-
packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
1379
|
-
}
|
|
1380
|
-
catch (_) {
|
|
1381
|
-
try {
|
|
1382
|
-
packageJson = JSON.parse(fs.readFileSync(packageJsonPathTsNode, "utf8"));
|
|
1383
|
-
}
|
|
1384
|
-
catch (exception) {
|
|
1385
|
-
this._logger.warn("Failed to load Exporter version", exception);
|
|
1386
|
-
throw exception;
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
if (packageJson && typeof packageJson.version === "string") {
|
|
1390
|
-
Context.sdkVersion = packageJson.version;
|
|
1391
|
-
}
|
|
1392
|
-
}
|
|
1393
|
-
this.tags["ai.internal.sdkVersion"] = `node${Context.nodeVersion}:ot${core.SDK_INFO.VERSION}:ext${Context.sdkVersion}`;
|
|
1394
|
-
}
|
|
1395
|
-
}
|
|
1396
|
-
Context.appVersion = {};
|
|
1397
|
-
Context.sdkVersion = null;
|
|
1398
|
-
Context.opentelemetryVersion = null;
|
|
1399
|
-
Context.nodeVersion = "";
|
|
1400
|
-
/**
|
|
1401
|
-
* Add extra ../ to access on environments not using ts-node
|
|
1402
|
-
*/
|
|
1403
|
-
Context.JS_NODE_PREFIX = "../";
|
|
1404
|
-
/**
|
|
1405
|
-
* Path to azure-opentelemetry-exporter
|
|
1406
|
-
*/
|
|
1407
|
-
Context.ROOT_PATH = "../../../../";
|
|
1408
|
-
function getInstance(logger, exporterPrefix, appPrefix) {
|
|
1409
|
-
if (!instance) {
|
|
1410
|
-
instance = new Context(logger, exporterPrefix, appPrefix);
|
|
1411
|
-
}
|
|
1412
|
-
return instance;
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
// Copyright (c) Microsoft Corporation.
|
|
1416
|
-
// Licensed under the MIT license.
|
|
1417
|
-
function isRetriable(statusCode) {
|
|
1418
|
-
return (statusCode === 206 || // Retriable
|
|
1419
|
-
statusCode === 408 || // Timeout
|
|
1420
|
-
statusCode === 429 || // Throttle
|
|
1421
|
-
statusCode === 439 || // Quota
|
|
1422
|
-
statusCode === 500 || // Server Error
|
|
1423
|
-
statusCode === 503 // Server Unavilable
|
|
1424
|
-
);
|
|
1425
|
-
}
|
|
1426
|
-
function msToTimeSpan(ms) {
|
|
1427
|
-
let totalms = ms;
|
|
1428
|
-
if (Number.isNaN(totalms) || totalms < 0 || !Number.isFinite(ms)) {
|
|
1429
|
-
totalms = 0;
|
|
1430
|
-
}
|
|
1431
|
-
let sec = ((totalms / 1000) % 60).toFixed(7).replace(/0{0,4}$/, "");
|
|
1432
|
-
let min = `${Math.floor(totalms / (1000 * 60)) % 60}`;
|
|
1433
|
-
let hour = `${Math.floor(totalms / (1000 * 60 * 60)) % 24}`;
|
|
1434
|
-
const days = Math.floor(totalms / (1000 * 60 * 60 * 24));
|
|
1435
|
-
sec = sec.indexOf(".") < 2 ? `0${sec}` : sec;
|
|
1436
|
-
min = min.length < 2 ? `0${min}` : min;
|
|
1437
|
-
hour = hour.length < 2 ? `0${hour}` : hour;
|
|
1438
|
-
const daysText = days > 0 ? `${days}.` : "";
|
|
1439
|
-
return `${daysText + hour}:${min}:${sec}`;
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
// Copyright (c) Microsoft Corporation.
|
|
1443
|
-
const { HTTP_METHOD } = conventions.HttpAttribute;
|
|
1444
|
-
const { HTTP_URL } = conventions.HttpAttribute;
|
|
1445
|
-
const { HTTP_ROUTE } = conventions.HttpAttribute;
|
|
1446
|
-
const { HTTP_STATUS_CODE } = conventions.HttpAttribute;
|
|
1447
|
-
|
|
1448
|
-
// Copyright (c) Microsoft Corporation.
|
|
1449
|
-
// Licensed under the MIT license.
|
|
1450
|
-
const AI_CLOUD_ROLE = "ai.cloud.role";
|
|
1451
|
-
const AI_CLOUD_ROLE_INSTACE = "ai.cloud.roleInstance";
|
|
1452
|
-
const AI_OPERATION_ID = "ai.operation.id";
|
|
1453
|
-
const AI_OPERATION_PARENT_ID = "ai.operation.parentId";
|
|
1454
|
-
const AI_OPERATION_NAME = "ai.operation.name";
|
|
1455
|
-
const MS_LINKS = "_MS.links";
|
|
1456
|
-
const INPROC = "InProc";
|
|
1457
|
-
const ENQUEUED_TIME = "enqueuedTime";
|
|
1458
|
-
const TIME_SINCE_ENQUEUED = "timeSinceEnqueued";
|
|
1459
|
-
|
|
1460
|
-
// Copyright (c) Microsoft Corporation.
|
|
1461
|
-
const { GRPC_METHOD } = conventions.RpcAttribute;
|
|
1462
|
-
const { GRPC_STATUS_CODE } = conventions.RpcAttribute;
|
|
1463
|
-
const { GRPC_ERROR_NAME } = conventions.RpcAttribute;
|
|
1464
|
-
const { GRPC_ERROR_MESSAGE } = conventions.RpcAttribute;
|
|
1465
|
-
|
|
1466
|
-
// Copyright (c) Microsoft Corporation.
|
|
1467
|
-
const { DB_TYPE } = conventions.DatabaseAttribute;
|
|
1468
|
-
const { DB_INSTANCE } = conventions.DatabaseAttribute;
|
|
1469
|
-
const { DB_STATEMENT } = conventions.DatabaseAttribute;
|
|
1470
|
-
const PEER_ADDRESS = conventions.GeneralAttribute.NET_PEER_ADDRESS;
|
|
1471
|
-
const PEER_HOSTNAME = conventions.GeneralAttribute.NET_PEER_HOSTNAME;
|
|
1472
|
-
// Optionals
|
|
1473
|
-
const PEER_PORT = conventions.GeneralAttribute.NET_PEER_PORT;
|
|
1474
|
-
const PEER_IPV4 = conventions.GeneralAttribute.NET_PEER_IPV4;
|
|
1475
|
-
const PEER_IPV6 = conventions.GeneralAttribute.NET_PEER_IPV6;
|
|
1476
|
-
const PEER_SERVICE = conventions.GeneralAttribute.NET_PEER_SERVICE;
|
|
1477
|
-
|
|
1478
|
-
// Copyright (c) Microsoft Corporation.
|
|
1479
|
-
// Licensed under the MIT license.
|
|
1480
|
-
const AzNamespace = "az.namespace";
|
|
1481
|
-
const MicrosoftEventHub = "Microsoft.EventHub";
|
|
1482
|
-
const MessageBusDestination = "message_bus.destination";
|
|
1483
|
-
|
|
1484
|
-
// Copyright (c) Microsoft Corporation.
|
|
1485
|
-
/**
|
|
1486
|
-
* Average span.links[].attributes.enqueuedTime
|
|
1487
|
-
*/
|
|
1488
|
-
const getTimeSinceEnqueued = (span) => {
|
|
1489
|
-
let countEnqueueDiffs = 0;
|
|
1490
|
-
let sumEnqueueDiffs = 0;
|
|
1491
|
-
const startTimeMs = core.hrTimeToMilliseconds(span.startTime);
|
|
1492
|
-
span.links.forEach(({ attributes }) => {
|
|
1493
|
-
const enqueuedTime = attributes === null || attributes === void 0 ? void 0 : attributes[ENQUEUED_TIME];
|
|
1494
|
-
if (enqueuedTime) {
|
|
1495
|
-
countEnqueueDiffs += 1;
|
|
1496
|
-
sumEnqueueDiffs += startTimeMs - (parseFloat(enqueuedTime.toString()) || 0);
|
|
1497
|
-
}
|
|
1498
|
-
});
|
|
1499
|
-
return Math.max(sumEnqueueDiffs / (countEnqueueDiffs || 1), 0);
|
|
1500
|
-
};
|
|
1501
|
-
/**
|
|
1502
|
-
* Implementation of Mapping to Azure Monitor
|
|
1503
|
-
*
|
|
1504
|
-
* https://gist.github.com/lmolkova/e4215c0f44a49ef824983382762e6b92#mapping-to-azure-monitor-application-insights-telemetry
|
|
1505
|
-
*/
|
|
1506
|
-
const parseEventHubSpan = (span, baseData) => {
|
|
1507
|
-
const namespace = span.attributes[AzNamespace];
|
|
1508
|
-
const peerAddress = (span.attributes[conventions.GeneralAttribute.NET_PEER_ADDRESS] ||
|
|
1509
|
-
span.attributes["peer.address"] ||
|
|
1510
|
-
"unknown").replace(/\/$/g, ""); // remove trailing "/"
|
|
1511
|
-
const messageBusDestination = (span.attributes[MessageBusDestination] || "unknown");
|
|
1512
|
-
switch (span.kind) {
|
|
1513
|
-
case api.SpanKind.CLIENT:
|
|
1514
|
-
baseData.type = namespace;
|
|
1515
|
-
baseData.target = `${peerAddress}/${messageBusDestination}`;
|
|
1516
|
-
break;
|
|
1517
|
-
case api.SpanKind.PRODUCER:
|
|
1518
|
-
baseData.type = `Queue Message | ${namespace}`;
|
|
1519
|
-
baseData.target = `${peerAddress}/${messageBusDestination}`;
|
|
1520
|
-
break;
|
|
1521
|
-
case api.SpanKind.CONSUMER:
|
|
1522
|
-
baseData.type = `Queue Message | ${namespace}`;
|
|
1523
|
-
baseData.source = `${peerAddress}/${messageBusDestination}`;
|
|
1524
|
-
baseData.measurements = Object.assign(Object.assign({}, baseData.measurements), { [TIME_SINCE_ENQUEUED]: getTimeSinceEnqueued(span) });
|
|
1525
|
-
break;
|
|
1526
|
-
}
|
|
1527
|
-
};
|
|
1528
|
-
|
|
1529
|
-
// Copyright (c) Microsoft Corporation.
|
|
1530
|
-
function createTagsFromSpan(span) {
|
|
1531
|
-
const context = getInstance();
|
|
1532
|
-
const tags = Object.assign({}, context.tags);
|
|
1533
|
-
tags[AI_OPERATION_ID] = span.spanContext.traceId;
|
|
1534
|
-
if (span.parentSpanId) {
|
|
1535
|
-
tags[AI_OPERATION_PARENT_ID] = span.parentSpanId;
|
|
1536
|
-
}
|
|
1537
|
-
if (span.resource && span.resource.attributes) {
|
|
1538
|
-
const serviceName = span.resource.attributes[resources.SERVICE_RESOURCE.NAME];
|
|
1539
|
-
const serviceNamespace = span.resource.attributes[resources.SERVICE_RESOURCE.NAMESPACE];
|
|
1540
|
-
const serviceInstanceId = span.resource.attributes[resources.SERVICE_RESOURCE.INSTANCE_ID];
|
|
1541
|
-
if (serviceName) {
|
|
1542
|
-
if (serviceNamespace) {
|
|
1543
|
-
tags[AI_CLOUD_ROLE] = `${serviceNamespace}.${serviceName}`;
|
|
1544
|
-
}
|
|
1545
|
-
else {
|
|
1546
|
-
tags[AI_CLOUD_ROLE] = String(serviceName);
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
if (serviceInstanceId) {
|
|
1550
|
-
tags[AI_CLOUD_ROLE_INSTACE] = String(serviceInstanceId);
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
// @todo: is this for RequestData only?
|
|
1554
|
-
if ((span.kind === api.SpanKind.SERVER || span.kind === api.SpanKind.CONSUMER) &&
|
|
1555
|
-
span.attributes[GRPC_METHOD]) {
|
|
1556
|
-
tags[AI_OPERATION_NAME] = String(span.attributes[GRPC_METHOD]);
|
|
1557
|
-
}
|
|
1558
|
-
if ((span.kind === api.SpanKind.SERVER || span.kind === api.SpanKind.CONSUMER) &&
|
|
1559
|
-
span.attributes[HTTP_METHOD] &&
|
|
1560
|
-
span.attributes[HTTP_ROUTE]) {
|
|
1561
|
-
tags[AI_OPERATION_NAME] = `${span.attributes[HTTP_METHOD]} ${span.attributes[HTTP_ROUTE]}`;
|
|
1562
|
-
}
|
|
1563
|
-
return tags;
|
|
1564
|
-
}
|
|
1565
|
-
function createPropertiesFromSpan(span) {
|
|
1566
|
-
const properties = {};
|
|
1567
|
-
const measurements = {};
|
|
1568
|
-
for (const key of Object.keys(span.attributes)) {
|
|
1569
|
-
if (key === GRPC_ERROR_MESSAGE ||
|
|
1570
|
-
key === GRPC_ERROR_NAME ||
|
|
1571
|
-
!(key.startsWith("http.") || key.startsWith("grpc.") || key.startsWith("db."))) {
|
|
1572
|
-
properties[key] = span.attributes[key];
|
|
1573
|
-
}
|
|
1574
|
-
}
|
|
1575
|
-
const links = span.links.map((link) => ({
|
|
1576
|
-
operation_Id: link.context.traceId,
|
|
1577
|
-
id: link.context.spanId
|
|
1578
|
-
}));
|
|
1579
|
-
if (links.length > 0) {
|
|
1580
|
-
properties[MS_LINKS] = JSON.stringify(links);
|
|
1581
|
-
}
|
|
1582
|
-
return [properties, measurements];
|
|
1583
|
-
}
|
|
1584
|
-
function createDependencyData(span) {
|
|
1585
|
-
const data = {
|
|
1586
|
-
name: span.name,
|
|
1587
|
-
id: `|${span.spanContext.traceId}.${span.spanContext.spanId}.`,
|
|
1588
|
-
success: span.status.code === api.StatusCode.OK,
|
|
1589
|
-
resultCode: String(span.status.code),
|
|
1590
|
-
target: span.attributes[HTTP_URL],
|
|
1591
|
-
type: "Dependency",
|
|
1592
|
-
duration: msToTimeSpan(core.hrTimeToMilliseconds(span.duration)),
|
|
1593
|
-
version: 1
|
|
1594
|
-
};
|
|
1595
|
-
if (span.attributes[HTTP_STATUS_CODE]) {
|
|
1596
|
-
data.type = "HTTP";
|
|
1597
|
-
data.resultCode = String(span.attributes[HTTP_STATUS_CODE]);
|
|
1598
|
-
}
|
|
1599
|
-
if (span.attributes[GRPC_STATUS_CODE] !== undefined) {
|
|
1600
|
-
data.type = "GRPC";
|
|
1601
|
-
data.resultCode = String(span.attributes[GRPC_STATUS_CODE]);
|
|
1602
|
-
}
|
|
1603
|
-
if (span.attributes[GRPC_METHOD]) {
|
|
1604
|
-
data.target = String(span.attributes[GRPC_METHOD]);
|
|
1605
|
-
data.data = String(span.attributes[GRPC_METHOD]);
|
|
1606
|
-
}
|
|
1607
|
-
if (span.attributes[HTTP_URL]) {
|
|
1608
|
-
const url$1 = new url.URL(span.attributes[HTTP_URL]);
|
|
1609
|
-
data.target = url$1.hostname;
|
|
1610
|
-
data.data = url$1.href;
|
|
1611
|
-
if (span.attributes[HTTP_METHOD]) {
|
|
1612
|
-
data.name = `${span.attributes[HTTP_METHOD]} ${url$1.pathname}`;
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
if (span.attributes[DB_STATEMENT]) {
|
|
1616
|
-
data.name = String(span.attributes[DB_STATEMENT]);
|
|
1617
|
-
data.data = String(span.attributes[DB_STATEMENT]);
|
|
1618
|
-
if (span.attributes[DB_TYPE]) {
|
|
1619
|
-
data.type = String(span.attributes[DB_TYPE]);
|
|
1620
|
-
}
|
|
1621
|
-
else {
|
|
1622
|
-
data.type = "DB";
|
|
1623
|
-
}
|
|
1624
|
-
if (span.attributes[DB_INSTANCE]) {
|
|
1625
|
-
data.target = String(span.attributes[DB_INSTANCE]);
|
|
1626
|
-
}
|
|
1627
|
-
}
|
|
1628
|
-
return data;
|
|
1629
|
-
}
|
|
1630
|
-
function createRequestData(span) {
|
|
1631
|
-
const data = {
|
|
1632
|
-
name: span.name,
|
|
1633
|
-
id: `|${span.spanContext.traceId}.${span.spanContext.spanId}.`,
|
|
1634
|
-
success: span.status.code === api.StatusCode.OK,
|
|
1635
|
-
responseCode: String(span.status.code),
|
|
1636
|
-
duration: msToTimeSpan(core.hrTimeToMilliseconds(span.duration)),
|
|
1637
|
-
version: 1,
|
|
1638
|
-
source: undefined
|
|
1639
|
-
};
|
|
1640
|
-
if (span.attributes[HTTP_METHOD]) {
|
|
1641
|
-
data.name = span.attributes[HTTP_METHOD];
|
|
1642
|
-
if (span.attributes[HTTP_STATUS_CODE]) {
|
|
1643
|
-
data.responseCode = String(span.attributes[HTTP_STATUS_CODE]);
|
|
1644
|
-
}
|
|
1645
|
-
if (span.attributes[HTTP_URL]) {
|
|
1646
|
-
data.url = span.attributes[HTTP_URL];
|
|
1647
|
-
}
|
|
1648
|
-
if (span.attributes[HTTP_ROUTE]) {
|
|
1649
|
-
data.name = `${span.attributes[HTTP_METHOD]} ${span.attributes[HTTP_ROUTE]}`;
|
|
1650
|
-
}
|
|
1651
|
-
else if (span.attributes[HTTP_URL]) {
|
|
1652
|
-
const url$1 = new url.URL(span.attributes[HTTP_URL]);
|
|
1653
|
-
data.name = `${span.attributes[HTTP_METHOD]} ${url$1.pathname}`;
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
if (span.attributes[GRPC_STATUS_CODE]) {
|
|
1657
|
-
data.responseCode = String(span.attributes[GRPC_STATUS_CODE]);
|
|
1658
|
-
}
|
|
1659
|
-
if (span.attributes[GRPC_METHOD]) {
|
|
1660
|
-
data.url = String(span.attributes[GRPC_METHOD]);
|
|
1661
|
-
}
|
|
1662
|
-
return data;
|
|
1663
|
-
}
|
|
1664
|
-
function createInProcData(span) {
|
|
1665
|
-
const data = createDependencyData(span);
|
|
1666
|
-
data.type = INPROC;
|
|
1667
|
-
data.success = true;
|
|
1668
|
-
return data;
|
|
1669
|
-
}
|
|
1670
|
-
function readableSpanToEnvelope(span, ikey, logger) {
|
|
1671
|
-
let name;
|
|
1672
|
-
let baseType;
|
|
1673
|
-
const sampleRate = 100;
|
|
1674
|
-
let baseData;
|
|
1675
|
-
const time = new Date(core.hrTimeToMilliseconds(span.startTime));
|
|
1676
|
-
const instrumentationKey = ikey;
|
|
1677
|
-
const tags = createTagsFromSpan(span);
|
|
1678
|
-
const [properties, measurements] = createPropertiesFromSpan(span);
|
|
1679
|
-
switch (span.kind) {
|
|
1680
|
-
case api.SpanKind.CLIENT:
|
|
1681
|
-
case api.SpanKind.PRODUCER:
|
|
1682
|
-
name = "Microsoft.ApplicationInsights.RemoteDependency";
|
|
1683
|
-
baseType = "RemoteDependencyData";
|
|
1684
|
-
baseData = createDependencyData(span);
|
|
1685
|
-
break;
|
|
1686
|
-
case api.SpanKind.SERVER:
|
|
1687
|
-
case api.SpanKind.CONSUMER:
|
|
1688
|
-
name = "Microsoft.ApplicationInsights.Request";
|
|
1689
|
-
baseType = "RequestData";
|
|
1690
|
-
baseData = createRequestData(span);
|
|
1691
|
-
break;
|
|
1692
|
-
case api.SpanKind.INTERNAL:
|
|
1693
|
-
baseType = "RemoteDependencyData";
|
|
1694
|
-
name = "Microsoft.ApplicationInsights.RemoteDependency";
|
|
1695
|
-
baseData = createInProcData(span);
|
|
1696
|
-
break;
|
|
1697
|
-
default:
|
|
1698
|
-
// never
|
|
1699
|
-
if (logger) {
|
|
1700
|
-
logger.error(`Unsupported span kind ${span.kind}`);
|
|
1701
|
-
}
|
|
1702
|
-
throw new Error(`Unsupported span kind ${span.kind}`);
|
|
1703
|
-
}
|
|
1704
|
-
if (span.attributes[AzNamespace] === MicrosoftEventHub) {
|
|
1705
|
-
parseEventHubSpan(span, baseData);
|
|
1706
|
-
}
|
|
1707
|
-
else if (span.attributes[AzNamespace]) {
|
|
1708
|
-
switch (span.kind) {
|
|
1709
|
-
case api.SpanKind.INTERNAL:
|
|
1710
|
-
baseData.type = `${INPROC} | ${span.attributes[AzNamespace]}`;
|
|
1711
|
-
break;
|
|
1712
|
-
}
|
|
1713
|
-
}
|
|
1714
|
-
return {
|
|
1715
|
-
name,
|
|
1716
|
-
sampleRate,
|
|
1717
|
-
time,
|
|
1718
|
-
instrumentationKey,
|
|
1719
|
-
tags,
|
|
1720
|
-
version: 1,
|
|
1721
|
-
data: {
|
|
1722
|
-
baseType,
|
|
1723
|
-
baseData: Object.assign(Object.assign({}, baseData), { properties,
|
|
1724
|
-
measurements })
|
|
1725
|
-
}
|
|
1726
|
-
};
|
|
1727
|
-
}
|
|
1728
|
-
|
|
1729
|
-
// Copyright (c) Microsoft Corporation.
|
|
1730
|
-
class AzureMonitorTraceExporter {
|
|
1731
|
-
constructor(options = {}) {
|
|
1732
|
-
var _a, _b, _c, _d;
|
|
1733
|
-
const connectionString = options.connectionString || process.env[ENV_CONNECTION_STRING];
|
|
1734
|
-
this._logger = new core.ConsoleLogger(core.LogLevel.ERROR);
|
|
1735
|
-
this._options = Object.assign({}, DEFAULT_EXPORTER_CONFIG);
|
|
1736
|
-
this._options.serviceApiVersion = (_a = options.serviceApiVersion) !== null && _a !== void 0 ? _a : this._options.serviceApiVersion;
|
|
1737
|
-
if (connectionString) {
|
|
1738
|
-
const parsedConnectionString = ConnectionStringParser.parse(connectionString, this._logger);
|
|
1739
|
-
this._options.instrumentationKey = (_b = parsedConnectionString.instrumentationkey) !== null && _b !== void 0 ? _b : this._options.instrumentationKey;
|
|
1740
|
-
this._options.endpointUrl = (_d = (_c = parsedConnectionString.ingestionendpoint) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : this._options.endpointUrl;
|
|
1741
|
-
}
|
|
1742
|
-
// Instrumentation key is required
|
|
1743
|
-
if (!this._options.instrumentationKey) {
|
|
1744
|
-
const message = "No instrumentation key or connection string was provided to the Azure Monitor Exporter";
|
|
1745
|
-
this._logger.error(message);
|
|
1746
|
-
throw new Error(message);
|
|
1747
|
-
}
|
|
1748
|
-
this._sender = new HttpSender(this._options);
|
|
1749
|
-
this._persister = new FileSystemPersist(this._options);
|
|
1750
|
-
this._retryTimer = null;
|
|
1751
|
-
this._logger.debug("AzureMonitorTraceExporter was successfully setup");
|
|
1752
|
-
}
|
|
1753
|
-
_persist(envelopes) {
|
|
1754
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1755
|
-
try {
|
|
1756
|
-
const success = yield this._persister.push(envelopes);
|
|
1757
|
-
return success
|
|
1758
|
-
? { code: core.ExportResultCode.SUCCESS }
|
|
1759
|
-
: {
|
|
1760
|
-
code: core.ExportResultCode.FAILED,
|
|
1761
|
-
error: new Error("Failed to persist envelope in disk.")
|
|
1762
|
-
};
|
|
1763
|
-
}
|
|
1764
|
-
catch (ex) {
|
|
1765
|
-
return { code: core.ExportResultCode.FAILED, error: ex };
|
|
1766
|
-
}
|
|
1767
|
-
});
|
|
1768
|
-
}
|
|
1769
|
-
exportEnvelopes(envelopes) {
|
|
1770
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1771
|
-
this._logger.info(`Exporting ${envelopes.length} envelope(s)`);
|
|
1772
|
-
try {
|
|
1773
|
-
const { result, statusCode } = yield this._sender.send(envelopes);
|
|
1774
|
-
if (statusCode === 200) {
|
|
1775
|
-
// Success -- @todo: start retry timer
|
|
1776
|
-
if (!this._retryTimer) {
|
|
1777
|
-
this._retryTimer = setTimeout(() => {
|
|
1778
|
-
this._retryTimer = null;
|
|
1779
|
-
this._sendFirstPersistedFile();
|
|
1780
|
-
}, this._options.batchSendRetryIntervalMs);
|
|
1781
|
-
this._retryTimer.unref();
|
|
1782
|
-
}
|
|
1783
|
-
return { code: core.ExportResultCode.SUCCESS };
|
|
1784
|
-
}
|
|
1785
|
-
else if (statusCode && isRetriable(statusCode)) {
|
|
1786
|
-
// Failed -- persist failed data
|
|
1787
|
-
if (result) {
|
|
1788
|
-
this._logger.info(result);
|
|
1789
|
-
const breezeResponse = JSON.parse(result);
|
|
1790
|
-
const filteredEnvelopes = breezeResponse.errors.reduce((acc, v) => [...acc, envelopes[v.index]], []);
|
|
1791
|
-
// calls resultCallback(ExportResult) based on result of persister.push
|
|
1792
|
-
return yield this._persist(filteredEnvelopes);
|
|
1793
|
-
}
|
|
1794
|
-
else {
|
|
1795
|
-
// calls resultCallback(ExportResult) based on result of persister.push
|
|
1796
|
-
return yield this._persist(envelopes);
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
else {
|
|
1800
|
-
// Failed -- not retriable
|
|
1801
|
-
return {
|
|
1802
|
-
code: core.ExportResultCode.FAILED
|
|
1803
|
-
};
|
|
1804
|
-
}
|
|
1805
|
-
}
|
|
1806
|
-
catch (senderErr) {
|
|
1807
|
-
if (this._isNetworkError(senderErr)) {
|
|
1808
|
-
this._logger.error("Retrying due to transient client side error. Error message:", senderErr.message);
|
|
1809
|
-
return yield this._persist(envelopes);
|
|
1810
|
-
}
|
|
1811
|
-
else {
|
|
1812
|
-
this._logger.error("Envelopes could not be exported and are not retriable. Error message:", senderErr.message);
|
|
1813
|
-
return { code: core.ExportResultCode.FAILED, error: senderErr };
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
});
|
|
1817
|
-
}
|
|
1818
|
-
export(spans, resultCallback) {
|
|
1819
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1820
|
-
this._logger.info(`Exporting ${spans.length} span(s). Converting to envelopes...`);
|
|
1821
|
-
const envelopes = spans.map((span) => readableSpanToEnvelope(span, this._options.instrumentationKey, this._logger));
|
|
1822
|
-
resultCallback(yield this.exportEnvelopes(envelopes));
|
|
1823
|
-
});
|
|
1824
|
-
}
|
|
1825
|
-
shutdown() {
|
|
1826
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1827
|
-
this._logger.info("Azure Monitor Trace Exporter shutting down");
|
|
1828
|
-
return this._sender.shutdown();
|
|
1829
|
-
});
|
|
1830
|
-
}
|
|
1831
|
-
_sendFirstPersistedFile() {
|
|
1832
|
-
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
1833
|
-
try {
|
|
1834
|
-
const envelopes = (yield this._persister.shift());
|
|
1835
|
-
if (envelopes) {
|
|
1836
|
-
yield this._sender.send(envelopes);
|
|
1837
|
-
}
|
|
1838
|
-
}
|
|
1839
|
-
catch (err) {
|
|
1840
|
-
this._logger.warn(`Failed to fetch persisted file`, err);
|
|
1841
|
-
}
|
|
1842
|
-
});
|
|
1843
|
-
}
|
|
1844
|
-
_isNetworkError(error) {
|
|
1845
|
-
if (error instanceof coreHttp.RestError) {
|
|
1846
|
-
if (error && error.code && error.code === "REQUEST_SEND_ERROR") {
|
|
1847
|
-
return true;
|
|
1848
|
-
}
|
|
1849
|
-
}
|
|
1850
|
-
return false;
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
exports.AzureMonitorTraceExporter = AzureMonitorTraceExporter;
|
|
1855
|
-
//# sourceMappingURL=index.js.map
|