@opentelemetry/otlp-exporter-base 0.220.0 → 0.221.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/build/esm/ExporterMetrics.d.ts +24 -0
  2. package/build/esm/ExporterMetrics.js +104 -0
  3. package/build/esm/ExporterMetrics.js.map +1 -0
  4. package/build/esm/OTLPExporterBase.d.ts +2 -0
  5. package/build/esm/OTLPExporterBase.js +3 -0
  6. package/build/esm/OTLPExporterBase.js.map +1 -1
  7. package/build/esm/configuration/create-legacy-browser-delegate.d.ts +8 -2
  8. package/build/esm/configuration/create-legacy-browser-delegate.js +36 -2
  9. package/build/esm/configuration/create-legacy-browser-delegate.js.map +1 -1
  10. package/build/esm/configuration/legacy-base-configuration.d.ts +6 -0
  11. package/build/esm/configuration/legacy-base-configuration.js.map +1 -1
  12. package/build/esm/index-browser-http.d.ts +1 -1
  13. package/build/esm/index-browser-http.js +1 -1
  14. package/build/esm/index-browser-http.js.map +1 -1
  15. package/build/esm/index-node-http.d.ts +1 -1
  16. package/build/esm/index-node-http.js +1 -1
  17. package/build/esm/index-node-http.js.map +1 -1
  18. package/build/esm/index.d.ts +1 -0
  19. package/build/esm/index.js +1 -0
  20. package/build/esm/index.js.map +1 -1
  21. package/build/esm/otlp-browser-http-export-delegate.d.ts +3 -2
  22. package/build/esm/otlp-browser-http-export-delegate.js +8 -4
  23. package/build/esm/otlp-browser-http-export-delegate.js.map +1 -1
  24. package/build/esm/otlp-export-delegate.d.ts +3 -0
  25. package/build/esm/otlp-export-delegate.js +19 -6
  26. package/build/esm/otlp-export-delegate.js.map +1 -1
  27. package/build/esm/otlp-http-export-delegate.d.ts +5 -2
  28. package/build/esm/otlp-http-export-delegate.js +30 -1
  29. package/build/esm/otlp-http-export-delegate.js.map +1 -1
  30. package/build/esm/otlp-network-export-delegate.d.ts +2 -1
  31. package/build/esm/otlp-network-export-delegate.js +2 -1
  32. package/build/esm/otlp-network-export-delegate.js.map +1 -1
  33. package/build/esm/semconv.d.ts +91 -0
  34. package/build/esm/semconv.js +100 -0
  35. package/build/esm/semconv.js.map +1 -0
  36. package/build/esm/version.d.ts +1 -1
  37. package/build/esm/version.js +1 -1
  38. package/build/esm/version.js.map +1 -1
  39. package/build/esnext/ExporterMetrics.d.ts +24 -0
  40. package/build/esnext/ExporterMetrics.js +104 -0
  41. package/build/esnext/ExporterMetrics.js.map +1 -0
  42. package/build/esnext/OTLPExporterBase.d.ts +2 -0
  43. package/build/esnext/OTLPExporterBase.js +3 -0
  44. package/build/esnext/OTLPExporterBase.js.map +1 -1
  45. package/build/esnext/configuration/create-legacy-browser-delegate.d.ts +8 -2
  46. package/build/esnext/configuration/create-legacy-browser-delegate.js +36 -2
  47. package/build/esnext/configuration/create-legacy-browser-delegate.js.map +1 -1
  48. package/build/esnext/configuration/legacy-base-configuration.d.ts +6 -0
  49. package/build/esnext/configuration/legacy-base-configuration.js.map +1 -1
  50. package/build/esnext/index-browser-http.d.ts +1 -1
  51. package/build/esnext/index-browser-http.js +1 -1
  52. package/build/esnext/index-browser-http.js.map +1 -1
  53. package/build/esnext/index-node-http.d.ts +1 -1
  54. package/build/esnext/index-node-http.js +1 -1
  55. package/build/esnext/index-node-http.js.map +1 -1
  56. package/build/esnext/index.d.ts +1 -0
  57. package/build/esnext/index.js +1 -0
  58. package/build/esnext/index.js.map +1 -1
  59. package/build/esnext/otlp-browser-http-export-delegate.d.ts +3 -2
  60. package/build/esnext/otlp-browser-http-export-delegate.js +8 -4
  61. package/build/esnext/otlp-browser-http-export-delegate.js.map +1 -1
  62. package/build/esnext/otlp-export-delegate.d.ts +3 -0
  63. package/build/esnext/otlp-export-delegate.js +19 -6
  64. package/build/esnext/otlp-export-delegate.js.map +1 -1
  65. package/build/esnext/otlp-http-export-delegate.d.ts +5 -2
  66. package/build/esnext/otlp-http-export-delegate.js +30 -1
  67. package/build/esnext/otlp-http-export-delegate.js.map +1 -1
  68. package/build/esnext/otlp-network-export-delegate.d.ts +2 -1
  69. package/build/esnext/otlp-network-export-delegate.js +2 -1
  70. package/build/esnext/otlp-network-export-delegate.js.map +1 -1
  71. package/build/esnext/semconv.d.ts +91 -0
  72. package/build/esnext/semconv.js +100 -0
  73. package/build/esnext/semconv.js.map +1 -0
  74. package/build/esnext/version.d.ts +1 -1
  75. package/build/esnext/version.js +1 -1
  76. package/build/esnext/version.js.map +1 -1
  77. package/build/src/ExporterMetrics.d.ts +24 -0
  78. package/build/src/ExporterMetrics.js +108 -0
  79. package/build/src/ExporterMetrics.js.map +1 -0
  80. package/build/src/OTLPExporterBase.d.ts +2 -0
  81. package/build/src/OTLPExporterBase.js +3 -0
  82. package/build/src/OTLPExporterBase.js.map +1 -1
  83. package/build/src/configuration/create-legacy-browser-delegate.d.ts +8 -2
  84. package/build/src/configuration/create-legacy-browser-delegate.js +38 -3
  85. package/build/src/configuration/create-legacy-browser-delegate.js.map +1 -1
  86. package/build/src/configuration/legacy-base-configuration.d.ts +6 -0
  87. package/build/src/configuration/legacy-base-configuration.js.map +1 -1
  88. package/build/src/configuration/legacy-node-configuration.js +1 -1
  89. package/build/src/configuration/legacy-node-configuration.js.map +1 -1
  90. package/build/src/index-browser-http.d.ts +1 -1
  91. package/build/src/index-browser-http.js +2 -1
  92. package/build/src/index-browser-http.js.map +1 -1
  93. package/build/src/index-node-http.d.ts +1 -1
  94. package/build/src/index-node-http.js +2 -1
  95. package/build/src/index-node-http.js.map +1 -1
  96. package/build/src/index.d.ts +1 -0
  97. package/build/src/index.js +3 -1
  98. package/build/src/index.js.map +1 -1
  99. package/build/src/otlp-browser-http-export-delegate.d.ts +3 -2
  100. package/build/src/otlp-browser-http-export-delegate.js +8 -4
  101. package/build/src/otlp-browser-http-export-delegate.js.map +1 -1
  102. package/build/src/otlp-export-delegate.d.ts +3 -0
  103. package/build/src/otlp-export-delegate.js +19 -6
  104. package/build/src/otlp-export-delegate.js.map +1 -1
  105. package/build/src/otlp-http-export-delegate.d.ts +5 -2
  106. package/build/src/otlp-http-export-delegate.js +32 -2
  107. package/build/src/otlp-http-export-delegate.js.map +1 -1
  108. package/build/src/otlp-network-export-delegate.d.ts +2 -1
  109. package/build/src/otlp-network-export-delegate.js +2 -1
  110. package/build/src/otlp-network-export-delegate.js.map +1 -1
  111. package/build/src/semconv.d.ts +91 -0
  112. package/build/src/semconv.js +103 -0
  113. package/build/src/semconv.js.map +1 -0
  114. package/build/src/version.d.ts +1 -1
  115. package/build/src/version.js +1 -1
  116. package/build/src/version.js.map +1 -1
  117. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-export-delegate.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,8CAAuD;AAIvD,mCAA4C;AAE5C,yEAAwF;AAExF,4CAA0C;AAc1C,MAAM,kBAAkB;IAGd,WAAW,CAAa;IACxB,UAAU,CAAqB;IAC/B,WAAW,CAAkC;IAC7C,gBAAgB,CAAiC;IACjD,aAAa,CAAwB;IACrC,QAAQ,CAAS;IAEzB,YACE,SAA6B,EAC7B,UAA2C,EAC3C,eAA+C,EAC/C,YAAmC,EACnC,OAAe;QAEf,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,WAAW,GAAG,UAAI,CAAC,qBAAqB,CAAC;YAC5C,SAAS,EAAE,oBAAoB;SAChC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CACJ,sBAAgC,EAChC,cAA8C;QAE9C,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,kBAAkB,EAAE,sBAAsB,CAAC,CAAC;QAEnE,yDAAyD;QACzD,IAAI,IAAI,CAAC,aAAa,CAAC,e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,KAAK;iBACtB,CAAC,CAAC;gBACH,OAAO;aACR;iBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,WAAW,EAAE;gBAC1C,cAAc,CAAC;oBACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;oBAC7B,KAAK,EACH,QAAQ,CAAC,KAAK;wBACd,IAAI,yBAAiB,CAAC,qCAAqC,CAAC;iBAC/D,CAAC,CAAC;aACJ;iBAAM;gBACL,cAAc,CAAC;oBACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;oBAC7B,KAAK,EAAE,IAAI,yBAAiB,CAAC,kCAAkC,CAAC;iBACjE,CAAC,CAAC;aACJ;QACH,CAAC,EACD,MAAM,CAAC,EAAE,CACP,cAAc,CAAC;YACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;YAC7B,KAAK,EAAE,MAAM;SACd,CAAC,CACL,CACF,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC3C,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAED;;;GAGG;AACH,SAAgB,wBAAwB,CACtC,UAIC,EACD,QAA6B;IAE7B,OAAO,IAAI,kBAAkB,CAC3B,UAAU,CAAC,SAAS,EACpB,UAAU,CAAC,UAAU,EACrB,IAAA,qEAA0C,GAAE,EAC5C,UAAU,CAAC,cAAc,EACzB,QAAQ,CAAC,OAAO,CACjB,CAAC;AACJ,CAAC;AAfD,4DAeC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ExportResult } from '@opentelemetry/core';\nimport { ExportResultCode } from '@opentelemetry/core';\nimport type { IExporterTransport } from './exporter-transport';\nimport type { IExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterError } from './types';\nimport type { IOtlpResponseHandler } from './response-handler';\nimport { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';\nimport type { DiagLogger } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\n\n/**\n * Internally shared export logic for OTLP.\n */\nexport interface IOtlpExportDelegate<Internal> {\n export(\n internalRepresentation: Internal,\n resultCallback: (result: ExportResult) => void\n ): void;\n forceFlush(): Promise<void>;\n shutdown(): Promise<void>;\n}\n\nclass OTLPExportDelegate<Internal, Response>\n implements IOtlpExportDelegate<Internal>\n{\n private _diagLogger: DiagLogger;\n private _transport: IExporterTransport;\n private _serializer: ISerializer<Internal, Response>;\n private _responseHandler: IOtlpResponseHandler<Response>;\n private _promiseQueue: IExportPromiseHandler;\n private _timeout: number;\n\n constructor(\n transport: IExporterTransport,\n serializer: ISerializer<Internal, Response>,\n responseHandler: IOtlpResponseHandler<Response>,\n promiseQueue: IExportPromiseHandler,\n timeout: number\n ) {\n this._transport = transport;\n this._serializer = serializer;\n this._responseHandler = responseHandler;\n this._promiseQueue = promiseQueue;\n this._timeout = timeout;\n this._diagLogger = diag.createComponentLogger({\n namespace: 'OTLPExportDelegate',\n });\n }\n\n export(\n internalRepresentation: Internal,\n resultCallback: (result: ExportResult) => void\n ): void {\n this._diagLogger.debug('items to be sent', internalRepresentation);\n\n // don't do any work if too many exports are in progress.\n if (this._promiseQueue.hasReachedLimit()) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Concurrent export limit reached'),\n });\n return;\n }\n\n const serializedRequest = this._serializer.serializeRequest(\n internalRepresentation\n );\n\n if (serializedRequest == null) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Nothing to send'),\n });\n return;\n }\n\n this._promiseQueue.pushPromise(\n this._transport.send(serializedRequest, this._timeout).then(\n response => {\n if (response.status === 'success') {\n if (response.data != null) {\n try {\n this._responseHandler.handleResponse(\n this._serializer.deserializeResponse(response.data)\n );\n } catch (e) {\n this._diagLogger.warn(\n 'Export succeeded but could not deserialize response - is the response specification compliant?',\n e,\n response.data\n );\n }\n }\n // No matter the response, we can consider the export still successful.\n resultCallback({\n code: ExportResultCode.SUCCESS,\n });\n return;\n } else if (response.status === 'failure' && response.error) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: response.error,\n });\n return;\n } else if (response.status === 'retryable') {\n resultCallback({\n code: ExportResultCode.FAILED,\n error:\n response.error ??\n new OTLPExporterError('Export failed with retryable status'),\n });\n } else {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new OTLPExporterError('Export failed with unknown error'),\n });\n }\n },\n reason =>\n resultCallback({\n code: ExportResultCode.FAILED,\n error: reason,\n })\n )\n );\n }\n\n forceFlush(): Promise<void> {\n return this._promiseQueue.awaitAll();\n }\n\n async shutdown(): Promise<void> {\n this._diagLogger.debug('shutdown started');\n await this.forceFlush();\n this._transport.shutdown();\n }\n}\n\n/**\n * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all\n * signals.\n */\nexport function createOtlpExportDelegate<Internal, Response>(\n components: {\n transport: IExporterTransport;\n serializer: ISerializer<Internal, Response>;\n promiseHandler: IExportPromiseHandler;\n },\n settings: { timeout: number }\n): IOtlpExportDelegate<Internal> {\n return new OTLPExportDelegate(\n components.transport,\n components.serializer,\n createLoggingPartialSuccessResponseHandler(),\n components.promiseHandler,\n settings.timeout\n );\n}\n"]}
1
+ {"version":3,"file":"otlp-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-export-delegate.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,8CAAuD;AAIvD,mCAA4C;AAE5C,yEAAwF;AAExF,4CAA0C;AAgB1C,MAAM,kBAAkB;IAGd,QAAQ,CAA4B;IACpC,WAAW,CAAa;IACxB,UAAU,CAAqB;IAC/B,WAAW,CAAkC;IAC7C,gBAAgB,CAAiC;IACjD,a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M;oBAC7B,KAAK,EAAE,IAAI,yBAAiB,CAAC,kCAAkC,CAAC;iBACjE,CAAC,CAAC;aACJ;QACH,CAAC,EACD,MAAM,CAAC,EAAE;YACP,YAAY,CAAC,MAAM,CAAC,CAAC;YACrB,cAAc,CAAC;gBACb,IAAI,EAAE,uBAAgB,CAAC,MAAM;gBAC7B,KAAK,EAAE,MAAM;aACd,CAAC,CAAC;QACL,CAAC,CACF,CACF,CAAC;IACJ,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;IACvC,CAAC;IAED,UAAU,CAAC,OAAkC;QAC3C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAC3C,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;CACF;AAED;;;GAGG;AACH,SAAgB,wBAAwB,CACtC,UAKC,EACD,QAA6B;IAE7B,OAAO,IAAI,kBAAkB,CAC3B,UAAU,CAAC,SAAS,EACpB,UAAU,CAAC,UAAU,EACrB,IAAA,qEAA0C,GAAE,EAC5C,UAAU,CAAC,cAAc,EACzB,UAAU,CAAC,OAAO,EAClB,QAAQ,CAAC,OAAO,CACjB,CAAC;AACJ,CAAC;AAjBD,4DAiBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ExportResult } from '@opentelemetry/core';\nimport { ExportResultCode } from '@opentelemetry/core';\nimport type { IExporterTransport } from './exporter-transport';\nimport type { IExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { OTLPExporterError } from './types';\nimport type { IOtlpResponseHandler } from './response-handler';\nimport { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';\nimport type { DiagLogger } from '@opentelemetry/api';\nimport { diag } from '@opentelemetry/api';\nimport { type ExporterMetrics } from './ExporterMetrics';\n\n/**\n * Internally shared export logic for OTLP.\n */\nexport interface IOtlpExportDelegate<Internal> {\n export(\n internalRepresentation: Internal,\n resultCallback: (result: ExportResult) => void\n ): void;\n forceFlush(): Promise<void>;\n shutdown(): Promise<void>;\n setMetrics(metrics: ExporterMetrics<Internal>): void;\n}\n\nclass OTLPExportDelegate<Internal, Response>\n implements IOtlpExportDelegate<Internal>\n{\n private _metrics: ExporterMetrics<Internal>;\n private _diagLogger: DiagLogger;\n private _transport: IExporterTransport;\n private _serializer: ISerializer<Internal, Response>;\n private _responseHandler: IOtlpResponseHandler<Response>;\n private _promiseQueue: IExportPromiseHandler;\n private _timeout: number;\n\n constructor(\n transport: IExporterTransport,\n serializer: ISerializer<Internal, Response>,\n responseHandler: IOtlpResponseHandler<Response>,\n promiseQueue: IExportPromiseHandler,\n metrics: ExporterMetrics<Internal>,\n timeout: number\n ) {\n this._transport = transport;\n this._serializer = serializer;\n this._responseHandler = responseHandler;\n this._promiseQueue = promiseQueue;\n this._timeout = timeout;\n this._diagLogger = diag.createComponentLogger({\n namespace: 'OTLPExportDelegate',\n });\n this._metrics = metrics;\n }\n\n export(\n internalRepresentation: Internal,\n resultCallback: (result: ExportResult) => void\n ): void {\n this._diagLogger.debug('items to be sent', internalRepresentation);\n\n // don't do any work if too many exports are in progress.\n if (this._promiseQueue.hasReachedLimit()) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Concurrent export limit reached'),\n });\n return;\n }\n\n const serializedRequest = this._serializer.serializeRequest(\n internalRepresentation\n );\n\n if (serializedRequest == null) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Nothing to send'),\n });\n return;\n }\n\n const finishExport = this._metrics.startExport(internalRepresentation);\n this._promiseQueue.pushPromise(\n this._transport.send(serializedRequest, this._timeout).then(\n response => {\n if (response.status === 'success') {\n finishExport(undefined);\n if (response.data != null) {\n try {\n this._responseHandler.handleResponse(\n this._serializer.deserializeResponse(response.data)\n );\n } catch (e) {\n this._diagLogger.warn(\n 'Export succeeded but could not deserialize response - is the response specification compliant?',\n e,\n response.data\n );\n }\n }\n // No matter the response, we can consider the export still successful.\n resultCallback({\n code: ExportResultCode.SUCCESS,\n });\n return;\n } else if (response.status === 'failure' && response.error) {\n finishExport(response.error);\n resultCallback({\n code: ExportResultCode.FAILED,\n error: response.error,\n });\n return;\n } else if (response.status === 'retryable') {\n finishExport('export_max_retries');\n resultCallback({\n code: ExportResultCode.FAILED,\n error:\n response.error ??\n new OTLPExporterError('Export failed with retryable status'),\n });\n } else {\n finishExport('export_failed');\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new OTLPExporterError('Export failed with unknown error'),\n });\n }\n },\n reason => {\n finishExport(reason);\n resultCallback({\n code: ExportResultCode.FAILED,\n error: reason,\n });\n }\n )\n );\n }\n\n forceFlush(): Promise<void> {\n return this._promiseQueue.awaitAll();\n }\n\n setMetrics(metrics: ExporterMetrics<Internal>) {\n this._metrics = metrics;\n }\n\n async shutdown(): Promise<void> {\n this._diagLogger.debug('shutdown started');\n await this.forceFlush();\n this._transport.shutdown();\n }\n}\n\n/**\n * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all\n * signals.\n */\nexport function createOtlpExportDelegate<Internal, Response>(\n components: {\n transport: IExporterTransport;\n serializer: ISerializer<Internal, Response>;\n promiseHandler: IExportPromiseHandler;\n metrics: ExporterMetrics<Internal>;\n },\n settings: { timeout: number }\n): IOtlpExportDelegate<Internal> {\n return new OTLPExportDelegate(\n components.transport,\n components.serializer,\n createLoggingPartialSuccessResponseHandler(),\n components.promiseHandler,\n components.metrics,\n settings.timeout\n );\n}\n"]}
@@ -1,5 +1,8 @@
1
+ import type { MeterProvider } from '@opentelemetry/api';
1
2
  import type { IOtlpExportDelegate } from './otlp-export-delegate';
2
- import type { ISerializer } from '@opentelemetry/otlp-transformer';
3
+ import type { IExporterMetricsHelper, ISerializer } from '@opentelemetry/otlp-transformer';
3
4
  import type { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';
4
- export declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpNodeHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
5
+ import { ExporterMetrics } from './ExporterMetrics';
6
+ export declare function createOtlpHttpExporterMetrics<Internal>(metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, url: string | undefined, meterProvider: MeterProvider | undefined): ExporterMetrics<Internal>;
7
+ export declare function createOtlpHttpExportDelegate<Internal, Response>(options: OtlpNodeHttpConfiguration, serializer: ISerializer<Internal, Response>, metricsComponentType: string, exporterMetricsHelper: IExporterMetricsHelper<Internal>, meterProvider: MeterProvider | undefined): IOtlpExportDelegate<Internal>;
5
8
  //# sourceMappingURL=otlp-http-export-delegate.d.ts.map
@@ -1,17 +1,47 @@
1
1
  "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
2
6
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createOtlpHttpExportDelegate = void 0;
7
+ exports.createOtlpHttpExportDelegate = exports.createOtlpHttpExporterMetrics = void 0;
4
8
  const otlp_export_delegate_1 = require("./otlp-export-delegate");
5
9
  const http_exporter_transport_1 = require("./transport/http-exporter-transport");
6
10
  const bounded_queue_export_promise_handler_1 = require("./bounded-queue-export-promise-handler");
7
11
  const retrying_transport_1 = require("./retrying-transport");
8
- function createOtlpHttpExportDelegate(options, serializer) {
12
+ const types_1 = require("./types");
13
+ const semconv_1 = require("./semconv");
14
+ const ExporterMetrics_1 = require("./ExporterMetrics");
15
+ function createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, url, meterProvider) {
16
+ return new ExporterMetrics_1.ExporterMetrics({
17
+ componentType: metricsComponentType,
18
+ metricsHelper: exporterMetricsHelper,
19
+ url,
20
+ meterProvider,
21
+ responseAttributesFromError: (error) => {
22
+ if (!error) {
23
+ return {
24
+ [semconv_1.ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,
25
+ };
26
+ }
27
+ if (!(error instanceof types_1.OTLPExporterError)) {
28
+ return {};
29
+ }
30
+ return {
31
+ [semconv_1.ATTR_HTTP_RESPONSE_STATUS_CODE]: error.code,
32
+ };
33
+ },
34
+ });
35
+ }
36
+ exports.createOtlpHttpExporterMetrics = createOtlpHttpExporterMetrics;
37
+ function createOtlpHttpExportDelegate(options, serializer, metricsComponentType, exporterMetricsHelper, meterProvider) {
9
38
  return (0, otlp_export_delegate_1.createOtlpExportDelegate)({
10
39
  transport: (0, retrying_transport_1.createRetryingTransport)({
11
40
  transport: (0, http_exporter_transport_1.createHttpExporterTransport)(options),
12
41
  }),
13
42
  serializer: serializer,
14
43
  promiseHandler: (0, bounded_queue_export_promise_handler_1.createBoundedQueueExportPromiseHandler)(options),
44
+ metrics: createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, options.url, meterProvider),
15
45
  }, { timeout: options.timeoutMillis });
16
46
  }
17
47
  exports.createOtlpHttpExportDelegate = createOtlpHttpExportDelegate;
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-http-export-delegate.ts"],"names":[],"mappings":";;;AAKA,iEAAkE;AAElE,iFAAkF;AAClF,iGAAgG;AAChG,6DAA+D;AAG/D,SAAgB,4BAA4B,CAC1C,OAAkC,EAClC,UAA2C;IAE3C,OAAO,IAAA,+CAAwB,EAC7B;QACE,SAAS,EAAE,IAAA,4CAAuB,EAAC;YACjC,SAAS,EAAE,IAAA,qDAA2B,EAAC,OAAO,CAAC;SAChD,CAAC;QACF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,IAAA,6EAAsC,EAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC;AAdD,oEAcC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport { createHttpExporterTransport } from './transport/http-exporter-transport';\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport { createRetryingTransport } from './retrying-transport';\nimport type { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';\n\nexport function createOtlpHttpExportDelegate<Internal, Response>(\n options: OtlpNodeHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpExportDelegate(\n {\n transport: createRetryingTransport({\n transport: createHttpExporterTransport(options),\n }),\n serializer: serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n },\n { timeout: options.timeoutMillis }\n );\n}\n"]}
1
+ {"version":3,"file":"otlp-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-http-export-delegate.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,iEAAkE;AAKlE,iFAAkF;AAClF,iGAAgG;AAChG,6DAA+D;AAE/D,mCAA4C;AAC5C,uCAA2D;AAC3D,uDAAoD;AAEpD,SAAgB,6BAA6B,CAC3C,oBAA4B,EAC5B,qBAAuD,EACvD,GAAuB,EACvB,aAAwC;IAExC,OAAO,IAAI,iCAAe,CAAC;QACzB,aAAa,EAAE,oBAAoB;QACnC,aAAa,EAAE,qBAAqB;QACpC,GAAG;QACH,aAAa;QACb,2BAA2B,EAAE,CAAC,KAAiC,EAAE,EAAE;YACjE,IAAI,CAAC,KAAK,EAAE;gBACV,OAAO;oBACL,CAAC,wCAA8B,CAAC,EAAE,GAAG;iBACtC,CAAC;aACH;YACD,IAAI,CAAC,CAAC,KAAK,YAAY,yBAAiB,CAAC,EAAE;gBACzC,OAAO,EAAE,CAAC;aACX;YACD,OAAO;gBACL,CAAC,wCAA8B,CAAC,EAAE,KAAK,CAAC,IAAI;aAC7C,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAzBD,sEAyBC;AAED,SAAgB,4BAA4B,CAC1C,OAAkC,EAClC,UAA2C,EAC3C,oBAA4B,EAC5B,qBAAuD,EACvD,aAAwC;IAExC,OAAO,IAAA,+CAAwB,EAC7B;QACE,SAAS,EAAE,IAAA,4CAAuB,EAAC;YACjC,SAAS,EAAE,IAAA,qDAA2B,EAAC,OAAO,CAAC;SAChD,CAAC;QACF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,IAAA,6EAAsC,EAAC,OAAO,CAAC;QAC/D,OAAO,EAAE,6BAA6B,CACpC,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,CAAC,GAAG,EACX,aAAa,CACd;KACF,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC;AAvBD,oEAuBC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { MeterProvider } from '@opentelemetry/api';\n\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\nimport type {\n IExporterMetricsHelper,\n ISerializer,\n} from '@opentelemetry/otlp-transformer';\nimport { createHttpExporterTransport } from './transport/http-exporter-transport';\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport { createRetryingTransport } from './retrying-transport';\nimport type { OtlpNodeHttpConfiguration } from './configuration/otlp-node-http-configuration';\nimport { OTLPExporterError } from './types';\nimport { ATTR_HTTP_RESPONSE_STATUS_CODE } from './semconv';\nimport { ExporterMetrics } from './ExporterMetrics';\n\nexport function createOtlpHttpExporterMetrics<Internal>(\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n url: string | undefined,\n meterProvider: MeterProvider | undefined\n): ExporterMetrics<Internal> {\n return new ExporterMetrics({\n componentType: metricsComponentType,\n metricsHelper: exporterMetricsHelper,\n url,\n meterProvider,\n responseAttributesFromError: (error: Error | string | undefined) => {\n if (!error) {\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,\n };\n }\n if (!(error instanceof OTLPExporterError)) {\n return {};\n }\n return {\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: error.code,\n };\n },\n });\n}\n\nexport function createOtlpHttpExportDelegate<Internal, Response>(\n options: OtlpNodeHttpConfiguration,\n serializer: ISerializer<Internal, Response>,\n metricsComponentType: string,\n exporterMetricsHelper: IExporterMetricsHelper<Internal>,\n meterProvider: MeterProvider | undefined\n): IOtlpExportDelegate<Internal> {\n return createOtlpExportDelegate(\n {\n transport: createRetryingTransport({\n transport: createHttpExporterTransport(options),\n }),\n serializer: serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n metrics: createOtlpHttpExporterMetrics(\n metricsComponentType,\n exporterMetricsHelper,\n options.url,\n meterProvider\n ),\n },\n { timeout: options.timeoutMillis }\n );\n}\n"]}
@@ -2,5 +2,6 @@ import type { OtlpSharedConfiguration } from './configuration/shared-configurati
2
2
  import type { ISerializer } from '@opentelemetry/otlp-transformer';
3
3
  import type { IExporterTransport } from './exporter-transport';
4
4
  import type { IOtlpExportDelegate } from './otlp-export-delegate';
5
- export declare function createOtlpNetworkExportDelegate<Internal, Response>(options: OtlpSharedConfiguration, serializer: ISerializer<Internal, Response>, transport: IExporterTransport): IOtlpExportDelegate<Internal>;
5
+ import { type ExporterMetrics } from './ExporterMetrics';
6
+ export declare function createOtlpNetworkExportDelegate<Internal, Response>(options: OtlpSharedConfiguration, serializer: ISerializer<Internal, Response>, metrics: ExporterMetrics<Internal>, transport: IExporterTransport): IOtlpExportDelegate<Internal>;
6
7
  //# sourceMappingURL=otlp-network-export-delegate.d.ts.map
@@ -7,11 +7,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.createOtlpNetworkExportDelegate = void 0;
8
8
  const bounded_queue_export_promise_handler_1 = require("./bounded-queue-export-promise-handler");
9
9
  const otlp_export_delegate_1 = require("./otlp-export-delegate");
10
- function createOtlpNetworkExportDelegate(options, serializer, transport) {
10
+ function createOtlpNetworkExportDelegate(options, serializer, metrics, transport) {
11
11
  return (0, otlp_export_delegate_1.createOtlpExportDelegate)({
12
12
  transport: transport,
13
13
  serializer,
14
14
  promiseHandler: (0, bounded_queue_export_promise_handler_1.createBoundedQueueExportPromiseHandler)(options),
15
+ metrics,
15
16
  }, { timeout: options.timeoutMillis });
16
17
  }
17
18
  exports.createOtlpNetworkExportDelegate = createOtlpNetworkExportDelegate;
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-network-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-network-export-delegate.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iGAAgG;AAKhG,iEAAkE;AAElE,SAAgB,+BAA+B,CAC7C,OAAgC,EAChC,UAA2C,EAC3C,SAA6B;IAE7B,OAAO,IAAA,+CAAwB,EAC7B;QACE,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,cAAc,EAAE,IAAA,6EAAsC,EAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC;AAbD,0EAaC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport type { IExporterTransport } from './exporter-transport';\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\n\nexport function createOtlpNetworkExportDelegate<Internal, Response>(\n options: OtlpSharedConfiguration,\n serializer: ISerializer<Internal, Response>,\n transport: IExporterTransport\n): IOtlpExportDelegate<Internal> {\n return createOtlpExportDelegate(\n {\n transport: transport,\n serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n },\n { timeout: options.timeoutMillis }\n );\n}\n"]}
1
+ {"version":3,"file":"otlp-network-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-network-export-delegate.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iGAAgG;AAKhG,iEAAkE;AAGlE,SAAgB,+BAA+B,CAC7C,OAAgC,EAChC,UAA2C,EAC3C,OAAkC,EAClC,SAA6B;IAE7B,OAAO,IAAA,+CAAwB,EAC7B;QACE,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,cAAc,EAAE,IAAA,6EAAsC,EAAC,OAAO,CAAC;QAC/D,OAAO;KACR,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC;AAfD,0EAeC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport type { IExporterTransport } from './exporter-transport';\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\nimport { type ExporterMetrics } from './ExporterMetrics';\n\nexport function createOtlpNetworkExportDelegate<Internal, Response>(\n options: OtlpSharedConfiguration,\n serializer: ISerializer<Internal, Response>,\n metrics: ExporterMetrics<Internal>,\n transport: IExporterTransport\n): IOtlpExportDelegate<Internal> {\n return createOtlpExportDelegate(\n {\n transport: transport,\n serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n metrics,\n },\n { timeout: options.timeoutMillis }\n );\n}\n"]}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
3
+ *
4
+ * @example 200
5
+ */
6
+ export declare const ATTR_HTTP_RESPONSE_STATUS_CODE: "http.response.status_code";
7
+ /**
8
+ * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.
9
+ *
10
+ * @example otlp_grpc_span_exporter/0
11
+ * @example custom-name
12
+ *
13
+ * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.
14
+ * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.
15
+ *
16
+ * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.
17
+ * Hereby `otel.component.type` refers to the corresponding attribute value of the component.
18
+ *
19
+ * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.
20
+ * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an
21
+ * instance of the given component type is started.
22
+ *
23
+ * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`
24
+ * as `otel.component.name`, the second one `batching_span_processor/1` and so on.
25
+ * These values will therefore be reused in the case of an application restart.
26
+ *
27
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
28
+ */
29
+ export declare const ATTR_OTEL_COMPONENT_NAME: "otel.component.name";
30
+ /**
31
+ * A name identifying the type of the OpenTelemetry component.
32
+ *
33
+ * @example batching_span_processor
34
+ * @example com.example.MySpanExporter
35
+ *
36
+ * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.
37
+ * E.g. for Java the fully qualified classname **SHOULD** be used in this case.
38
+ *
39
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
40
+ */
41
+ export declare const ATTR_OTEL_COMPONENT_TYPE: "otel.component.type";
42
+ /**
43
+ * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
44
+ *
45
+ * @example example.com
46
+ * @example 10.1.2.80
47
+ * @example /tmp/my.sock
48
+ *
49
+ * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.
50
+ */
51
+ export declare const ATTR_SERVER_ADDRESS: "server.address";
52
+ /**
53
+ * Server port number.
54
+ *
55
+ * @example 80
56
+ * @example 8080
57
+ * @example 443
58
+ *
59
+ * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.
60
+ */
61
+ export declare const ATTR_SERVER_PORT: "server.port";
62
+ /**
63
+ * Describes a class of error the operation ended with.
64
+ *
65
+ * @example timeout
66
+ * @example java.net.UnknownHostException
67
+ * @example server_certificate_invalid
68
+ * @example 500
69
+ *
70
+ * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.
71
+ *
72
+ * When `error.type` is set to a type (e.g., an exception type), its
73
+ * canonical class name identifying the type within the artifact **SHOULD** be used.
74
+ *
75
+ * Instrumentations **SHOULD** document the list of errors they report.
76
+ *
77
+ * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.
78
+ * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
79
+ * should be prepared for `error.type` to have high cardinality at query time when no
80
+ * additional filters are applied.
81
+ *
82
+ * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.
83
+ *
84
+ * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),
85
+ * it's **RECOMMENDED** to:
86
+ *
87
+ * - Use a domain-specific attribute
88
+ * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
89
+ */
90
+ export declare const ATTR_ERROR_TYPE: "error.type";
91
+ //# sourceMappingURL=semconv.d.ts.map
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright The OpenTelemetry Authors
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ATTR_ERROR_TYPE = exports.ATTR_SERVER_PORT = exports.ATTR_SERVER_ADDRESS = exports.ATTR_OTEL_COMPONENT_TYPE = exports.ATTR_OTEL_COMPONENT_NAME = exports.ATTR_HTTP_RESPONSE_STATUS_CODE = void 0;
8
+ /*
9
+ * This file contains a copy of unstable semantic convention definitions
10
+ * used by this package.
11
+ * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
12
+ */
13
+ /**
14
+ * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
15
+ *
16
+ * @example 200
17
+ */
18
+ exports.ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';
19
+ /**
20
+ * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.
21
+ *
22
+ * @example otlp_grpc_span_exporter/0
23
+ * @example custom-name
24
+ *
25
+ * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.
26
+ * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.
27
+ *
28
+ * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.
29
+ * Hereby `otel.component.type` refers to the corresponding attribute value of the component.
30
+ *
31
+ * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.
32
+ * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an
33
+ * instance of the given component type is started.
34
+ *
35
+ * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`
36
+ * as `otel.component.name`, the second one `batching_span_processor/1` and so on.
37
+ * These values will therefore be reused in the case of an application restart.
38
+ *
39
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
40
+ */
41
+ exports.ATTR_OTEL_COMPONENT_NAME = 'otel.component.name';
42
+ /**
43
+ * A name identifying the type of the OpenTelemetry component.
44
+ *
45
+ * @example batching_span_processor
46
+ * @example com.example.MySpanExporter
47
+ *
48
+ * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.
49
+ * E.g. for Java the fully qualified classname **SHOULD** be used in this case.
50
+ *
51
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
52
+ */
53
+ exports.ATTR_OTEL_COMPONENT_TYPE = 'otel.component.type';
54
+ /**
55
+ * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
56
+ *
57
+ * @example example.com
58
+ * @example 10.1.2.80
59
+ * @example /tmp/my.sock
60
+ *
61
+ * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.
62
+ */
63
+ exports.ATTR_SERVER_ADDRESS = 'server.address';
64
+ /**
65
+ * Server port number.
66
+ *
67
+ * @example 80
68
+ * @example 8080
69
+ * @example 443
70
+ *
71
+ * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.
72
+ */
73
+ exports.ATTR_SERVER_PORT = 'server.port';
74
+ /**
75
+ * Describes a class of error the operation ended with.
76
+ *
77
+ * @example timeout
78
+ * @example java.net.UnknownHostException
79
+ * @example server_certificate_invalid
80
+ * @example 500
81
+ *
82
+ * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.
83
+ *
84
+ * When `error.type` is set to a type (e.g., an exception type), its
85
+ * canonical class name identifying the type within the artifact **SHOULD** be used.
86
+ *
87
+ * Instrumentations **SHOULD** document the list of errors they report.
88
+ *
89
+ * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.
90
+ * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
91
+ * should be prepared for `error.type` to have high cardinality at query time when no
92
+ * additional filters are applied.
93
+ *
94
+ * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.
95
+ *
96
+ * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),
97
+ * it's **RECOMMENDED** to:
98
+ *
99
+ * - Use a domain-specific attribute
100
+ * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
101
+ */
102
+ exports.ATTR_ERROR_TYPE = 'error.type';
103
+ //# sourceMappingURL=semconv.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"semconv.js","sourceRoot":"","sources":["../../src/semconv.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AAEH;;;;GAIG;AACU,QAAA,8BAA8B,GACzC,2BAAoC,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACU,QAAA,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;;;GAUG;AACU,QAAA,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;GAQG;AACU,QAAA,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;GAQG;AACU,QAAA,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACU,QAAA,eAAe,GAAG,YAAqB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n/**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n *\n * @example 200\n */\nexport const ATTR_HTTP_RESPONSE_STATUS_CODE =\n 'http.response.status_code' as const;\n\n/**\n * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.\n *\n * @example otlp_grpc_span_exporter/0\n * @example custom-name\n *\n * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.\n * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.\n *\n * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.\n * Hereby `otel.component.type` refers to the corresponding attribute value of the component.\n *\n * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.\n * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an\n * instance of the given component type is started.\n *\n * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`\n * as `otel.component.name`, the second one `batching_span_processor/1` and so on.\n * These values will therefore be reused in the case of an application restart.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_COMPONENT_NAME = 'otel.component.name' as const;\n\n/**\n * A name identifying the type of the OpenTelemetry component.\n *\n * @example batching_span_processor\n * @example com.example.MySpanExporter\n *\n * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.\n * E.g. for Java the fully qualified classname **SHOULD** be used in this case.\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_COMPONENT_TYPE = 'otel.component.type' as const;\n\n/**\n * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_ADDRESS = 'server.address' as const;\n\n/**\n * Server port number.\n *\n * @example 80\n * @example 8080\n * @example 443\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_PORT = 'server.port' as const;\n\n/**\n * Describes a class of error the operation ended with.\n *\n * @example timeout\n * @example java.net.UnknownHostException\n * @example server_certificate_invalid\n * @example 500\n *\n * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.\n *\n * When `error.type` is set to a type (e.g., an exception type), its\n * canonical class name identifying the type within the artifact **SHOULD** be used.\n *\n * Instrumentations **SHOULD** document the list of errors they report.\n *\n * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.\n * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications\n * should be prepared for `error.type` to have high cardinality at query time when no\n * additional filters are applied.\n *\n * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.\n *\n * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),\n * it's **RECOMMENDED** to:\n *\n * - Use a domain-specific attribute\n * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.\n */\nexport const ATTR_ERROR_TYPE = 'error.type' as const;\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.220.0";
1
+ export declare const VERSION = "0.221.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -6,5 +6,5 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.VERSION = void 0;
8
8
  // this is autogenerated file, see scripts/version-update.js
9
- exports.VERSION = '0.220.0';
9
+ exports.VERSION = '0.221.0';
10
10
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.220.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.221.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/otlp-exporter-base",
3
- "version": "0.220.0",
3
+ "version": "0.221.0",
4
4
  "description": "OpenTelemetry OTLP Exporter base (for internal use only)",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/esm/index.js",
@@ -74,8 +74,8 @@
74
74
  "access": "public"
75
75
  },
76
76
  "dependencies": {
77
- "@opentelemetry/core": "2.9.0",
78
- "@opentelemetry/otlp-transformer": "0.220.0"
77
+ "@opentelemetry/core": "2.10.0",
78
+ "@opentelemetry/otlp-transformer": "0.221.0"
79
79
  },
80
80
  "devDependencies": {
81
81
  "@babel/core": "7.29.7",
@@ -95,14 +95,14 @@
95
95
  "nyc": "17.1.0",
96
96
  "sinon": "18.0.1",
97
97
  "ts-loader": "9.5.7",
98
- "typescript": "5.0.4",
99
- "webpack": "5.104.1",
100
- "webpack-cli": "7.0.3"
98
+ "typescript": "5.2.2",
99
+ "webpack": "5.108.4",
100
+ "webpack-cli": "7.2.1"
101
101
  },
102
102
  "peerDependencies": {
103
103
  "@opentelemetry/api": "^1.3.0"
104
104
  },
105
105
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/otlp-exporter-base",
106
106
  "sideEffects": false,
107
- "gitHead": "40d67b7690a61bd9af0a4e5b5b9f4a14b11fc50e"
107
+ "gitHead": "76fa6b509e2b48d9cbee31cb37a2efc61dc4d384"
108
108
  }