@azure/monitor-opentelemetry-exporter 1.0.0-beta.35 → 1.0.0-beta.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/commonjs/Declarations/Constants.d.ts +10 -0
  2. package/dist/commonjs/Declarations/Constants.d.ts.map +1 -1
  3. package/dist/commonjs/Declarations/Constants.js +11 -1
  4. package/dist/commonjs/Declarations/Constants.js.map +1 -1
  5. package/dist/commonjs/Declarations/Contracts/Constants.d.ts +1 -1
  6. package/dist/commonjs/Declarations/Contracts/Constants.d.ts.map +1 -1
  7. package/dist/commonjs/Declarations/Contracts/Constants.js.map +1 -1
  8. package/dist/commonjs/export/metric.d.ts.map +1 -1
  9. package/dist/commonjs/export/metric.js +1 -1
  10. package/dist/commonjs/export/metric.js.map +1 -1
  11. package/dist/commonjs/export/statsbeat/customerSDKStats.d.ts +2 -2
  12. package/dist/commonjs/export/statsbeat/customerSDKStats.d.ts.map +1 -1
  13. package/dist/commonjs/export/statsbeat/customerSDKStats.js +11 -9
  14. package/dist/commonjs/export/statsbeat/customerSDKStats.js.map +1 -1
  15. package/dist/commonjs/export/statsbeat/statsbeatExporter.d.ts +5 -0
  16. package/dist/commonjs/export/statsbeat/statsbeatExporter.d.ts.map +1 -1
  17. package/dist/commonjs/export/statsbeat/statsbeatExporter.js +19 -5
  18. package/dist/commonjs/export/statsbeat/statsbeatExporter.js.map +1 -1
  19. package/dist/commonjs/export/statsbeat/statsbeatMetrics.d.ts.map +1 -1
  20. package/dist/commonjs/export/statsbeat/statsbeatMetrics.js +3 -2
  21. package/dist/commonjs/export/statsbeat/statsbeatMetrics.js.map +1 -1
  22. package/dist/commonjs/export/trace.d.ts +1 -0
  23. package/dist/commonjs/export/trace.d.ts.map +1 -1
  24. package/dist/commonjs/export/trace.js +9 -1
  25. package/dist/commonjs/export/trace.js.map +1 -1
  26. package/dist/commonjs/generated/applicationInsightsClient.js +1 -1
  27. package/dist/commonjs/generated/applicationInsightsClient.js.map +1 -1
  28. package/dist/commonjs/generated/models/index.d.ts.map +1 -1
  29. package/dist/commonjs/generated/models/index.js.map +1 -1
  30. package/dist/commonjs/generated/models/mappers.js +11 -11
  31. package/dist/commonjs/generated/models/mappers.js.map +1 -1
  32. package/dist/commonjs/platform/nodejs/baseSender.d.ts +1 -0
  33. package/dist/commonjs/platform/nodejs/baseSender.d.ts.map +1 -1
  34. package/dist/commonjs/platform/nodejs/baseSender.js +35 -16
  35. package/dist/commonjs/platform/nodejs/baseSender.js.map +1 -1
  36. package/dist/commonjs/platform/nodejs/persist/fileSystemPersist.d.ts +15 -0
  37. package/dist/commonjs/platform/nodejs/persist/fileSystemPersist.d.ts.map +1 -1
  38. package/dist/commonjs/platform/nodejs/persist/fileSystemPersist.js +65 -2
  39. package/dist/commonjs/platform/nodejs/persist/fileSystemPersist.js.map +1 -1
  40. package/dist/commonjs/tsdoc-metadata.json +1 -1
  41. package/dist/commonjs/utils/common.d.ts +2 -2
  42. package/dist/commonjs/utils/common.d.ts.map +1 -1
  43. package/dist/commonjs/utils/common.js +16 -11
  44. package/dist/commonjs/utils/common.js.map +1 -1
  45. package/dist/commonjs/utils/constants/applicationinsights.d.ts +1 -1
  46. package/dist/commonjs/utils/constants/applicationinsights.js +1 -1
  47. package/dist/commonjs/utils/constants/applicationinsights.js.map +1 -1
  48. package/dist/commonjs/utils/logUtils.js +2 -2
  49. package/dist/commonjs/utils/logUtils.js.map +1 -1
  50. package/dist/esm/Declarations/Constants.d.ts +10 -0
  51. package/dist/esm/Declarations/Constants.d.ts.map +1 -1
  52. package/dist/esm/Declarations/Constants.js +10 -0
  53. package/dist/esm/Declarations/Constants.js.map +1 -1
  54. package/dist/esm/Declarations/Contracts/Constants.d.ts +1 -1
  55. package/dist/esm/Declarations/Contracts/Constants.d.ts.map +1 -1
  56. package/dist/esm/Declarations/Contracts/Constants.js.map +1 -1
  57. package/dist/esm/export/metric.d.ts.map +1 -1
  58. package/dist/esm/export/metric.js +1 -1
  59. package/dist/esm/export/metric.js.map +1 -1
  60. package/dist/esm/export/statsbeat/customerSDKStats.d.ts +2 -2
  61. package/dist/esm/export/statsbeat/customerSDKStats.d.ts.map +1 -1
  62. package/dist/esm/export/statsbeat/customerSDKStats.js +11 -9
  63. package/dist/esm/export/statsbeat/customerSDKStats.js.map +1 -1
  64. package/dist/esm/export/statsbeat/statsbeatExporter.d.ts +5 -0
  65. package/dist/esm/export/statsbeat/statsbeatExporter.d.ts.map +1 -1
  66. package/dist/esm/export/statsbeat/statsbeatExporter.js +19 -5
  67. package/dist/esm/export/statsbeat/statsbeatExporter.js.map +1 -1
  68. package/dist/esm/export/statsbeat/statsbeatMetrics.d.ts.map +1 -1
  69. package/dist/esm/export/statsbeat/statsbeatMetrics.js +3 -2
  70. package/dist/esm/export/statsbeat/statsbeatMetrics.js.map +1 -1
  71. package/dist/esm/export/trace.d.ts +1 -0
  72. package/dist/esm/export/trace.d.ts.map +1 -1
  73. package/dist/esm/export/trace.js +9 -1
  74. package/dist/esm/export/trace.js.map +1 -1
  75. package/dist/esm/generated/applicationInsightsClient.js +1 -1
  76. package/dist/esm/generated/applicationInsightsClient.js.map +1 -1
  77. package/dist/esm/generated/models/index.d.ts.map +1 -1
  78. package/dist/esm/generated/models/index.js.map +1 -1
  79. package/dist/esm/generated/models/mappers.js +11 -11
  80. package/dist/esm/generated/models/mappers.js.map +1 -1
  81. package/dist/esm/platform/nodejs/baseSender.d.ts +1 -0
  82. package/dist/esm/platform/nodejs/baseSender.d.ts.map +1 -1
  83. package/dist/esm/platform/nodejs/baseSender.js +36 -17
  84. package/dist/esm/platform/nodejs/baseSender.js.map +1 -1
  85. package/dist/esm/platform/nodejs/persist/fileSystemPersist.d.ts +15 -0
  86. package/dist/esm/platform/nodejs/persist/fileSystemPersist.d.ts.map +1 -1
  87. package/dist/esm/platform/nodejs/persist/fileSystemPersist.js +66 -4
  88. package/dist/esm/platform/nodejs/persist/fileSystemPersist.js.map +1 -1
  89. package/dist/esm/utils/common.d.ts +2 -2
  90. package/dist/esm/utils/common.d.ts.map +1 -1
  91. package/dist/esm/utils/common.js +17 -12
  92. package/dist/esm/utils/common.js.map +1 -1
  93. package/dist/esm/utils/constants/applicationinsights.d.ts +1 -1
  94. package/dist/esm/utils/constants/applicationinsights.js +1 -1
  95. package/dist/esm/utils/constants/applicationinsights.js.map +1 -1
  96. package/dist/esm/utils/logUtils.js +2 -2
  97. package/dist/esm/utils/logUtils.js.map +1 -1
  98. package/package.json +18 -14
@@ -1 +1 @@
1
- {"version":3,"file":"customerSDKStats.js","sourceRoot":"","sources":["../../../../src/export/statsbeat/customerSDKStats.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE1F,OAAO,KAAK,EAAE,MAAM,8CAA8C,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAI/D;;;;;;GAMG;AACH,MAAM,OAAO,uBAAwB,SAAQ,gBAAgB;IACnD,MAAM,CAAC,SAAS,CAAsC;IAEtD,uBAAuB,GAAW,MAAM,CAAC,CAAC,aAAa;IACvD,qBAAqB,CAAQ;IAC7B,6BAA6B,CAAgB;IAC7C,wBAAwB,CAAgC;IACxD,uBAAu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IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,IAAI,iBAAiB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAClE,OAAO,IAAI,CAAC;QACd,CAAC;QAED,oEAAoE;QACpE,IAAI,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;YAC3B,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAC;YACrE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YACjD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC3E,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BatchObservableResult, Meter, ObservableGauge } from \"@opentelemetry/api\";\nimport { diag } from \"@opentelemetry/api\";\nimport type { PeriodicExportingMetricReaderOptions } from \"@opentelemetry/sdk-metrics\";\nimport { MeterProvider, PeriodicExportingMetricReader } from \"@opentelemetry/sdk-metrics\";\nimport type { AzureMonitorExporterOptions } from \"../../index.js\";\nimport * as ai from \"../../utils/constants/applicationinsights.js\";\nimport { StatsbeatMetrics } from \"./statsbeatMetrics.js\";\nimport type { CustomerSDKStatsProperties, StatsbeatOptions } from \"./types.js\";\nimport {\n CustomerSDKStats,\n DropCode,\n RetryCode,\n ExceptionType,\n DropReason,\n RetryReason,\n} from \"./types.js\";\nimport { CustomSDKStatsCounter, STATSBEAT_LANGUAGE, TelemetryType } from \"./types.js\";\nimport { getAttachType } from \"../../utils/metricUtils.js\";\nimport { AzureMonitorStatsbeatExporter } from \"./statsbeatExporter.js\";\nimport { BreezePerformanceCounterNames } from \"../../types.js\";\nimport type { MetricsData, RemoteDependencyData, RequestData } from \"../../generated/index.js\";\nimport type { TelemetryItem as Envelope } from \"../../generated/index.js\";\n\n/**\n * Class that handles customer-facing SDK Stats metrics\n * These metrics are sent to the customer's breeze endpoint\n *\n * Implements a singleton pattern to ensure only one set of customer SDK Stats metrics\n * is exported every 15 minutes, regardless of the number of exporters or senders.\n */\nexport class CustomerSDKStatsMetrics extends StatsbeatMetrics {\n private static _instance: CustomerSDKStatsMetrics | undefined;\n\n private statsCollectionInterval: number = 900000; // 15 minutes\n private customerSDKStatsMeter: Meter;\n private customerSDKStatsMeterProvider: MeterProvider;\n private customerSDKStatsExporter: AzureMonitorStatsbeatExporter;\n private customerSDKStatsCounter: CustomerSDKStats;\n private customerSDKStatsMetricReader: PeriodicExportingMetricReader;\n private isInitialized: boolean = false;\n\n // Custom dimensions\n private language: string;\n private version: string;\n private attach: string = getAttachType();\n\n // Observable Gauges\n private itemSuccessCountGauge: ObservableGauge;\n private itemDropCountGauge: ObservableGauge;\n private itemRetryCountGauge: ObservableGauge;\n\n // Customer SDK Stats properties\n private customerProperties: CustomerSDKStatsProperties;\n\n private constructor(options: StatsbeatOptions) {\n super();\n const exporterConfig: AzureMonitorExporterOptions = {\n connectionString: `InstrumentationKey=${options.instrumentationKey};IngestionEndpoint=${options.endpointUrl}`,\n };\n\n this.customerSDKStatsExporter = new AzureMonitorStatsbeatExporter(exporterConfig);\n // Exports Customer SDK Stats every 15 minutes\n const customerMetricReaderOptions: PeriodicExportingMetricReaderOptions = {\n exporter: this.customerSDKStatsExporter,\n exportIntervalMillis: options.networkCollectionInterval || this.statsCollectionInterval,\n };\n this.customerSDKStatsMetricReader = new PeriodicExportingMetricReader(\n customerMetricReaderOptions,\n );\n this.customerSDKStatsMeterProvider = new MeterProvider({\n readers: [this.customerSDKStatsMetricReader],\n });\n\n this.customerSDKStatsMeter = this.customerSDKStatsMeterProvider.getMeter(\n \"Azure Monitor Customer SDK Stats\",\n );\n\n this.language = STATSBEAT_LANGUAGE;\n this.version = ai.packageVersion;\n\n this.itemSuccessCountGauge = this.customerSDKStatsMeter.createObservableGauge(\n CustomSDKStatsCounter.ITEM_SUCCESS_COUNT,\n );\n this.itemDropCountGauge = this.customerSDKStatsMeter.createObservableGauge(\n CustomSDKStatsCounter.ITEM_DROP_COUNT,\n );\n this.itemRetryCountGauge = this.customerSDKStatsMeter.createObservableGauge(\n CustomSDKStatsCounter.ITEM_RETRY_COUNT,\n );\n\n if (!this.isInitialized) {\n this.initialize();\n }\n this.isInitialized = true;\n\n // Initialize the single customer SDK Stats counter\n this.customerSDKStatsCounter = new CustomerSDKStats();\n\n this.customerProperties = {\n language: this.language,\n version: this.version,\n computeType: this.attach,\n };\n }\n\n /**\n * Get singleton instance of CustomerSDKStatsMetrics\n * @param options - Configuration options for customer SDK Stats metrics\n * @returns The singleton instance\n */\n public static getInstance(options: StatsbeatOptions): CustomerSDKStatsMetrics {\n if (!CustomerSDKStatsMetrics._instance) {\n CustomerSDKStatsMetrics._instance = new CustomerSDKStatsMetrics(options);\n }\n return CustomerSDKStatsMetrics._instance;\n }\n\n /**\n * Shutdown the singleton instance\n * Used for cleanup and complete shutdown\n */\n public static shutdown(): Promise<void> | undefined {\n if (CustomerSDKStatsMetrics._instance) {\n const shutdownPromise = CustomerSDKStatsMetrics._instance.shutdown();\n CustomerSDKStatsMetrics._instance = undefined;\n return shutdownPromise;\n }\n return undefined;\n }\n\n /**\n * Shuts down the customer SDK Stats metrics provider\n * @returns Promise<void>\n */\n public shutdown(): Promise<void> {\n return this.customerSDKStatsMeterProvider.shutdown();\n }\n\n /**\n * Initializes the customer SDK Stats metrics\n * Sets up the resource provider and adds observable callbacks for each metric\n * @returns Promise<void>\n */\n private async initialize(): Promise<void> {\n try {\n await super.getResourceProvider();\n this.customerSDKStatsMeter.addBatchObservableCallback(this.itemSuccessCallback.bind(this), [\n this.itemSuccessCountGauge,\n ]);\n this.customerSDKStatsMeter.addBatchObservableCallback(this.itemDropCallback.bind(this), [\n this.itemDropCountGauge,\n ]);\n this.customerSDKStatsMeter.addBatchObservableCallback(this.itemRetryCallback.bind(this), [\n this.itemRetryCountGauge,\n ]);\n } catch (error) {\n diag.debug(\"Call to get the resource provider failed for customer SDK Stats metrics.\");\n }\n }\n\n // Observable gauge callbacks\n private itemSuccessCallback(observableResult: BatchObservableResult): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n const attributes = { ...this.customerProperties, telemetry_type: TelemetryType.UNKNOWN };\n\n // For each { telemetry_type -> count } mapping, call observe, passing the count and attributes that include the telemetry_type\n for (const [telemetry_type, count] of counter.totalItemSuccessCount.entries()) {\n // Only send metrics if count is greater than zero\n if (count > 0) {\n attributes.telemetry_type = telemetry_type;\n observableResult.observe(this.itemSuccessCountGauge, count, {\n ...attributes,\n });\n counter.totalItemSuccessCount.set(telemetry_type, 0);\n }\n }\n }\n\n private itemDropCallback(observableResult: BatchObservableResult): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n const baseAttributes: CustomerSDKStatsProperties & {\n \"drop.code\": DropCode | number;\n telemetry_type: TelemetryType;\n } = {\n ...this.customerProperties,\n \"drop.code\": DropCode.UNKNOWN,\n telemetry_type: TelemetryType.UNKNOWN,\n };\n\n // Iterate through the nested Map structure: telemetry_type -> drop.code -> reason -> telemetry_success -> count\n for (const [telemetryType, dropCodeMap] of counter.totalItemDropCount.entries()) {\n for (const [dropCode, reasonMap] of dropCodeMap.entries()) {\n for (const [reason, successMap] of reasonMap.entries()) {\n for (const [success, count] of successMap.entries()) {\n const attributes = { ...baseAttributes };\n attributes.telemetry_type = telemetryType;\n attributes[\"drop.code\"] = dropCode;\n\n // Include drop.reason for all cases\n if (reason) {\n (attributes as any)[\"drop.reason\"] = reason;\n }\n\n // Include telemetry_success only for request/dependency telemetry when success is not null\n if (\n (telemetryType === TelemetryType.REQUEST ||\n telemetryType === TelemetryType.DEPENDENCY) &&\n success !== null\n ) {\n (attributes as any)[\"telemetry_success\"] = success;\n }\n\n // Only send metrics if count is greater than zero\n if (count > 0) {\n observableResult.observe(this.itemDropCountGauge, count, {\n ...attributes,\n });\n }\n\n // Reset the count to 0\n successMap.set(success, 0);\n }\n }\n }\n }\n }\n\n private itemRetryCallback(observableResult: BatchObservableResult): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n const baseAttributes: CustomerSDKStatsProperties & {\n \"retry.code\": RetryCode | number;\n telemetry_type: TelemetryType;\n } = {\n ...this.customerProperties,\n \"retry.code\": RetryCode.UNKNOWN,\n telemetry_type: TelemetryType.UNKNOWN,\n };\n\n // Iterate through the nested Map structure: telemetry_type -> retry.code -> reason -> count\n for (const [telemetryType, retryCodeMap] of counter.totalItemRetryCount.entries()) {\n for (const [retryCode, reasonMap] of retryCodeMap.entries()) {\n for (const [reason, count] of reasonMap.entries()) {\n const attributes = { ...baseAttributes };\n attributes.telemetry_type = telemetryType;\n attributes[\"retry.code\"] = retryCode;\n\n // Include retry.reason for all cases\n if (reason) {\n (attributes as any)[\"retry.reason\"] = reason;\n }\n\n // Only send metrics if count is greater than zero\n if (count > 0) {\n observableResult.observe(this.itemRetryCountGauge, count, {\n ...attributes,\n });\n }\n\n // Reset the count to 0\n reasonMap.set(reason, 0);\n }\n }\n }\n }\n\n // Public methods to track metrics\n /**\n * Tracks succcessful items\n * @param envelopes - Number of successful envelopes\n * @param telemetry_type - The type of telemetry being tracked\n */\n public countSuccessfulItems(envelopes: Envelope[]): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n let telemetry_type: TelemetryType;\n\n // Get the current count for this telemetry type, or 0 if it doesn't exist\n for (const envelope of envelopes) {\n telemetry_type = this.getTelemetryTypeFromEnvelope(envelope);\n const currentCount = counter.totalItemSuccessCount.get(telemetry_type) || 0;\n counter.totalItemSuccessCount.set(telemetry_type, currentCount + 1);\n }\n }\n\n /**\n * Tracks dropped items\n * @param envelopes - Array of envelopes dropped\n * @param dropCode - The drop code indicating the reason for drop\n * @param exceptionMessage - Optional exception message when dropCode is CLIENT_EXCEPTION\n * @param exceptionType - Optional explicit exception type override when dropCode is CLIENT_EXCEPTION\n */\n public countDroppedItems(\n envelopes: Envelope[],\n dropCode: DropCode | number,\n exceptionMessage?: string,\n exceptionType?: ExceptionType,\n ): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n let telemetry_type: TelemetryType;\n\n for (const envelope of envelopes) {\n telemetry_type = this.getTelemetryTypeFromEnvelope(envelope);\n\n let dropCodeMap = counter.totalItemDropCount.get(telemetry_type);\n if (!dropCodeMap) {\n dropCodeMap = new Map<DropCode | number, Map<string, Map<boolean | null, number>>>();\n counter.totalItemDropCount.set(telemetry_type, dropCodeMap);\n }\n\n // Get or create the reason map for this dropCode\n let reasonMap = dropCodeMap.get(dropCode);\n if (!reasonMap) {\n reasonMap = new Map<string, Map<boolean | null, number>>();\n dropCodeMap.set(dropCode, reasonMap);\n }\n\n // Generate a low-cardinality, informative reason description\n const reason = this.getDropReason(dropCode, exceptionMessage, exceptionType);\n\n // Get or create the success map for this reason\n let successMap = reasonMap.get(reason);\n if (!successMap) {\n successMap = new Map<boolean | null, number>();\n reasonMap.set(reason, successMap);\n }\n\n // For non-request/dependency telemetry or when success is not provided, use null as the success key\n const individualTelemetrySuccess = this.getTelemetrySuccessFromEnvelope(envelope);\n const successKey =\n (telemetry_type === TelemetryType.REQUEST || telemetry_type === TelemetryType.DEPENDENCY) &&\n individualTelemetrySuccess !== undefined\n ? individualTelemetrySuccess\n : null;\n\n // Update the count for this reason and success combination\n const currentCount = successMap.get(successKey) || 0;\n successMap.set(successKey, currentCount + 1);\n }\n }\n\n /**\n * Generates a low-cardinality, informative description for drop reasons\n * @param dropCode - The drop code (enum value or status code number)\n * @param exceptionMessage - Optional exception message for CLIENT_EXCEPTION\n * @param exceptionType - Optional explicit exception type override for CLIENT_EXCEPTION\n * @returns A descriptive reason string with low cardinality\n */\n private getDropReason(\n dropCode: DropCode | number,\n exceptionMessage?: string,\n exceptionType?: ExceptionType,\n ): string {\n if (dropCode === DropCode.CLIENT_EXCEPTION) {\n // If an explicit exception type is provided, use it\n if (exceptionType) {\n return exceptionType;\n }\n // For client exceptions, derive a well-known exception category from the exception message\n if (exceptionMessage) {\n return this.categorizeExceptionMessage(exceptionMessage);\n }\n return ExceptionType.CLIENT_EXCEPTION; // Default to \"Client exception\" if no message provided\n }\n\n // Handle status code drop codes (numeric values)\n if (typeof dropCode === \"number\") {\n return this.categorizeStatusCode(dropCode);\n }\n\n // Handle other enum drop codes\n switch (dropCode) {\n case DropCode.CLIENT_READONLY:\n return DropReason.CLIENT_READONLY;\n case DropCode.CLIENT_PERSISTENCE_CAPACITY:\n return DropReason.CLIENT_PERSISTENCE_CAPACITY;\n case DropCode.CLIENT_STORAGE_DISABLED:\n return DropReason.CLIENT_STORAGE_DISABLED;\n case DropCode.UNKNOWN:\n default:\n return DropReason.UNKNOWN;\n }\n }\n\n /**\n * Categorizes exception messages into well-known exception categories\n * @param exceptionMessage - The exception message to categorize\n * @returns A well-known exception category string\n */\n private categorizeExceptionMessage(exceptionMessage: string): ExceptionType {\n const message = exceptionMessage.toLowerCase();\n\n if (message.includes(\"timeout\") || message.includes(\"timed out\")) {\n return ExceptionType.TIMEOUT_EXCEPTION;\n }\n if (\n message.includes(\"network\") ||\n message.includes(\"connection\") ||\n message.includes(\"dns\") ||\n message.includes(\"socket\")\n ) {\n return ExceptionType.NETWORK_EXCEPTION;\n }\n if (\n message.includes(\"disk\") ||\n message.includes(\"storage\") ||\n message.includes(\"file\") ||\n message.includes(\"persist\")\n ) {\n return ExceptionType.STORAGE_EXCEPTION;\n }\n\n // Default to Client exception for any other cases\n return ExceptionType.CLIENT_EXCEPTION;\n }\n\n /**\n * Categorizes HTTP status codes into informative descriptions\n * @param statusCode - The HTTP status code\n * @returns A descriptive category string\n */\n private categorizeStatusCode(statusCode: number): string {\n if (statusCode >= 400 && statusCode < 500) {\n switch (statusCode) {\n case 400:\n return \"Bad request\";\n case 401:\n return \"Unauthorized\";\n case 403:\n return \"Forbidden\";\n case 404:\n return \"Not found\";\n case 408:\n return \"Request timeout\";\n case 413:\n return \"Payload too large\";\n case 429:\n return \"Too many requests\";\n default:\n return \"Client error 4xx\";\n }\n }\n\n if (statusCode >= 500 && statusCode < 600) {\n switch (statusCode) {\n case 500:\n return \"Internal server error\";\n case 502:\n return \"Bad gateway\";\n case 503:\n return \"Service unavailable\";\n case 504:\n return \"Gateway timeout\";\n default:\n return \"Server error 5xx\";\n }\n }\n\n return `status_${statusCode}`;\n }\n /**\n * Tracks retried envelopes\n * @param envelopes - Number of envelopes retried\n * @param retryCode - The retry code indicating the reason for retry\n * @param exceptionMessage - Optional exception message when retryCode is CLIENT_EXCEPTION\n * @param exceptionType - Optional explicit exception type override when retryCode is CLIENT_EXCEPTION\n */\n public countRetryItems(\n envelopes: Envelope[],\n retryCode: RetryCode | number,\n exceptionMessage?: string,\n exceptionType?: ExceptionType,\n ): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n let telemetry_type: TelemetryType;\n\n for (const envelope of envelopes) {\n telemetry_type = this.getTelemetryTypeFromEnvelope(envelope);\n // Get or create the retryCode map for this telemetry_type\n let retryCodeMap = counter.totalItemRetryCount.get(telemetry_type);\n if (!retryCodeMap) {\n retryCodeMap = new Map<RetryCode | number, Map<string, number>>();\n counter.totalItemRetryCount.set(telemetry_type, retryCodeMap);\n }\n\n // Get or create the reason map for this retryCode\n let reasonMap = retryCodeMap.get(retryCode);\n if (!reasonMap) {\n reasonMap = new Map<string, number>();\n retryCodeMap.set(retryCode, reasonMap);\n }\n\n // Generate a low-cardinality, informative reason description\n const reason = this.getRetryReason(retryCode, exceptionMessage, exceptionType);\n\n // Update the count for this reason\n const currentCount = reasonMap.get(reason) || 0;\n reasonMap.set(reason, currentCount + 1);\n }\n }\n\n /**\n * Generates a low-cardinality, informative description for retry reasons\n * @param retryCode - The retry code (enum value or status code number)\n * @param exceptionMessage - Optional exception message for CLIENT_EXCEPTION\n * @param exceptionType - Optional explicit exception type override for CLIENT_EXCEPTION\n * @returns A descriptive reason string with low cardinality\n */\n private getRetryReason(\n retryCode: RetryCode | number,\n exceptionMessage?: string,\n exceptionType?: ExceptionType,\n ): string {\n if (retryCode === RetryCode.CLIENT_EXCEPTION) {\n // If an explicit exception type is provided, use it\n if (exceptionType) {\n return exceptionType;\n }\n // For client exceptions, derive a low-cardinality reason from the exception message\n if (exceptionMessage) {\n return this.categorizeExceptionMessage(exceptionMessage);\n }\n return ExceptionType.CLIENT_EXCEPTION;\n }\n\n // Handle status code retry codes (numeric values)\n if (typeof retryCode === \"number\") {\n return this.categorizeStatusCode(retryCode);\n }\n\n // Handle other enum retry codes\n switch (retryCode) {\n case RetryCode.CLIENT_TIMEOUT:\n return RetryReason.CLIENT_TIMEOUT;\n case RetryCode.UNKNOWN:\n default:\n return RetryReason.UNKNOWN;\n }\n }\n\n /**\n * Check if a metric name corresponds to a performance counter\n * @param metricName - The name of the metric to check\n * @returns true if the metric name is a performance counter, false otherwise\n */\n private isPerformanceCounterMetric(metricName: string): boolean {\n return Object.values(BreezePerformanceCounterNames).includes(\n metricName as BreezePerformanceCounterNames,\n );\n }\n\n /**\n * Extract telemetry type from an envelope based on its baseType\n * @param envelope - The envelope to extract telemetry type from\n * @returns The corresponding telemetry type\n */\n public getTelemetryTypeFromEnvelope(envelope: Envelope): TelemetryType {\n if (envelope.data && envelope.data.baseType) {\n switch (envelope.data.baseType) {\n case \"MessageData\":\n return TelemetryType.TRACE;\n case \"AvailabilityData\":\n return TelemetryType.AVAILABILITY;\n case \"TelemetryEventData\":\n return TelemetryType.CUSTOM_EVENT;\n case \"TelemetryExceptionData\":\n return TelemetryType.EXCEPTION;\n case \"PageViewData\":\n return TelemetryType.PAGE_VIEW;\n case \"RemoteDependencyData\":\n return TelemetryType.DEPENDENCY;\n case \"RequestData\":\n return TelemetryType.REQUEST;\n case \"MetricData\": {\n const metricsData = envelope.data.baseData as MetricsData;\n if (metricsData && metricsData.metrics && metricsData.metrics.length > 0) {\n // Check if any of the metrics are performance counters\n const hasPerformanceCounter = metricsData.metrics.some((metric) =>\n this.isPerformanceCounterMetric(metric.name),\n );\n return hasPerformanceCounter\n ? TelemetryType.PERFORMANCE_COUNTER\n : TelemetryType.CUSTOM_METRIC;\n }\n return TelemetryType.CUSTOM_METRIC;\n }\n default:\n return TelemetryType.UNKNOWN;\n }\n }\n return TelemetryType.UNKNOWN;\n }\n\n /**\n * Extract telemetry success value from an envelope for REQUEST and DEPENDENCY telemetry types\n * @param envelope - The envelope to extract success value from\n * @returns The success value if available, undefined otherwise\n */\n public getTelemetrySuccessFromEnvelope(envelope: Envelope): boolean | undefined {\n if (!envelope.data || !envelope.data.baseData) {\n return undefined;\n }\n\n const baseType = envelope.data.baseType;\n if (baseType === \"RequestData\") {\n const requestData = envelope.data.baseData as RequestData;\n return requestData.success;\n } else if (baseType === \"RemoteDependencyData\") {\n const dependencyData = envelope.data.baseData as RemoteDependencyData;\n return dependencyData.success;\n }\n\n return undefined;\n }\n\n /**\n * Checks if the given error is a timeout-related error\n * @param error - The error to check\n * @returns true if the error is timeout-related, false otherwise\n */\n public isTimeoutError(error: { code?: string; message?: string }): boolean {\n // Check for various timeout error codes that indicate client timeouts\n const timeoutErrorCodes = [\n \"ETIMEDOUT\", // Connection timed out\n \"ESOCKETTIMEDOUT\", // Socket timeout\n \"ECONNRESET\", // Connection reset (often due to timeout)\n \"ENOTFOUND\", // DNS lookup failed/timeout\n ];\n\n if (error && error.code && timeoutErrorCodes.includes(error.code)) {\n return true;\n }\n\n // Also check if the error message contains timeout-related keywords\n if (error && error.message) {\n const timeoutKeywords = [\"timeout\", \"timed out\", \"connection reset\"];\n const errorMessage = error.message.toLowerCase();\n return timeoutKeywords.some((keyword) => errorMessage.includes(keyword));\n }\n\n return false;\n }\n}\n"]}
1
+ {"version":3,"file":"customerSDKStats.js","sourceRoot":"","sources":["../../../../src/export/statsbeat/customerSDKStats.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,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AAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC3E,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { BatchObservableResult, Meter, ObservableGauge } from \"@opentelemetry/api\";\nimport { diag } from \"@opentelemetry/api\";\nimport type { PeriodicExportingMetricReaderOptions } from \"@opentelemetry/sdk-metrics\";\nimport { MeterProvider, PeriodicExportingMetricReader } from \"@opentelemetry/sdk-metrics\";\nimport * as ai from \"../../utils/constants/applicationinsights.js\";\nimport { StatsbeatMetrics } from \"./statsbeatMetrics.js\";\nimport type { AzureMonitorStatsbeatExporter } from \"./statsbeatExporter.js\";\nimport type { CustomerSDKStatsProperties, StatsbeatOptions } from \"./types.js\";\nimport {\n CustomerSDKStats,\n DropCode,\n RetryCode,\n ExceptionType,\n DropReason,\n RetryReason,\n} from \"./types.js\";\nimport { CustomSDKStatsCounter, STATSBEAT_LANGUAGE, TelemetryType } from \"./types.js\";\nimport { getAttachType } from \"../../utils/metricUtils.js\";\nimport { BreezePerformanceCounterNames } from \"../../types.js\";\nimport type { MetricsData, RemoteDependencyData, RequestData } from \"../../generated/index.js\";\nimport type { TelemetryItem as Envelope } from \"../../generated/index.js\";\n\n/**\n * Class that handles customer-facing SDK Stats metrics\n * These metrics are sent to the customer's breeze endpoint\n *\n * Implements a singleton pattern to ensure only one set of customer SDK Stats metrics\n * is exported every 15 minutes, regardless of the number of exporters or senders.\n */\nexport class CustomerSDKStatsMetrics extends StatsbeatMetrics {\n private static _instance: CustomerSDKStatsMetrics | undefined;\n\n private statsCollectionInterval: number = 900000; // 15 minutes\n private customerSDKStatsMeter: Meter;\n private customerSDKStatsMeterProvider: MeterProvider;\n private customerSDKStatsExporter: AzureMonitorStatsbeatExporter;\n private customerSDKStatsCounter: CustomerSDKStats;\n private customerSDKStatsMetricReader: PeriodicExportingMetricReader;\n private isInitialized: boolean = false;\n\n // Custom dimensions\n private language: string;\n private version: string;\n private attach: string = getAttachType();\n\n // Observable Gauges\n private itemSuccessCountGauge: ObservableGauge;\n private itemDropCountGauge: ObservableGauge;\n private itemRetryCountGauge: ObservableGauge;\n\n // Customer SDK Stats properties\n private customerProperties: CustomerSDKStatsProperties;\n\n private constructor(options: StatsbeatOptions, exporter: AzureMonitorStatsbeatExporter) {\n super();\n this.customerSDKStatsExporter = exporter;\n // Exports Customer SDK Stats every 15 minutes\n const customerMetricReaderOptions: PeriodicExportingMetricReaderOptions = {\n exporter: this.customerSDKStatsExporter,\n exportIntervalMillis: options.networkCollectionInterval || this.statsCollectionInterval,\n };\n this.customerSDKStatsMetricReader = new PeriodicExportingMetricReader(\n customerMetricReaderOptions,\n );\n this.customerSDKStatsMeterProvider = new MeterProvider({\n readers: [this.customerSDKStatsMetricReader],\n });\n\n this.customerSDKStatsMeter = this.customerSDKStatsMeterProvider.getMeter(\n \"Azure Monitor Customer SDK Stats\",\n );\n\n this.language = STATSBEAT_LANGUAGE;\n this.version = ai.packageVersion;\n\n this.itemSuccessCountGauge = this.customerSDKStatsMeter.createObservableGauge(\n CustomSDKStatsCounter.ITEM_SUCCESS_COUNT,\n );\n this.itemDropCountGauge = this.customerSDKStatsMeter.createObservableGauge(\n CustomSDKStatsCounter.ITEM_DROP_COUNT,\n );\n this.itemRetryCountGauge = this.customerSDKStatsMeter.createObservableGauge(\n CustomSDKStatsCounter.ITEM_RETRY_COUNT,\n );\n\n if (!this.isInitialized) {\n this.initialize();\n }\n this.isInitialized = true;\n\n // Initialize the single customer SDK Stats counter\n this.customerSDKStatsCounter = new CustomerSDKStats();\n\n this.customerProperties = {\n language: this.language,\n version: this.version,\n computeType: this.attach,\n };\n }\n\n /**\n * Get singleton instance of CustomerSDKStatsMetrics\n * @param options - Configuration options for customer SDK Stats metrics\n * @returns Promise of the singleton instance\n */\n public static async getInstance(options: StatsbeatOptions): Promise<CustomerSDKStatsMetrics> {\n if (!CustomerSDKStatsMetrics._instance) {\n // Use dynamic import to break circular dependency\n const { AzureMonitorStatsbeatExporter } = await import(\"./statsbeatExporter.js\");\n const customerStatsExporterConfig = {\n connectionString: `InstrumentationKey=${options.instrumentationKey};IngestionEndpoint=${options.endpointUrl}`,\n };\n const exporter = new AzureMonitorStatsbeatExporter(customerStatsExporterConfig);\n CustomerSDKStatsMetrics._instance = new CustomerSDKStatsMetrics(options, exporter);\n }\n return CustomerSDKStatsMetrics._instance;\n }\n\n /**\n * Shutdown the singleton instance\n * Used for cleanup and complete shutdown\n */\n public static shutdown(): Promise<void> | undefined {\n if (CustomerSDKStatsMetrics._instance) {\n const shutdownPromise = CustomerSDKStatsMetrics._instance.shutdown();\n CustomerSDKStatsMetrics._instance = undefined;\n return shutdownPromise;\n }\n return undefined;\n }\n\n /**\n * Shuts down the customer SDK Stats metrics provider\n * @returns Promise<void>\n */\n public shutdown(): Promise<void> {\n return this.customerSDKStatsMeterProvider.shutdown();\n }\n\n /**\n * Initializes the customer SDK Stats metrics\n * Sets up the resource provider and adds observable callbacks for each metric\n * @returns Promise<void>\n */\n private async initialize(): Promise<void> {\n try {\n await super.getResourceProvider();\n this.customerSDKStatsMeter.addBatchObservableCallback(this.itemSuccessCallback.bind(this), [\n this.itemSuccessCountGauge,\n ]);\n this.customerSDKStatsMeter.addBatchObservableCallback(this.itemDropCallback.bind(this), [\n this.itemDropCountGauge,\n ]);\n this.customerSDKStatsMeter.addBatchObservableCallback(this.itemRetryCallback.bind(this), [\n this.itemRetryCountGauge,\n ]);\n } catch (error) {\n diag.debug(\"Call to get the resource provider failed for customer SDK Stats metrics.\");\n }\n }\n\n // Observable gauge callbacks\n private itemSuccessCallback(observableResult: BatchObservableResult): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n const attributes = { ...this.customerProperties, telemetry_type: TelemetryType.UNKNOWN };\n\n // For each { telemetry_type -> count } mapping, call observe, passing the count and attributes that include the telemetry_type\n for (const [telemetry_type, count] of counter.totalItemSuccessCount.entries()) {\n // Only send metrics if count is greater than zero\n if (count > 0) {\n attributes.telemetry_type = telemetry_type;\n observableResult.observe(this.itemSuccessCountGauge, count, {\n ...attributes,\n });\n counter.totalItemSuccessCount.set(telemetry_type, 0);\n }\n }\n }\n\n private itemDropCallback(observableResult: BatchObservableResult): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n const baseAttributes: CustomerSDKStatsProperties & {\n \"drop.code\": DropCode | number;\n telemetry_type: TelemetryType;\n } = {\n ...this.customerProperties,\n \"drop.code\": DropCode.UNKNOWN,\n telemetry_type: TelemetryType.UNKNOWN,\n };\n\n // Iterate through the nested Map structure: telemetry_type -> drop.code -> reason -> telemetry_success -> count\n for (const [telemetryType, dropCodeMap] of counter.totalItemDropCount.entries()) {\n for (const [dropCode, reasonMap] of dropCodeMap.entries()) {\n for (const [reason, successMap] of reasonMap.entries()) {\n for (const [success, count] of successMap.entries()) {\n const attributes = { ...baseAttributes };\n attributes.telemetry_type = telemetryType;\n attributes[\"drop.code\"] = dropCode;\n\n // Include drop.reason for all cases\n if (reason) {\n (attributes as any)[\"drop.reason\"] = reason;\n }\n\n // Include telemetry_success only for request/dependency telemetry when success is not null\n if (\n (telemetryType === TelemetryType.REQUEST ||\n telemetryType === TelemetryType.DEPENDENCY) &&\n success !== null\n ) {\n (attributes as any)[\"telemetry_success\"] = success;\n }\n\n // Only send metrics if count is greater than zero\n if (count > 0) {\n observableResult.observe(this.itemDropCountGauge, count, {\n ...attributes,\n });\n }\n\n // Reset the count to 0\n successMap.set(success, 0);\n }\n }\n }\n }\n }\n\n private itemRetryCallback(observableResult: BatchObservableResult): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n const baseAttributes: CustomerSDKStatsProperties & {\n \"retry.code\": RetryCode | number;\n telemetry_type: TelemetryType;\n } = {\n ...this.customerProperties,\n \"retry.code\": RetryCode.UNKNOWN,\n telemetry_type: TelemetryType.UNKNOWN,\n };\n\n // Iterate through the nested Map structure: telemetry_type -> retry.code -> reason -> count\n for (const [telemetryType, retryCodeMap] of counter.totalItemRetryCount.entries()) {\n for (const [retryCode, reasonMap] of retryCodeMap.entries()) {\n for (const [reason, count] of reasonMap.entries()) {\n const attributes = { ...baseAttributes };\n attributes.telemetry_type = telemetryType;\n attributes[\"retry.code\"] = retryCode;\n\n // Include retry.reason for all cases\n if (reason) {\n (attributes as any)[\"retry.reason\"] = reason;\n }\n\n // Only send metrics if count is greater than zero\n if (count > 0) {\n observableResult.observe(this.itemRetryCountGauge, count, {\n ...attributes,\n });\n }\n\n // Reset the count to 0\n reasonMap.set(reason, 0);\n }\n }\n }\n }\n\n // Public methods to track metrics\n /**\n * Tracks succcessful items\n * @param envelopes - Number of successful envelopes\n * @param telemetry_type - The type of telemetry being tracked\n */\n public countSuccessfulItems(envelopes: Envelope[]): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n let telemetry_type: TelemetryType;\n\n // Get the current count for this telemetry type, or 0 if it doesn't exist\n for (const envelope of envelopes) {\n telemetry_type = this.getTelemetryTypeFromEnvelope(envelope);\n const currentCount = counter.totalItemSuccessCount.get(telemetry_type) || 0;\n counter.totalItemSuccessCount.set(telemetry_type, currentCount + 1);\n }\n }\n\n /**\n * Tracks dropped items\n * @param envelopes - Array of envelopes dropped\n * @param dropCode - The drop code indicating the reason for drop\n * @param exceptionMessage - Optional exception message when dropCode is CLIENT_EXCEPTION\n * @param exceptionType - Optional explicit exception type override when dropCode is CLIENT_EXCEPTION\n */\n public countDroppedItems(\n envelopes: Envelope[],\n dropCode: DropCode | number,\n exceptionMessage?: string,\n exceptionType?: ExceptionType,\n ): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n let telemetry_type: TelemetryType;\n\n for (const envelope of envelopes) {\n telemetry_type = this.getTelemetryTypeFromEnvelope(envelope);\n\n let dropCodeMap = counter.totalItemDropCount.get(telemetry_type);\n if (!dropCodeMap) {\n dropCodeMap = new Map<DropCode | number, Map<string, Map<boolean | null, number>>>();\n counter.totalItemDropCount.set(telemetry_type, dropCodeMap);\n }\n\n // Get or create the reason map for this dropCode\n let reasonMap = dropCodeMap.get(dropCode);\n if (!reasonMap) {\n reasonMap = new Map<string, Map<boolean | null, number>>();\n dropCodeMap.set(dropCode, reasonMap);\n }\n\n // Generate a low-cardinality, informative reason description\n const reason = this.getDropReason(dropCode, exceptionMessage, exceptionType);\n\n // Get or create the success map for this reason\n let successMap = reasonMap.get(reason);\n if (!successMap) {\n successMap = new Map<boolean | null, number>();\n reasonMap.set(reason, successMap);\n }\n\n // For non-request/dependency telemetry or when success is not provided, use null as the success key\n const individualTelemetrySuccess = this.getTelemetrySuccessFromEnvelope(envelope);\n const successKey =\n (telemetry_type === TelemetryType.REQUEST || telemetry_type === TelemetryType.DEPENDENCY) &&\n individualTelemetrySuccess !== undefined\n ? individualTelemetrySuccess\n : null;\n\n // Update the count for this reason and success combination\n const currentCount = successMap.get(successKey) || 0;\n successMap.set(successKey, currentCount + 1);\n }\n }\n\n /**\n * Generates a low-cardinality, informative description for drop reasons\n * @param dropCode - The drop code (enum value or status code number)\n * @param exceptionMessage - Optional exception message for CLIENT_EXCEPTION\n * @param exceptionType - Optional explicit exception type override for CLIENT_EXCEPTION\n * @returns A descriptive reason string with low cardinality\n */\n private getDropReason(\n dropCode: DropCode | number,\n exceptionMessage?: string,\n exceptionType?: ExceptionType,\n ): string {\n if (dropCode === DropCode.CLIENT_EXCEPTION) {\n // If an explicit exception type is provided, use it\n if (exceptionType) {\n return exceptionType;\n }\n // For client exceptions, derive a well-known exception category from the exception message\n if (exceptionMessage) {\n return this.categorizeExceptionMessage(exceptionMessage);\n }\n return ExceptionType.CLIENT_EXCEPTION; // Default to \"Client exception\" if no message provided\n }\n\n // Handle status code drop codes (numeric values)\n if (typeof dropCode === \"number\") {\n return this.categorizeStatusCode(dropCode);\n }\n\n // Handle other enum drop codes\n switch (dropCode) {\n case DropCode.CLIENT_READONLY:\n return DropReason.CLIENT_READONLY;\n case DropCode.CLIENT_PERSISTENCE_CAPACITY:\n return DropReason.CLIENT_PERSISTENCE_CAPACITY;\n case DropCode.CLIENT_STORAGE_DISABLED:\n return DropReason.CLIENT_STORAGE_DISABLED;\n case DropCode.UNKNOWN:\n default:\n return DropReason.UNKNOWN;\n }\n }\n\n /**\n * Categorizes exception messages into well-known exception categories\n * @param exceptionMessage - The exception message to categorize\n * @returns A well-known exception category string\n */\n private categorizeExceptionMessage(exceptionMessage: string): ExceptionType {\n const message = exceptionMessage.toLowerCase();\n\n if (message.includes(\"timeout\") || message.includes(\"timed out\")) {\n return ExceptionType.TIMEOUT_EXCEPTION;\n }\n if (\n message.includes(\"network\") ||\n message.includes(\"connection\") ||\n message.includes(\"dns\") ||\n message.includes(\"socket\")\n ) {\n return ExceptionType.NETWORK_EXCEPTION;\n }\n if (\n message.includes(\"disk\") ||\n message.includes(\"storage\") ||\n message.includes(\"file\") ||\n message.includes(\"persist\")\n ) {\n return ExceptionType.STORAGE_EXCEPTION;\n }\n\n // Default to Client exception for any other cases\n return ExceptionType.CLIENT_EXCEPTION;\n }\n\n /**\n * Categorizes HTTP status codes into informative descriptions\n * @param statusCode - The HTTP status code\n * @returns A descriptive category string\n */\n private categorizeStatusCode(statusCode: number): string {\n if (statusCode >= 400 && statusCode < 500) {\n switch (statusCode) {\n case 400:\n return \"Bad request\";\n case 401:\n return \"Unauthorized\";\n case 403:\n return \"Forbidden\";\n case 404:\n return \"Not found\";\n case 408:\n return \"Request timeout\";\n case 413:\n return \"Payload too large\";\n case 429:\n return \"Too many requests\";\n default:\n return \"Client error 4xx\";\n }\n }\n\n if (statusCode >= 500 && statusCode < 600) {\n switch (statusCode) {\n case 500:\n return \"Internal server error\";\n case 502:\n return \"Bad gateway\";\n case 503:\n return \"Service unavailable\";\n case 504:\n return \"Gateway timeout\";\n default:\n return \"Server error 5xx\";\n }\n }\n\n return `status_${statusCode}`;\n }\n /**\n * Tracks retried envelopes\n * @param envelopes - Number of envelopes retried\n * @param retryCode - The retry code indicating the reason for retry\n * @param exceptionMessage - Optional exception message when retryCode is CLIENT_EXCEPTION\n * @param exceptionType - Optional explicit exception type override when retryCode is CLIENT_EXCEPTION\n */\n public countRetryItems(\n envelopes: Envelope[],\n retryCode: RetryCode | number,\n exceptionMessage?: string,\n exceptionType?: ExceptionType,\n ): void {\n const counter: CustomerSDKStats = this.customerSDKStatsCounter;\n let telemetry_type: TelemetryType;\n\n for (const envelope of envelopes) {\n telemetry_type = this.getTelemetryTypeFromEnvelope(envelope);\n // Get or create the retryCode map for this telemetry_type\n let retryCodeMap = counter.totalItemRetryCount.get(telemetry_type);\n if (!retryCodeMap) {\n retryCodeMap = new Map<RetryCode | number, Map<string, number>>();\n counter.totalItemRetryCount.set(telemetry_type, retryCodeMap);\n }\n\n // Get or create the reason map for this retryCode\n let reasonMap = retryCodeMap.get(retryCode);\n if (!reasonMap) {\n reasonMap = new Map<string, number>();\n retryCodeMap.set(retryCode, reasonMap);\n }\n\n // Generate a low-cardinality, informative reason description\n const reason = this.getRetryReason(retryCode, exceptionMessage, exceptionType);\n\n // Update the count for this reason\n const currentCount = reasonMap.get(reason) || 0;\n reasonMap.set(reason, currentCount + 1);\n }\n }\n\n /**\n * Generates a low-cardinality, informative description for retry reasons\n * @param retryCode - The retry code (enum value or status code number)\n * @param exceptionMessage - Optional exception message for CLIENT_EXCEPTION\n * @param exceptionType - Optional explicit exception type override for CLIENT_EXCEPTION\n * @returns A descriptive reason string with low cardinality\n */\n private getRetryReason(\n retryCode: RetryCode | number,\n exceptionMessage?: string,\n exceptionType?: ExceptionType,\n ): string {\n if (retryCode === RetryCode.CLIENT_EXCEPTION) {\n // If an explicit exception type is provided, use it\n if (exceptionType) {\n return exceptionType;\n }\n // For client exceptions, derive a low-cardinality reason from the exception message\n if (exceptionMessage) {\n return this.categorizeExceptionMessage(exceptionMessage);\n }\n return ExceptionType.CLIENT_EXCEPTION;\n }\n\n // Handle status code retry codes (numeric values)\n if (typeof retryCode === \"number\") {\n return this.categorizeStatusCode(retryCode);\n }\n\n // Handle other enum retry codes\n switch (retryCode) {\n case RetryCode.CLIENT_TIMEOUT:\n return RetryReason.CLIENT_TIMEOUT;\n case RetryCode.UNKNOWN:\n default:\n return RetryReason.UNKNOWN;\n }\n }\n\n /**\n * Check if a metric name corresponds to a performance counter\n * @param metricName - The name of the metric to check\n * @returns true if the metric name is a performance counter, false otherwise\n */\n private isPerformanceCounterMetric(metricName: string): boolean {\n return Object.values(BreezePerformanceCounterNames).includes(\n metricName as BreezePerformanceCounterNames,\n );\n }\n\n /**\n * Extract telemetry type from an envelope based on its baseType\n * @param envelope - The envelope to extract telemetry type from\n * @returns The corresponding telemetry type\n */\n public getTelemetryTypeFromEnvelope(envelope: Envelope): TelemetryType {\n if (envelope.data && envelope.data.baseType) {\n switch (envelope.data.baseType) {\n case \"MessageData\":\n return TelemetryType.TRACE;\n case \"AvailabilityData\":\n return TelemetryType.AVAILABILITY;\n case \"TelemetryEventData\":\n return TelemetryType.CUSTOM_EVENT;\n case \"TelemetryExceptionData\":\n return TelemetryType.EXCEPTION;\n case \"PageViewData\":\n return TelemetryType.PAGE_VIEW;\n case \"RemoteDependencyData\":\n return TelemetryType.DEPENDENCY;\n case \"RequestData\":\n return TelemetryType.REQUEST;\n case \"MetricData\": {\n const metricsData = envelope.data.baseData as MetricsData;\n if (metricsData && metricsData.metrics && metricsData.metrics.length > 0) {\n // Check if any of the metrics are performance counters\n const hasPerformanceCounter = metricsData.metrics.some((metric) =>\n this.isPerformanceCounterMetric(metric.name),\n );\n return hasPerformanceCounter\n ? TelemetryType.PERFORMANCE_COUNTER\n : TelemetryType.CUSTOM_METRIC;\n }\n return TelemetryType.CUSTOM_METRIC;\n }\n default:\n return TelemetryType.UNKNOWN;\n }\n }\n return TelemetryType.UNKNOWN;\n }\n\n /**\n * Extract telemetry success value from an envelope for REQUEST and DEPENDENCY telemetry types\n * @param envelope - The envelope to extract success value from\n * @returns The success value if available, undefined otherwise\n */\n public getTelemetrySuccessFromEnvelope(envelope: Envelope): boolean | undefined {\n if (!envelope.data || !envelope.data.baseData) {\n return undefined;\n }\n\n const baseType = envelope.data.baseType;\n if (baseType === \"RequestData\") {\n const requestData = envelope.data.baseData as RequestData;\n return requestData.success;\n } else if (baseType === \"RemoteDependencyData\") {\n const dependencyData = envelope.data.baseData as RemoteDependencyData;\n return dependencyData.success;\n }\n\n return undefined;\n }\n\n /**\n * Checks if the given error is a timeout-related error\n * @param error - The error to check\n * @returns true if the error is timeout-related, false otherwise\n */\n public isTimeoutError(error: { code?: string; message?: string }): boolean {\n // Check for various timeout error codes that indicate client timeouts\n const timeoutErrorCodes = [\n \"ETIMEDOUT\", // Connection timed out\n \"ESOCKETTIMEDOUT\", // Socket timeout\n \"ECONNRESET\", // Connection reset (often due to timeout)\n \"ENOTFOUND\", // DNS lookup failed/timeout\n ];\n\n if (error && error.code && timeoutErrorCodes.includes(error.code)) {\n return true;\n }\n\n // Also check if the error message contains timeout-related keywords\n if (error && error.message) {\n const timeoutKeywords = [\"timeout\", \"timed out\", \"connection reset\"];\n const errorMessage = error.message.toLowerCase();\n return timeoutKeywords.some((keyword) => errorMessage.includes(keyword));\n }\n\n return false;\n }\n}\n"]}
@@ -11,11 +11,16 @@ export declare class AzureMonitorStatsbeatExporter extends AzureMonitorBaseExpor
11
11
  */
12
12
  private _isShutdown;
13
13
  private _sender;
14
+ private _senderOptions;
14
15
  /**
15
16
  * Initializes a new instance of the AzureMonitorStatsbeatExporter class.
16
17
  * @param options - Exporter configuration
17
18
  */
18
19
  constructor(options: AzureMonitorExporterOptions);
20
+ /**
21
+ * Lazily initialize the sender to avoid circular dependency
22
+ */
23
+ private _getSender;
19
24
  /**
20
25
  * Filter out envelopes with zero metric values to prevent exporting zero counts.
21
26
  * This ensures zero counts are observed for internal cleanup but not exported to Azure Monitor.
@@ -1 +1 @@
1
- {"version":3,"file":"statsbeatExporter.d.ts","sourceRoot":"","sources":["../../../../src/export/statsbeat/statsbeatExporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kB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hD;;OAEG;YACW,UAAU;IAQxB;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,eAAe,EACxB,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAC7C,OAAO,CAAC,IAAI,CAAC;IAsBhB;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAOtC;;OAEG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGzC"}
@@ -4,7 +4,6 @@ import { context } from "@opentelemetry/api";
4
4
  import { ExportResultCode, suppressTracing } from "@opentelemetry/core";
5
5
  import { resourceMetricsToEnvelope } from "../../utils/metricUtils.js";
6
6
  import { AzureMonitorBaseExporter } from "../base.js";
7
- import { HttpSender } from "../../platform/index.js";
8
7
  /**
9
8
  * Azure Monitor Statsbeat Exporter
10
9
  */
@@ -14,19 +13,31 @@ export class AzureMonitorStatsbeatExporter extends AzureMonitorBaseExporter {
14
13
  */
15
14
  _isShutdown = false;
16
15
  _sender;
16
+ _senderOptions;
17
17
  /**
18
18
  * Initializes a new instance of the AzureMonitorStatsbeatExporter class.
19
19
  * @param options - Exporter configuration
20
20
  */
21
21
  constructor(options) {
22
22
  super(options, true);
23
- this._sender = new HttpSender({
23
+ // Store sender options for lazy initialization to avoid circular dependency
24
+ this._senderOptions = {
24
25
  endpointUrl: this.endpointUrl,
25
26
  instrumentationKey: this.instrumentationKey,
26
27
  trackStatsbeat: this.trackStatsbeat,
27
28
  exporterOptions: options,
28
29
  isStatsbeatSender: true,
29
- });
30
+ };
31
+ }
32
+ /**
33
+ * Lazily initialize the sender to avoid circular dependency
34
+ */
35
+ async _getSender() {
36
+ if (!this._sender) {
37
+ const { HttpSender } = await import("../../platform/nodejs/httpSender.js");
38
+ this._sender = new HttpSender(this._senderOptions);
39
+ }
40
+ return this._sender;
30
41
  }
31
42
  /**
32
43
  * Filter out envelopes with zero metric values to prevent exporting zero counts.
@@ -58,7 +69,8 @@ export class AzureMonitorStatsbeatExporter extends AzureMonitorBaseExporter {
58
69
  const filteredEnvelopes = this.filterZeroValueMetrics(envelopes);
59
70
  // Supress tracing until OpenTelemetry Metrics SDK support it
60
71
  context.with(suppressTracing(context.active()), async () => {
61
- resultCallback(await this._sender.exportEnvelopes(filteredEnvelopes));
72
+ const sender = await this._getSender();
73
+ resultCallback(await sender.exportEnvelopes(filteredEnvelopes));
62
74
  });
63
75
  }
64
76
  /**
@@ -66,7 +78,9 @@ export class AzureMonitorStatsbeatExporter extends AzureMonitorBaseExporter {
66
78
  */
67
79
  async shutdown() {
68
80
  this._isShutdown = true;
69
- return this._sender.shutdown();
81
+ if (this._sender) {
82
+ return this._sender.shutdown();
83
+ }
70
84
  }
71
85
  /**
72
86
  * Force flush.
@@ -1 +1 @@
1
- {"version":3,"file":"statsbeatExporter.js","sourceRoot":"","sources":["../../../../src/export/statsbeat/statsbeatExporter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,6BACX,SAAQ,wBAAwB;IAGhC;;OAEG;IACK,WAAW,GAAG,KAAK,CAAC;IACpB,OAAO,CAAa;IAE5B;;;OAGG;IACH,YAAY,OAAoC;QAC9C,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,UAAU,CAAC;YAC5B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;YAC3C,cAA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AAC,CAAC;QACxE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,QAAQ;QACnB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,UAAU;QACrB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { context } from \"@opentelemetry/api\";\nimport type { PushMetricExporter, ResourceMetrics } from \"@opentelemetry/sdk-metrics\";\nimport type { ExportResult } from \"@opentelemetry/core\";\nimport { ExportResultCode, suppressTracing } from \"@opentelemetry/core\";\nimport type { AzureMonitorExporterOptions } from \"../../config.js\";\nimport type { TelemetryItem as Envelope } from \"../../generated/index.js\";\nimport { resourceMetricsToEnvelope } from \"../../utils/metricUtils.js\";\nimport { AzureMonitorBaseExporter } from \"../base.js\";\nimport { HttpSender } from \"../../platform/index.js\";\n\n/**\n * Azure Monitor Statsbeat Exporter\n */\nexport class AzureMonitorStatsbeatExporter\n extends AzureMonitorBaseExporter\n implements PushMetricExporter\n{\n /**\n * Flag to determine if the Exporter is shutdown.\n */\n private _isShutdown = false;\n private _sender: HttpSender;\n\n /**\n * Initializes a new instance of the AzureMonitorStatsbeatExporter class.\n * @param options - Exporter configuration\n */\n constructor(options: AzureMonitorExporterOptions) {\n super(options, true);\n this._sender = new HttpSender({\n endpointUrl: this.endpointUrl,\n instrumentationKey: this.instrumentationKey,\n trackStatsbeat: this.trackStatsbeat,\n exporterOptions: options,\n isStatsbeatSender: true,\n });\n }\n\n /**\n * Filter out envelopes with zero metric values to prevent exporting zero counts.\n * This ensures zero counts are observed for internal cleanup but not exported to Azure Monitor.\n * @param envelopes - Array of telemetry envelopes to filter\n * @returns Filtered array of envelopes with non-zero metric values\n */\n private filterZeroValueMetrics(envelopes: Envelope[]): Envelope[] {\n return envelopes.filter((envelope) => {\n // Check if this is a metric envelope\n if (envelope.data?.baseType === \"MetricData\" && envelope.data?.baseData?.metrics) {\n const metrics = envelope.data.baseData.metrics;\n // Filter out metrics where all values are zero\n return metrics.some((metric: any) => metric.value !== 0);\n }\n return true;\n });\n }\n\n /**\n * Export Statsbeat metrics.\n */\n async export(\n metrics: ResourceMetrics,\n resultCallback: (result: ExportResult) => void,\n ): Promise<void> {\n if (this._isShutdown) {\n setTimeout(() => resultCallback({ code: ExportResultCode.FAILED }), 0);\n return;\n }\n\n const envelopes: Envelope[] = resourceMetricsToEnvelope(\n metrics,\n this.instrumentationKey,\n true, // isStatsbeat flag passed to create a Statsbeat envelope.\n );\n\n // Filter out zero-value metrics before export\n const filteredEnvelopes = this.filterZeroValueMetrics(envelopes);\n\n // Supress tracing until OpenTelemetry Metrics SDK support it\n context.with(suppressTracing(context.active()), async () => {\n resultCallback(await this._sender.exportEnvelopes(filteredEnvelopes));\n });\n }\n\n /**\n * Shutdown AzureMonitorStatsbeatExporter.\n */\n public async shutdown(): Promise<void> {\n this._isShutdown = true;\n return this._sender.shutdown();\n }\n\n /**\n * Force flush.\n */\n public async forceFlush(): Promise<void> {\n return Promise.resolve();\n }\n}\n"]}
1
+ {"version":3,"file":"statsbeatExporter.js","sourceRoot":"","sources":["../../../../src/export/statsbeat/statsbeatExporter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD;;GAEG;AACH,MAAM,OAAO,6BACX,SAAQ,wBAAwB;IAGhC;;OAEG;IACK,WAAW,GAAG,KAAK,CAAC;IACpB,OAAO,CAAM;I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EAAE,CAAC;YACrB,UAAU,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACvE,OAAO;QACT,CAAC;QAED,MAAM,SAAS,GAAe,yBAAyB,CACrD,OAAO,EACP,IAAI,CAAC,kBAAkB,EACvB,IAAI,CACL,CAAC;QAEF,8CAA8C;QAC9C,MAAM,iBAAiB,GAAG,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,CAAC;QAEjE,6DAA6D;QAC7D,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,KAAK,IAAI,EAAE;YACzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;YACvC,cAAc,CAAC,MAAM,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;QAClE,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,QAAQ;QACnB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACjC,CAAC;IACH,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,UAAU;QACrB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { context } from \"@opentelemetry/api\";\nimport type { PushMetricExporter, ResourceMetrics } from \"@opentelemetry/sdk-metrics\";\nimport type { ExportResult } from \"@opentelemetry/core\";\nimport { ExportResultCode, suppressTracing } from \"@opentelemetry/core\";\nimport type { AzureMonitorExporterOptions } from \"../../config.js\";\nimport type { TelemetryItem as Envelope } from \"../../generated/index.js\";\nimport { resourceMetricsToEnvelope } from \"../../utils/metricUtils.js\";\nimport { AzureMonitorBaseExporter } from \"../base.js\";\n\n/**\n * Azure Monitor Statsbeat Exporter\n */\nexport class AzureMonitorStatsbeatExporter\n extends AzureMonitorBaseExporter\n implements PushMetricExporter\n{\n /**\n * Flag to determine if the Exporter is shutdown.\n */\n private _isShutdown = false;\n private _sender: any;\n private _senderOptions: any;\n\n /**\n * Initializes a new instance of the AzureMonitorStatsbeatExporter class.\n * @param options - Exporter configuration\n */\n constructor(options: AzureMonitorExporterOptions) {\n super(options, true);\n // Store sender options for lazy initialization to avoid circular dependency\n this._senderOptions = {\n endpointUrl: this.endpointUrl,\n instrumentationKey: this.instrumentationKey,\n trackStatsbeat: this.trackStatsbeat,\n exporterOptions: options,\n isStatsbeatSender: true,\n };\n }\n\n /**\n * Lazily initialize the sender to avoid circular dependency\n */\n private async _getSender(): Promise<any> {\n if (!this._sender) {\n const { HttpSender } = await import(\"../../platform/nodejs/httpSender.js\");\n this._sender = new HttpSender(this._senderOptions);\n }\n return this._sender;\n }\n\n /**\n * Filter out envelopes with zero metric values to prevent exporting zero counts.\n * This ensures zero counts are observed for internal cleanup but not exported to Azure Monitor.\n * @param envelopes - Array of telemetry envelopes to filter\n * @returns Filtered array of envelopes with non-zero metric values\n */\n private filterZeroValueMetrics(envelopes: Envelope[]): Envelope[] {\n return envelopes.filter((envelope) => {\n // Check if this is a metric envelope\n if (envelope.data?.baseType === \"MetricData\" && envelope.data?.baseData?.metrics) {\n const metrics = envelope.data.baseData.metrics;\n // Filter out metrics where all values are zero\n return metrics.some((metric: any) => metric.value !== 0);\n }\n return true;\n });\n }\n\n /**\n * Export Statsbeat metrics.\n */\n async export(\n metrics: ResourceMetrics,\n resultCallback: (result: ExportResult) => void,\n ): Promise<void> {\n if (this._isShutdown) {\n setTimeout(() => resultCallback({ code: ExportResultCode.FAILED }), 0);\n return;\n }\n\n const envelopes: Envelope[] = resourceMetricsToEnvelope(\n metrics,\n this.instrumentationKey,\n true, // isStatsbeat flag passed to create a Statsbeat envelope.\n );\n\n // Filter out zero-value metrics before export\n const filteredEnvelopes = this.filterZeroValueMetrics(envelopes);\n\n // Supress tracing until OpenTelemetry Metrics SDK support it\n context.with(suppressTracing(context.active()), async () => {\n const sender = await this._getSender();\n resultCallback(await sender.exportEnvelopes(filteredEnvelopes));\n });\n }\n\n /**\n * Shutdown AzureMonitorStatsbeatExporter.\n */\n public async shutdown(): Promise<void> {\n this._isShutdown = true;\n if (this._sender) {\n return this._sender.shutdown();\n }\n }\n\n /**\n * Force flush.\n */\n public async forceFlush(): Promise<void> {\n return Promise.resolve();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"statsbeatMetrics.d.ts","sourceRoot":"","sources":["../../../../src/export/statsbeat/statsbeatMetrics.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAYrD,qBAAa,gBAAgB;IAC3B,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAqC;IACvE,SAAS,CAAC,MAAM,EAAE,kBAAkB,CAAM;IAC1C,SAAS,CAAC,EAAE,EAAE,MAAM,CAAa;IACjC,SAAS,CAAC,kBAAkB,SAAM;cAElB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAgCvC,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC;IA2CxD,SAAS,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;CAS3D"}
1
+ {"version":3,"file":"statsbeatMetrics.d.ts","sourceRoot":"","sources":["../../../../src/export/statsbeat/statsbeatMetrics.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAYrD,qBAAa,gBAAgB;IAC3B,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAqC;IACvE,SAAS,CAAC,MAAM,EAAE,kBAAkB,CAAM;IAC1C,SAAS,CAAC,EAAE,EAAE,MAAM,CAAa;IACjC,SAAS,CAAC,kBAAkB,SAAM;cAElB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAiCvC,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC;IA2CxD,SAAS,CAAC,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;CAS3D"}
@@ -12,10 +12,11 @@ export class StatsbeatMetrics {
12
12
  async getResourceProvider() {
13
13
  // Check resource provider
14
14
  this.resourceProvider = StatsbeatResourceProvider.unknown;
15
- if (process.env.AKS_ARM_NAMESPACE_ID) {
15
+ if (process.env.AKS_ARM_NAMESPACE_ID || process.env.KUBERNETES_SERVICE_HOST) {
16
16
  // AKS
17
17
  this.resourceProvider = StatsbeatResourceProvider.aks;
18
- this.resourceIdentifier = process.env.AKS_ARM_NAMESPACE_ID;
18
+ this.resourceIdentifier =
19
+ process.env.AKS_ARM_NAMESPACE_ID || process.env.KUBERNETES_SERVICE_HOST || "";
19
20
  }
20
21
  else if (process.env.WEBSITE_SITE_NAME && !process.env.FUNCTIONS_WORKER_RUNTIME) {
21
22
  // Web apps
@@ -1 +1 @@
1
- {"version":3,"file":"statsbeatMetrics.js","sourceRoot":"","sources":["../../../../src/export/statsbeat/statsbeatMetrics.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,oBAAoB,EACpB,YAAY,EACZ,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,OAAO,gBAAgB;IACjB,gBAAgB,GAAW,yBAAyB,CAAC,OAAO,CAAC;IAC7D,MAAM,GAAuB,EAAE,CAAC;IAChC,EAAE,GAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACvB,kBAAkB,GAAG,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BACpC,IAAI,CAAC,MAAM,CAAC,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;wBAC1D,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAC5C,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,IAAI,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;oBAC9C,CAAC;gBACH,CAAC,CAAC,CAAC;gBACH,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACL,OAAO,KAAK,CAAC;IACf,CAAC;IAES,mBAAmB,CAAC,WAAmB;QAC/C,MAAM,eAAe,GAAG,WAAW,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,IAAI,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC9C,OAAO,oBAAoB,CAAC;YAC9B,CAAC;QACH,CAAC;QACD,OAAO,wBAAwB,CAAC;IAClC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpMethods } from \"@azure/core-rest-pipeline\";\nimport { createDefaultHttpClient, createPipelineRequest } from \"@azure/core-rest-pipeline\";\nimport { diag } from \"@opentelemetry/api\";\nimport type { VirtualMachineInfo } from \"./types.js\";\nimport {\n AIMS_API_VERSION,\n AIMS_FORMAT,\n AIMS_URI,\n EU_CONNECTION_STRING,\n EU_ENDPOINTS,\n NON_EU_CONNECTION_STRING,\n StatsbeatResourceProvider,\n} from \"./types.js\";\nimport os from \"node:os\";\n\nexport class StatsbeatMetrics {\n protected resourceProvider: string = StatsbeatResourceProvider.unknown;\n protected vmInfo: VirtualMachineInfo = {};\n protected os: string = os.type();\n protected resourceIdentifier = \"\";\n\n protected async getResourceProvider(): Promise<void> {\n // Check resource provider\n this.resourceProvider = StatsbeatResourceProvider.unknown;\n if (process.env.AKS_ARM_NAMESPACE_ID) {\n // AKS\n this.resourceProvider = StatsbeatResourceProvider.aks;\n this.resourceIdentifier = process.env.AKS_ARM_NAMESPACE_ID;\n } else if (process.env.WEBSITE_SITE_NAME && !process.env.FUNCTIONS_WORKER_RUNTIME) {\n // Web apps\n this.resourceProvider = StatsbeatResourceProvider.appsvc;\n this.resourceIdentifier = process.env.WEBSITE_SITE_NAME;\n if (process.env.WEBSITE_HOME_STAMPNAME) {\n this.resourceIdentifier += \"/\" + process.env.WEBSITE_HOME_STAMPNAME;\n }\n } else if (process.env.FUNCTIONS_WORKER_RUNTIME) {\n // Function apps\n this.resourceProvider = StatsbeatResourceProvider.functions;\n if (process.env.WEBSITE_HOSTNAME) {\n this.resourceIdentifier = process.env.WEBSITE_HOSTNAME;\n }\n } else if (await this.getAzureComputeMetadata()) {\n this.resourceProvider = StatsbeatResourceProvider.vm;\n this.resourceIdentifier = this.vmInfo.id + \"/\" + this.vmInfo.subscriptionId;\n // Overrride OS as VM info have higher precedence\n if (this.vmInfo.osType) {\n this.os = this.vmInfo.osType;\n }\n } else {\n this.resourceProvider = StatsbeatResourceProvider.unknown;\n }\n }\n\n public async getAzureComputeMetadata(): Promise<boolean> {\n const httpClient = createDefaultHttpClient();\n const method: HttpMethods = \"GET\";\n\n const options = {\n url: `${AIMS_URI}?${AIMS_API_VERSION}&${AIMS_FORMAT}`,\n timeout: 5000, // 5 seconds\n method: method,\n allowInsecureConnection: true,\n };\n const request = createPipelineRequest(options);\n\n await httpClient\n .sendRequest(request)\n .then((res: any) => {\n if (res.status === 200) {\n // Success; VM\n this.vmInfo.isVM = true;\n let virtualMachineData = \"\";\n res.on(\"data\", (data: any) => {\n virtualMachineData += data;\n });\n res.on(\"end\", () => {\n try {\n const data = JSON.parse(virtualMachineData);\n this.vmInfo.id = data[\"vmId\"] || \"\";\n this.vmInfo.subscriptionId = data[\"subscriptionId\"] || \"\";\n this.vmInfo.osType = data[\"osType\"] || \"\";\n } catch (error) {\n diag.debug(\"Failed to parse JSON: \", error);\n }\n });\n return true;\n } else {\n return false;\n }\n })\n .catch(() => {\n return false;\n });\n return false;\n }\n\n protected getConnectionString(endpointUrl: string): string {\n const currentEndpoint = endpointUrl;\n for (let i = 0; i < EU_ENDPOINTS.length; i++) {\n if (currentEndpoint.includes(EU_ENDPOINTS[i])) {\n return EU_CONNECTION_STRING;\n }\n }\n return NON_EU_CONNECTION_STRING;\n }\n}\n"]}
1
+ {"version":3,"file":"statsbeatMetrics.js","sourceRoot":"","sources":["../../../../src/export/statsbeat/statsbeatMetrics.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,oBAAoB,EACpB,YAAY,EACZ,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,MAAM,OAAO,gBAAgB;IACjB,gBAAgB,GAAW,yBAAyB,CAAC,OAAO,CAAC;IAC7D,MAAM,GAAuB,EAAE,CAAC;IAChC,EAAE,GAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IACvB,kBAAkB,GAAG,EAAE,CAAC;IAExB,KAAK,CAAC,mBAAmB;QACjC,0BAA0B;QAC1B,IAAI,CAAC,gBAAgB,GAAG,yBAAyB,CAAC,OAAO,CAAC;QAC1D,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,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wBAC1D,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAC5C,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACf,IAAI,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;oBAC9C,CAAC;gBACH,CAAC,CAAC,CAAC;gBACH,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE;YACV,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACL,OAAO,KAAK,CAAC;IACf,CAAC;IAES,mBAAmB,CAAC,WAAmB;QAC/C,MAAM,eAAe,GAAG,WAAW,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,IAAI,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC9C,OAAO,oBAAoB,CAAC;YAC9B,CAAC;QACH,CAAC;QACD,OAAO,wBAAwB,CAAC;IAClC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { HttpMethods } from \"@azure/core-rest-pipeline\";\nimport { createDefaultHttpClient, createPipelineRequest } from \"@azure/core-rest-pipeline\";\nimport { diag } from \"@opentelemetry/api\";\nimport type { VirtualMachineInfo } from \"./types.js\";\nimport {\n AIMS_API_VERSION,\n AIMS_FORMAT,\n AIMS_URI,\n EU_CONNECTION_STRING,\n EU_ENDPOINTS,\n NON_EU_CONNECTION_STRING,\n StatsbeatResourceProvider,\n} from \"./types.js\";\nimport os from \"node:os\";\n\nexport class StatsbeatMetrics {\n protected resourceProvider: string = StatsbeatResourceProvider.unknown;\n protected vmInfo: VirtualMachineInfo = {};\n protected os: string = os.type();\n protected resourceIdentifier = \"\";\n\n protected async getResourceProvider(): Promise<void> {\n // Check resource provider\n this.resourceProvider = StatsbeatResourceProvider.unknown;\n if (process.env.AKS_ARM_NAMESPACE_ID || process.env.KUBERNETES_SERVICE_HOST) {\n // AKS\n this.resourceProvider = StatsbeatResourceProvider.aks;\n this.resourceIdentifier =\n process.env.AKS_ARM_NAMESPACE_ID || process.env.KUBERNETES_SERVICE_HOST || \"\";\n } else if (process.env.WEBSITE_SITE_NAME && !process.env.FUNCTIONS_WORKER_RUNTIME) {\n // Web apps\n this.resourceProvider = StatsbeatResourceProvider.appsvc;\n this.resourceIdentifier = process.env.WEBSITE_SITE_NAME;\n if (process.env.WEBSITE_HOME_STAMPNAME) {\n this.resourceIdentifier += \"/\" + process.env.WEBSITE_HOME_STAMPNAME;\n }\n } else if (process.env.FUNCTIONS_WORKER_RUNTIME) {\n // Function apps\n this.resourceProvider = StatsbeatResourceProvider.functions;\n if (process.env.WEBSITE_HOSTNAME) {\n this.resourceIdentifier = process.env.WEBSITE_HOSTNAME;\n }\n } else if (await this.getAzureComputeMetadata()) {\n this.resourceProvider = StatsbeatResourceProvider.vm;\n this.resourceIdentifier = this.vmInfo.id + \"/\" + this.vmInfo.subscriptionId;\n // Overrride OS as VM info have higher precedence\n if (this.vmInfo.osType) {\n this.os = this.vmInfo.osType;\n }\n } else {\n this.resourceProvider = StatsbeatResourceProvider.unknown;\n }\n }\n\n public async getAzureComputeMetadata(): Promise<boolean> {\n const httpClient = createDefaultHttpClient();\n const method: HttpMethods = \"GET\";\n\n const options = {\n url: `${AIMS_URI}?${AIMS_API_VERSION}&${AIMS_FORMAT}`,\n timeout: 5000, // 5 seconds\n method: method,\n allowInsecureConnection: true,\n };\n const request = createPipelineRequest(options);\n\n await httpClient\n .sendRequest(request)\n .then((res: any) => {\n if (res.status === 200) {\n // Success; VM\n this.vmInfo.isVM = true;\n let virtualMachineData = \"\";\n res.on(\"data\", (data: any) => {\n virtualMachineData += data;\n });\n res.on(\"end\", () => {\n try {\n const data = JSON.parse(virtualMachineData);\n this.vmInfo.id = data[\"vmId\"] || \"\";\n this.vmInfo.subscriptionId = data[\"subscriptionId\"] || \"\";\n this.vmInfo.osType = data[\"osType\"] || \"\";\n } catch (error) {\n diag.debug(\"Failed to parse JSON: \", error);\n }\n });\n return true;\n } else {\n return false;\n }\n })\n .catch(() => {\n return false;\n });\n return false;\n }\n\n protected getConnectionString(endpointUrl: string): string {\n const currentEndpoint = endpointUrl;\n for (let i = 0; i < EU_ENDPOINTS.length; i++) {\n if (currentEndpoint.includes(EU_ENDPOINTS[i])) {\n return EU_CONNECTION_STRING;\n }\n }\n return NON_EU_CONNECTION_STRING;\n }\n}\n"]}
@@ -12,6 +12,7 @@ export declare class AzureMonitorTraceExporter extends AzureMonitorBaseExporter
12
12
  private isShutdown;
13
13
  private readonly sender;
14
14
  private shouldCreateResourceMetric;
15
+ private readonly applicationId;
15
16
  /**
16
17
  * Initializes a new instance of the AzureMonitorTraceExporter class.
17
18
  * @param AzureExporterConfig - Exporter configuration.
@@ -1 +1 @@
1
- {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/export/trace.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAMhE;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,wBAAyB,YAAW,YAAY;IAC7F;;OAEG;IACH,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,0BAA0B,CAAyC;IAE3E;;;OAGG;gBACS,OAAO,GAAE,2BAAgC;IAYrD;;;;OAIG;IACG,MAAM,CACV,KAAK,EAAE,YAAY,EAAE,EACrB,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAC7C,OAAO,CAAC,IAAI,CAAC;IA+BhB;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAKhC"}
1
+ {"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../../src/export/trace.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC;AAQhE;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,wBAAyB,YAAW,YAAY;IAC7F;;OAEG;IACH,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAa;IACpC,OAAO,CAAC,0BAA0B,CAAyC;IAC3E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;IAEnD;;;OAGG;gBACS,OAAO,GAAE,2BAAgC;IAmBrD;;;;OAIG;IACG,MAAM,CACV,KAAK,EAAE,YAAY,EAAE,EACrB,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAC7C,OAAO,CAAC,IAAI,CAAC;IAgChB;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAKhC"}
@@ -6,6 +6,8 @@ import { AzureMonitorBaseExporter } from "./base.js";
6
6
  import { readableSpanToEnvelope, spanEventsToEnvelopes } from "../utils/spanUtils.js";
7
7
  import { createResourceMetricEnvelope, shouldCreateResourceMetric } from "../utils/common.js";
8
8
  import { HttpSender } from "../platform/index.js";
9
+ import { ConnectionStringParser } from "../utils/connectionStringParser.js";
10
+ import { ENV_CONNECTION_STRING } from "../Declarations/Constants.js";
9
11
  /**
10
12
  * Azure Monitor OpenTelemetry Trace Exporter.
11
13
  */
@@ -16,12 +18,18 @@ export class AzureMonitorTraceExporter extends AzureMonitorBaseExporter {
16
18
  isShutdown = false;
17
19
  sender;
18
20
  shouldCreateResourceMetric = shouldCreateResourceMetric();
21
+ applicationId;
19
22
  /**
20
23
  * Initializes a new instance of the AzureMonitorTraceExporter class.
21
24
  * @param AzureExporterConfig - Exporter configuration.
22
25
  */
23
26
  constructor(options = {}) {
24
27
  super(options);
28
+ const connectionString = options.connectionString || process.env[ENV_CONNECTION_STRING];
29
+ if (connectionString) {
30
+ const parsedConnectionString = ConnectionStringParser.parse(connectionString);
31
+ this.applicationId = parsedConnectionString.applicationid;
32
+ }
25
33
  this.sender = new HttpSender({
26
34
  endpointUrl: this.endpointUrl,
27
35
  instrumentationKey: this.instrumentationKey,
@@ -45,7 +53,7 @@ export class AzureMonitorTraceExporter extends AzureMonitorBaseExporter {
45
53
  diag.info(`Exporting ${spans.length} span(s). Converting to envelopes...`);
46
54
  if (spans.length > 0) {
47
55
  const envelopes = [];
48
- const resourceMetricEnvelope = createResourceMetricEnvelope(spans[0].resource, this.instrumentationKey);
56
+ const resourceMetricEnvelope = createResourceMetricEnvelope(spans[0].resource, this.instrumentationKey, this.applicationId);
49
57
  if (resourceMetricEnvelope && this.shouldCreateResourceMetric) {
50
58
  envelopes.push(resourceMetricEnvelope);
51
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/export/trace.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,4BAA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B,IAAI,IAAI,CAAC,0BAA0B,EAAE,CAAC;gBAC9D,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACzC,CAAC;YACD,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBACrB,SAAS,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACtE,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;gBAChF,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAClC,SAAS,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC,CAAC,CAAC;YACH,cAAc,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,oBAAoB;QACpB,cAAc,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { diag } from \"@opentelemetry/api\";\nimport type { ExportResult } from \"@opentelemetry/core\";\nimport { ExportResultCode } from \"@opentelemetry/core\";\nimport type { ReadableSpan, SpanExporter } from \"@opentelemetry/sdk-trace-base\";\nimport { AzureMonitorBaseExporter } from \"./base.js\";\nimport type { AzureMonitorExporterOptions } from \"../config.js\";\nimport type { TelemetryItem as Envelope } from \"../generated/index.js\";\nimport { readableSpanToEnvelope, spanEventsToEnvelopes } from \"../utils/spanUtils.js\";\nimport { createResourceMetricEnvelope, shouldCreateResourceMetric } from \"../utils/common.js\";\nimport { HttpSender } from \"../platform/index.js\";\n\n/**\n * Azure Monitor OpenTelemetry Trace Exporter.\n */\nexport class AzureMonitorTraceExporter extends AzureMonitorBaseExporter implements SpanExporter {\n /**\n * Flag to determine if Exporter is shutdown.\n */\n private isShutdown = false;\n private readonly sender: HttpSender;\n private shouldCreateResourceMetric: boolean = shouldCreateResourceMetric();\n\n /**\n * Initializes a new instance of the AzureMonitorTraceExporter class.\n * @param AzureExporterConfig - Exporter configuration.\n */\n constructor(options: AzureMonitorExporterOptions = {}) {\n super(options);\n this.sender = new HttpSender({\n endpointUrl: this.endpointUrl,\n instrumentationKey: this.instrumentationKey,\n trackStatsbeat: this.trackStatsbeat,\n exporterOptions: options,\n aadAudience: this.aadAudience,\n });\n diag.debug(\"AzureMonitorTraceExporter was successfully setup\");\n }\n\n /**\n * Export OpenTelemetry spans.\n * @param spans - Spans to export.\n * @param resultCallback - Result callback.\n */\n async export(\n spans: ReadableSpan[],\n resultCallback: (result: ExportResult) => void,\n ): Promise<void> {\n if (this.isShutdown) {\n diag.info(\"Exporter shut down. Failed to export spans.\");\n setTimeout(() => resultCallback({ code: ExportResultCode.FAILED }), 0);\n return;\n }\n\n diag.info(`Exporting ${spans.length} span(s). Converting to envelopes...`);\n\n if (spans.length > 0) {\n const envelopes: Envelope[] = [];\n const resourceMetricEnvelope = createResourceMetricEnvelope(\n spans[0].resource,\n this.instrumentationKey,\n );\n if (resourceMetricEnvelope && this.shouldCreateResourceMetric) {\n envelopes.push(resourceMetricEnvelope);\n }\n spans.forEach((span) => {\n envelopes.push(readableSpanToEnvelope(span, this.instrumentationKey));\n const spanEventEnvelopes = spanEventsToEnvelopes(span, this.instrumentationKey);\n if (spanEventEnvelopes.length > 0) {\n envelopes.push(...spanEventEnvelopes);\n }\n });\n resultCallback(await this.sender.exportEnvelopes(envelopes));\n }\n // No data to export\n resultCallback({ code: ExportResultCode.SUCCESS });\n }\n\n /**\n * Shutdown AzureMonitorTraceExporter.\n */\n async shutdown(): Promise<void> {\n this.isShutdown = true;\n diag.info(\"AzureMonitorTraceExporter shutting down\");\n return this.sender.shutdown();\n }\n}\n"]}
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["../../../src/export/trace.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAGrD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,wBAAwB;IACrE;;OAEG;IACK,UAAU,GAAG,KAAK,CAAC;IACV,MAAM,CAAa;IAC5B,0BAA0B,GAAY,0BAA0B,EAAE,CAAC;IAC1D,aAAa,CAAqB;IAEnD;;;OAGG;IACH,YAAY,UAAuC,EAAE;QACnD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACxF,IAAI,gBAAgB,EAAE,CAAC;YACrB,MAAM,sBAAsB,GAAG,sBAAsB,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAC9E,IAAI,CAAC,aAAa,GAAG,sBAAsB,CAAC,aAAa,CAAC;QAC5D,CAAC;QAED,IAAI,C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CAAC,kBAAkB,CAAC,CAAC;gBAChF,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAClC,SAAS,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC,CAAC,CAAC;YACH,cAAc,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;QAC/D,CAAC;QACD,oBAAoB;QACpB,cAAc,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { diag } from \"@opentelemetry/api\";\nimport type { ExportResult } from \"@opentelemetry/core\";\nimport { ExportResultCode } from \"@opentelemetry/core\";\nimport type { ReadableSpan, SpanExporter } from \"@opentelemetry/sdk-trace-base\";\nimport { AzureMonitorBaseExporter } from \"./base.js\";\nimport type { AzureMonitorExporterOptions } from \"../config.js\";\nimport type { TelemetryItem as Envelope } from \"../generated/index.js\";\nimport { readableSpanToEnvelope, spanEventsToEnvelopes } from \"../utils/spanUtils.js\";\nimport { createResourceMetricEnvelope, shouldCreateResourceMetric } from \"../utils/common.js\";\nimport { HttpSender } from \"../platform/index.js\";\nimport { ConnectionStringParser } from \"../utils/connectionStringParser.js\";\nimport { ENV_CONNECTION_STRING } from \"../Declarations/Constants.js\";\n\n/**\n * Azure Monitor OpenTelemetry Trace Exporter.\n */\nexport class AzureMonitorTraceExporter extends AzureMonitorBaseExporter implements SpanExporter {\n /**\n * Flag to determine if Exporter is shutdown.\n */\n private isShutdown = false;\n private readonly sender: HttpSender;\n private shouldCreateResourceMetric: boolean = shouldCreateResourceMetric();\n private readonly applicationId: string | undefined;\n\n /**\n * Initializes a new instance of the AzureMonitorTraceExporter class.\n * @param AzureExporterConfig - Exporter configuration.\n */\n constructor(options: AzureMonitorExporterOptions = {}) {\n super(options);\n\n const connectionString = options.connectionString || process.env[ENV_CONNECTION_STRING];\n if (connectionString) {\n const parsedConnectionString = ConnectionStringParser.parse(connectionString);\n this.applicationId = parsedConnectionString.applicationid;\n }\n\n this.sender = new HttpSender({\n endpointUrl: this.endpointUrl,\n instrumentationKey: this.instrumentationKey,\n trackStatsbeat: this.trackStatsbeat,\n exporterOptions: options,\n aadAudience: this.aadAudience,\n });\n diag.debug(\"AzureMonitorTraceExporter was successfully setup\");\n }\n\n /**\n * Export OpenTelemetry spans.\n * @param spans - Spans to export.\n * @param resultCallback - Result callback.\n */\n async export(\n spans: ReadableSpan[],\n resultCallback: (result: ExportResult) => void,\n ): Promise<void> {\n if (this.isShutdown) {\n diag.info(\"Exporter shut down. Failed to export spans.\");\n setTimeout(() => resultCallback({ code: ExportResultCode.FAILED }), 0);\n return;\n }\n\n diag.info(`Exporting ${spans.length} span(s). Converting to envelopes...`);\n\n if (spans.length > 0) {\n const envelopes: Envelope[] = [];\n const resourceMetricEnvelope = createResourceMetricEnvelope(\n spans[0].resource,\n this.instrumentationKey,\n this.applicationId,\n );\n if (resourceMetricEnvelope && this.shouldCreateResourceMetric) {\n envelopes.push(resourceMetricEnvelope);\n }\n spans.forEach((span) => {\n envelopes.push(readableSpanToEnvelope(span, this.instrumentationKey));\n const spanEventEnvelopes = spanEventsToEnvelopes(span, this.instrumentationKey);\n if (spanEventEnvelopes.length > 0) {\n envelopes.push(...spanEventEnvelopes);\n }\n });\n resultCallback(await this.sender.exportEnvelopes(envelopes));\n }\n // No data to export\n resultCallback({ code: ExportResultCode.SUCCESS });\n }\n\n /**\n * Shutdown AzureMonitorTraceExporter.\n */\n async shutdown(): Promise<void> {\n this.isShutdown = true;\n diag.info(\"AzureMonitorTraceExporter shutting down\");\n return this.sender.shutdown();\n }\n}\n"]}
@@ -22,7 +22,7 @@ export class ApplicationInsightsClient extends coreClient.ServiceClient {
22
22
  const defaults = {
23
23
  requestContentType: "application/json; charset=utf-8",
24
24
  };
25
- const packageDetails = `azsdk-js-monitor-opentelemetry-exporter/1.0.0-beta.35`;
25
+ const packageDetails = `azsdk-js-monitor-opentelemetry-exporter/1.0.0-beta.37`;
26
26
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
27
27
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
28
28
  : `${packageDetails}`;
@@ -1 +1 @@
1
- {"version":3,"file":"applicationInsightsClient.js","sourceRoot":"","sources":["../../../src/generated/applicationInsightsClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAQ/C,MAAM,OAAO,yBAA0B,SAAQ,UAAU,CAAC,aAAa;IACrE,IAAI,CAAS;IAEb;;;OAGG;IACH,YAAY,OAAiD;QAC3D,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAA4C;YACxD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,uDAAuD,CAAC;QAC/E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,GAAG;YAC1B,GAAG,QAAQ;YACX,GAAG,OAAO;YACV,g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C,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n ApplicationInsightsClientOptionalParams,\n TelemetryItem,\n TrackOptionalParams,\n TrackOperationResponse,\n} from \"./models/index.js\";\n\nexport class ApplicationInsightsClient extends coreClient.ServiceClient {\n host: string;\n\n /**\n * Initializes a new instance of the ApplicationInsightsClient class.\n * @param options The parameter options\n */\n constructor(options?: ApplicationInsightsClientOptionalParams) {\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: ApplicationInsightsClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-monitor-opentelemetry-exporter/1.0.0-beta.35`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{Host}/v2.1\",\n };\n super(optionsWithDefaults);\n\n // Assigning values to Constant parameters\n this.host = options.host || \"https://dc.services.visualstudio.com\";\n }\n\n /**\n * This operation sends a sequence of telemetry events that will be monitored by Azure Monitor.\n * @param body The list of telemetry events to track.\n * @param options The options parameters.\n */\n track(\n body: TelemetryItem[],\n options?: TrackOptionalParams,\n ): Promise<TrackOperationResponse> {\n return this.sendOperationRequest({ body, options }, trackOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst trackOperationSpec: coreClient.OperationSpec = {\n path: \"/track\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.TrackResponse,\n },\n 206: {\n bodyMapper: Mappers.TrackResponse,\n },\n 400: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n 402: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n 429: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n 500: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n 503: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\n"]}
1
+ {"version":3,"file":"applicationInsightsClient.js","sourceRoot":"","sources":["../../../src/generated/applicationInsightsClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAQ/C,MAAM,OAAO,yBAA0B,SAAQ,UAAU,CAAC,aAAa;IACrE,IAAI,CAAS;IAEb;;;OAGG;IACH,YAAY,OAAiD;QAC3D,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAA4C;YACxD,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,uDAAuD,CAAC;QAC/E,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAA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,IAAI;IAC5B,aAAa,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;IAChC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n ApplicationInsightsClientOptionalParams,\n TelemetryItem,\n TrackOptionalParams,\n TrackOperationResponse,\n} from \"./models/index.js\";\n\nexport class ApplicationInsightsClient extends coreClient.ServiceClient {\n host: string;\n\n /**\n * Initializes a new instance of the ApplicationInsightsClient class.\n * @param options The parameter options\n */\n constructor(options?: ApplicationInsightsClientOptionalParams) {\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: ApplicationInsightsClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n };\n\n const packageDetails = `azsdk-js-monitor-opentelemetry-exporter/1.0.0-beta.37`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix,\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{Host}/v2.1\",\n };\n super(optionsWithDefaults);\n\n // Assigning values to Constant parameters\n this.host = options.host || \"https://dc.services.visualstudio.com\";\n }\n\n /**\n * This operation sends a sequence of telemetry events that will be monitored by Azure Monitor.\n * @param body The list of telemetry events to track.\n * @param options The options parameters.\n */\n track(\n body: TelemetryItem[],\n options?: TrackOptionalParams,\n ): Promise<TrackOperationResponse> {\n return this.sendOperationRequest({ body, options }, trackOperationSpec);\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst trackOperationSpec: coreClient.OperationSpec = {\n path: \"/track\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.TrackResponse,\n },\n 206: {\n bodyMapper: Mappers.TrackResponse,\n },\n 400: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n 402: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n 429: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n 500: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n 503: {\n bodyMapper: Mappers.TrackResponse,\n isError: true,\n },\n },\n requestBody: Parameters.body,\n urlParameters: [Parameters.host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/models/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAEjD,6CAA6C;AAC7C,MAAM,WAAW,aAAa;IAC5B,oKAAoK;IACpK,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,6kBAA6kB;IAC7kB,IAAI,EAAE,IAAI,CAAC;IACX,iHAAiH;IACjH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8GAA8G;IAC9G,IAAI,CAAC,EAAE;QAAE,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC1C,2BAA2B;IAC3B,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,gEAAgE;AAChE,MAAM,WAAW,WAAW;IAC1B,6GAA6G;IAC7G,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