@opentelemetry/otlp-exporter-base 0.219.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 +10 -10
@@ -3,5 +3,5 @@
3
3
  */
4
4
  export { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';
5
5
  export { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';
6
- export { createLegacyOtlpBrowserExportDelegate } from './configuration/create-legacy-browser-delegate';
6
+ export { createLegacyOtlpBrowserExportDelegate, createLegacyOtlpBrowserExporterMetrics, } from './configuration/create-legacy-browser-delegate';
7
7
  //# sourceMappingURL=index-browser-http.d.ts.map
@@ -7,5 +7,5 @@
7
7
  */
8
8
  export { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';
9
9
  export { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';
10
- export { createLegacyOtlpBrowserExportDelegate } from './configuration/create-legacy-browser-delegate';
10
+ export { createLegacyOtlpBrowserExportDelegate, createLegacyOtlpBrowserExporterMetrics, } from './configuration/create-legacy-browser-delegate';
11
11
  //# sourceMappingURL=index-browser-http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-browser-http.js","sourceRoot":"","sources":["../../src/index-browser-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAEzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @deprecated Use `createOtlpFetchExportDelegate` instead.\n */\nexport { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';\n\nexport { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';\nexport { createLegacyOtlpBrowserExportDelegate } from './configuration/create-legacy-browser-delegate';\n"]}
1
+ {"version":3,"file":"index-browser-http.js","sourceRoot":"","sources":["../../src/index-browser-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAEzF,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EACL,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,gDAAgD,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @deprecated Use `createOtlpFetchExportDelegate` instead.\n */\nexport { createOtlpSendBeaconExportDelegate } from './otlp-browser-http-export-delegate';\n\nexport { convertLegacyBrowserHttpOptions } from './configuration/convert-legacy-browser-http-options';\nexport {\n createLegacyOtlpBrowserExportDelegate,\n createLegacyOtlpBrowserExporterMetrics,\n} from './configuration/create-legacy-browser-delegate';\n"]}
@@ -1,5 +1,5 @@
1
1
  export { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';
2
- export { createOtlpHttpExportDelegate } from './otlp-http-export-delegate';
2
+ export { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics, } from './otlp-http-export-delegate';
3
3
  export { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';
4
4
  export { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';
5
5
  //# sourceMappingURL=index-node-http.d.ts.map
@@ -3,7 +3,7 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  export { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';
6
- export { createOtlpHttpExportDelegate } from './otlp-http-export-delegate';
6
+ export { createOtlpHttpExportDelegate, createOtlpHttpExporterMetrics, } from './otlp-http-export-delegate';
7
7
  export { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';
8
8
  export { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';
9
9
  //# sourceMappingURL=index-node-http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-node-http.js","sourceRoot":"","sources":["../../src/index-node-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,qCAAqC,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';\nexport { createOtlpHttpExportDelegate } from './otlp-http-export-delegate';\nexport { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';\nexport { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';\n"]}
1
+ {"version":3,"file":"index-node-http.js","sourceRoot":"","sources":["../../src/index-node-http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EACL,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qCAAqC,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { httpAgentFactoryFromOptions } from './configuration/otlp-node-http-configuration';\nexport {\n createOtlpHttpExportDelegate,\n createOtlpHttpExporterMetrics,\n} from './otlp-http-export-delegate';\nexport { getSharedConfigurationFromEnvironment } from './configuration/shared-env-configuration';\nexport { convertLegacyHttpOptions } from './configuration/convert-legacy-node-http-options';\n"]}
@@ -9,4 +9,5 @@ export type { OTLPExporterNodeConfigBase } from './configuration/legacy-node-con
9
9
  export type { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';
10
10
  export type { IOtlpExportDelegate } from './otlp-export-delegate';
11
11
  export { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
12
+ export { ExporterMetrics } from './ExporterMetrics';
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -7,4 +7,5 @@ export { OTLPExporterError } from './types';
7
7
  export { mergeOtlpSharedConfigurationWithDefaults, getSharedConfigurationDefaults, } from './configuration/shared-configuration';
8
8
  export { CompressionAlgorithm } from './configuration/legacy-node-configuration';
9
9
  export { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
10
+ export { ExporterMetrics } from './ExporterMetrics';
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAW5C,OAAO,EACL,wCAAwC,EACxC,8BAA8B,GAC/B,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAIjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPExporterBase } from './OTLPExporterBase';\nexport { OTLPExporterError } from './types';\n\nexport type {\n ExportResponse,\n ExportResponseFailure,\n ExportResponseSuccess,\n ExportResponseRetryable,\n} from './export-response';\n\nexport type { IExporterTransport } from './exporter-transport';\n\nexport {\n mergeOtlpSharedConfigurationWithDefaults,\n getSharedConfigurationDefaults,\n} from './configuration/shared-configuration';\nexport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\n\nexport { CompressionAlgorithm } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterNodeConfigBase } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';\nexport type { IOtlpExportDelegate } from './otlp-export-delegate';\nexport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAW5C,OAAO,EACL,wCAAwC,EACxC,8BAA8B,GAC/B,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAIjF,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPExporterBase } from './OTLPExporterBase';\nexport { OTLPExporterError } from './types';\n\nexport type {\n ExportResponse,\n ExportResponseFailure,\n ExportResponseSuccess,\n ExportResponseRetryable,\n} from './export-response';\n\nexport type { IExporterTransport } from './exporter-transport';\n\nexport {\n mergeOtlpSharedConfigurationWithDefaults,\n getSharedConfigurationDefaults,\n} from './configuration/shared-configuration';\nexport type { OtlpSharedConfiguration } from './configuration/shared-configuration';\n\nexport { CompressionAlgorithm } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterNodeConfigBase } from './configuration/legacy-node-configuration';\nexport type { OTLPExporterConfigBase } from './configuration/legacy-base-configuration';\nexport type { IOtlpExportDelegate } from './otlp-export-delegate';\nexport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\n\nexport { ExporterMetrics } from './ExporterMetrics';\n"]}
@@ -1,9 +1,10 @@
1
1
  import type { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';
2
2
  import type { ISerializer } from '@opentelemetry/otlp-transformer';
3
3
  import type { IOtlpExportDelegate } from './otlp-export-delegate';
4
- export declare function createOtlpFetchExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
4
+ import { type ExporterMetrics } from './ExporterMetrics';
5
+ export declare function createOtlpFetchExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>, metrics: ExporterMetrics<Internal>): IOtlpExportDelegate<Internal>;
5
6
  /**
6
7
  * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.
7
8
  */
8
- export declare function createOtlpSendBeaconExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>): IOtlpExportDelegate<Internal>;
9
+ export declare function createOtlpSendBeaconExportDelegate<Internal, Response>(options: OtlpHttpConfiguration, serializer: ISerializer<Internal, Response>, metrics: ExporterMetrics<Internal>): IOtlpExportDelegate<Internal>;
9
10
  //# sourceMappingURL=otlp-browser-http-export-delegate.d.ts.map
@@ -1,15 +1,19 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
1
5
  import { createRetryingTransport } from './retrying-transport';
2
6
  import { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';
3
7
  import { createFetchTransport } from './transport/fetch-transport';
4
- export function createOtlpFetchExportDelegate(options, serializer) {
5
- return createOtlpNetworkExportDelegate(options, serializer, createRetryingTransport({
8
+ export function createOtlpFetchExportDelegate(options, serializer, metrics) {
9
+ return createOtlpNetworkExportDelegate(options, serializer, metrics, createRetryingTransport({
6
10
  transport: createFetchTransport(options),
7
11
  }));
8
12
  }
9
13
  /**
10
14
  * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.
11
15
  */
12
- export function createOtlpSendBeaconExportDelegate(options, serializer) {
13
- return createOtlpFetchExportDelegate(options, serializer);
16
+ export function createOtlpSendBeaconExportDelegate(options, serializer, metrics) {
17
+ return createOtlpFetchExportDelegate(options, serializer, metrics);
14
18
  }
15
19
  //# sourceMappingURL=otlp-browser-http-export-delegate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-browser-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-browser-http-export-delegate.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,UAAU,6BAA6B,CAC3C,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,+BAA+B,CACpC,OAAO,EACP,UAAU,EACV,uBAAuB,CAAC;QACtB,SAAS,EAAE,oBAAoB,CAAC,OAAO,CAAC;KACzC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kCAAkC,CAChD,OAA8B,EAC9B,UAA2C;IAE3C,OAAO,6BAA6B,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport type { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createRetryingTransport } from './retrying-transport';\nimport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\nimport { createFetchTransport } from './transport/fetch-transport';\n\nexport function createOtlpFetchExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpNetworkExportDelegate(\n options,\n serializer,\n createRetryingTransport({\n transport: createFetchTransport(options),\n })\n );\n}\n\n/**\n * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.\n */\nexport function createOtlpSendBeaconExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>\n): IOtlpExportDelegate<Internal> {\n return createOtlpFetchExportDelegate(options, serializer);\n}\n"]}
1
+ {"version":3,"file":"otlp-browser-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-browser-http-export-delegate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE,MAAM,UAAU,6BAA6B,CAC3C,OAA8B,EAC9B,UAA2C,EAC3C,OAAkC;IAElC,OAAO,+BAA+B,CACpC,OAAO,EACP,UAAU,EACV,OAAO,EACP,uBAAuB,CAAC;QACtB,SAAS,EAAE,oBAAoB,CAAC,OAAO,CAAC;KACzC,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kCAAkC,CAChD,OAA8B,EAC9B,UAA2C,EAC3C,OAAkC;IAElC,OAAO,6BAA6B,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AACrE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { OtlpHttpConfiguration } from './configuration/otlp-http-configuration';\nimport type { ISerializer } from '@opentelemetry/otlp-transformer';\nimport type { IOtlpExportDelegate } from './otlp-export-delegate';\nimport { createRetryingTransport } from './retrying-transport';\nimport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\nimport { createFetchTransport } from './transport/fetch-transport';\nimport { type ExporterMetrics } from './ExporterMetrics';\n\nexport function createOtlpFetchExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>,\n metrics: ExporterMetrics<Internal>\n): IOtlpExportDelegate<Internal> {\n return createOtlpNetworkExportDelegate(\n options,\n serializer,\n metrics,\n createRetryingTransport({\n transport: createFetchTransport(options),\n })\n );\n}\n\n/**\n * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.\n */\nexport function createOtlpSendBeaconExportDelegate<Internal, Response>(\n options: OtlpHttpConfiguration,\n serializer: ISerializer<Internal, Response>,\n metrics: ExporterMetrics<Internal>\n): IOtlpExportDelegate<Internal> {\n return createOtlpFetchExportDelegate(options, serializer, metrics);\n}\n"]}
@@ -2,6 +2,7 @@ import type { ExportResult } from '@opentelemetry/core';
2
2
  import type { IExporterTransport } from './exporter-transport';
3
3
  import type { IExportPromiseHandler } from './bounded-queue-export-promise-handler';
4
4
  import type { ISerializer } from '@opentelemetry/otlp-transformer';
5
+ import { type ExporterMetrics } from './ExporterMetrics';
5
6
  /**
6
7
  * Internally shared export logic for OTLP.
7
8
  */
@@ -9,6 +10,7 @@ export interface IOtlpExportDelegate<Internal> {
9
10
  export(internalRepresentation: Internal, resultCallback: (result: ExportResult) => void): void;
10
11
  forceFlush(): Promise<void>;
11
12
  shutdown(): Promise<void>;
13
+ setMetrics(metrics: ExporterMetrics<Internal>): void;
12
14
  }
13
15
  /**
14
16
  * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all
@@ -18,6 +20,7 @@ export declare function createOtlpExportDelegate<Internal, Response>(components:
18
20
  transport: IExporterTransport;
19
21
  serializer: ISerializer<Internal, Response>;
20
22
  promiseHandler: IExportPromiseHandler;
23
+ metrics: ExporterMetrics<Internal>;
21
24
  }, settings: {
22
25
  timeout: number;
23
26
  }): IOtlpExportDelegate<Internal>;
@@ -7,13 +7,14 @@ import { OTLPExporterError } from './types';
7
7
  import { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';
8
8
  import { diag } from '@opentelemetry/api';
9
9
  class OTLPExportDelegate {
10
+ _metrics;
10
11
  _diagLogger;
11
12
  _transport;
12
13
  _serializer;
13
14
  _responseHandler;
14
15
  _promiseQueue;
15
16
  _timeout;
16
- constructor(transport, serializer, responseHandler, promiseQueue, timeout) {
17
+ constructor(transport, serializer, responseHandler, promiseQueue, metrics, timeout) {
17
18
  this._transport = transport;
18
19
  this._serializer = serializer;
19
20
  this._responseHandler = responseHandler;
@@ -22,6 +23,7 @@ class OTLPExportDelegate {
22
23
  this._diagLogger = diag.createComponentLogger({
23
24
  namespace: 'OTLPExportDelegate',
24
25
  });
26
+ this._metrics = metrics;
25
27
  }
26
28
  export(internalRepresentation, resultCallback) {
27
29
  this._diagLogger.debug('items to be sent', internalRepresentation);
@@ -41,8 +43,10 @@ class OTLPExportDelegate {
41
43
  });
42
44
  return;
43
45
  }
46
+ const finishExport = this._metrics.startExport(internalRepresentation);
44
47
  this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then(response => {
45
48
  if (response.status === 'success') {
49
+ finishExport(undefined);
46
50
  if (response.data != null) {
47
51
  try {
48
52
  this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));
@@ -58,6 +62,7 @@ class OTLPExportDelegate {
58
62
  return;
59
63
  }
60
64
  else if (response.status === 'failure' && response.error) {
65
+ finishExport(response.error);
61
66
  resultCallback({
62
67
  code: ExportResultCode.FAILED,
63
68
  error: response.error,
@@ -65,6 +70,7 @@ class OTLPExportDelegate {
65
70
  return;
66
71
  }
67
72
  else if (response.status === 'retryable') {
73
+ finishExport('export_max_retries');
68
74
  resultCallback({
69
75
  code: ExportResultCode.FAILED,
70
76
  error: response.error ??
@@ -72,19 +78,26 @@ class OTLPExportDelegate {
72
78
  });
73
79
  }
74
80
  else {
81
+ finishExport('export_failed');
75
82
  resultCallback({
76
83
  code: ExportResultCode.FAILED,
77
84
  error: new OTLPExporterError('Export failed with unknown error'),
78
85
  });
79
86
  }
80
- }, reason => resultCallback({
81
- code: ExportResultCode.FAILED,
82
- error: reason,
83
- })));
87
+ }, reason => {
88
+ finishExport(reason);
89
+ resultCallback({
90
+ code: ExportResultCode.FAILED,
91
+ error: reason,
92
+ });
93
+ }));
84
94
  }
85
95
  forceFlush() {
86
96
  return this._promiseQueue.awaitAll();
87
97
  }
98
+ setMetrics(metrics) {
99
+ this._metrics = metrics;
100
+ }
88
101
  async shutdown() {
89
102
  this._diagLogger.debug('shutdown started');
90
103
  await this.forceFlush();
@@ -96,6 +109,6 @@ class OTLPExportDelegate {
96
109
  * signals.
97
110
  */
98
111
  export function createOtlpExportDelegate(components, settings) {
99
- return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout);
112
+ return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, components.metrics, settings.timeout);
100
113
  }
101
114
  //# sourceMappingURL=otlp-export-delegate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-export-delegate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,0CAA0C,EA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AAc,CAAC;YACb,IAAI,EAAE,gBAAgB,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,MAAM,UAAU,wBAAwB,CACtC,UAIC,EACD,QAA6B;IAE7B,OAAO,IAAI,kBAAkB,CAC3B,UAAU,CAAC,SAAS,EACpB,UAAU,CAAC,UAAU,EACrB,0CAA0C,EAAE,EAC5C,UAAU,CAAC,cAAc,EACzB,QAAQ,CAAC,OAAO,CACjB,CAAC;AACJ,CAAC","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,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,0CAA0C,EAAE,MAAM,4BAA4B,CAAC;AAExF,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAgB1C,MAAM,kBAAkB;IAGd,QAAQ,CAA4B;IACpC,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,OAAkC,EAClC,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,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,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,MAAM,UAAU,wBAAwB,CACtC,UAKC,EACD,QAA6B;IAE7B,OAAO,IAAI,kBAAkB,CAC3B,UAAU,CAAC,SAAS,EACpB,UAAU,CAAC,UAAU,EACrB,0CAA0C,EAAE,EAC5C,UAAU,CAAC,cAAc,EACzB,UAAU,CAAC,OAAO,EAClB,QAAQ,CAAC,OAAO,CACjB,CAAC;AACJ,CAAC","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,14 +1,43 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
1
5
  import { createOtlpExportDelegate } from './otlp-export-delegate';
2
6
  import { createHttpExporterTransport } from './transport/http-exporter-transport';
3
7
  import { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';
4
8
  import { createRetryingTransport } from './retrying-transport';
5
- export function createOtlpHttpExportDelegate(options, serializer) {
9
+ import { OTLPExporterError } from './types';
10
+ import { ATTR_HTTP_RESPONSE_STATUS_CODE } from './semconv';
11
+ import { ExporterMetrics } from './ExporterMetrics';
12
+ export function createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, url, meterProvider) {
13
+ return new ExporterMetrics({
14
+ componentType: metricsComponentType,
15
+ metricsHelper: exporterMetricsHelper,
16
+ url,
17
+ meterProvider,
18
+ responseAttributesFromError: (error) => {
19
+ if (!error) {
20
+ return {
21
+ [ATTR_HTTP_RESPONSE_STATUS_CODE]: 200,
22
+ };
23
+ }
24
+ if (!(error instanceof OTLPExporterError)) {
25
+ return {};
26
+ }
27
+ return {
28
+ [ATTR_HTTP_RESPONSE_STATUS_CODE]: error.code,
29
+ };
30
+ },
31
+ });
32
+ }
33
+ export function createOtlpHttpExportDelegate(options, serializer, metricsComponentType, exporterMetricsHelper, meterProvider) {
6
34
  return createOtlpExportDelegate({
7
35
  transport: createRetryingTransport({
8
36
  transport: createHttpExporterTransport(options),
9
37
  }),
10
38
  serializer: serializer,
11
39
  promiseHandler: createBoundedQueueExportPromiseHandler(options),
40
+ metrics: createOtlpHttpExporterMetrics(metricsComponentType, exporterMetricsHelper, options.url, meterProvider),
12
41
  }, { timeout: options.timeoutMillis });
13
42
  }
14
43
  //# sourceMappingURL=otlp-http-export-delegate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-http-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-http-export-delegate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,MAAM,UAAU,4BAA4B,CAC1C,OAAkC,EAClC,UAA2C;IAE3C,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,uBAAuB,CAAC;YACjC,SAAS,EAAE,2BAA2B,CAAC,OAAO,CAAC;SAChD,CAAC;QACF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","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,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAKlE,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,UAAU,6BAA6B,CAC3C,oBAA4B,EAC5B,qBAAuD,EACvD,GAAuB,EACvB,aAAwC;IAExC,OAAO,IAAI,eAAe,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,8BAA8B,CAAC,EAAE,GAAG;iBACtC,CAAC;aACH;YACD,IAAI,CAAC,CAAC,KAAK,YAAY,iBAAiB,CAAC,EAAE;gBACzC,OAAO,EAAE,CAAC;aACX;YACD,OAAO;gBACL,CAAC,8BAA8B,CAAC,EAAE,KAAK,CAAC,IAAI;aAC7C,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,OAAkC,EAClC,UAA2C,EAC3C,oBAA4B,EAC5B,qBAAuD,EACvD,aAAwC;IAExC,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,uBAAuB,CAAC;YACjC,SAAS,EAAE,2BAA2B,CAAC,OAAO,CAAC;SAChD,CAAC;QACF,UAAU,EAAE,UAAU;QACtB,cAAc,EAAE,sCAAsC,CAAC,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","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
@@ -4,11 +4,12 @@
4
4
  */
5
5
  import { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';
6
6
  import { createOtlpExportDelegate } from './otlp-export-delegate';
7
- export function createOtlpNetworkExportDelegate(options, serializer, transport) {
7
+ export function createOtlpNetworkExportDelegate(options, serializer, metrics, transport) {
8
8
  return createOtlpExportDelegate({
9
9
  transport: transport,
10
10
  serializer,
11
11
  promiseHandler: createBoundedQueueExportPromiseHandler(options),
12
+ metrics,
12
13
  }, { timeout: options.timeoutMillis });
13
14
  }
14
15
  //# sourceMappingURL=otlp-network-export-delegate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"otlp-network-export-delegate.js","sourceRoot":"","sources":["../../src/otlp-network-export-delegate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAKhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,UAAU,+BAA+B,CAC7C,OAAgC,EAChC,UAA2C,EAC3C,SAA6B;IAE7B,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;KAChE,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","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,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAKhG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE,MAAM,UAAU,+BAA+B,CAC7C,OAAgC,EAChC,UAA2C,EAC3C,OAAkC,EAClC,SAA6B;IAE7B,OAAO,wBAAwB,CAC7B;QACE,SAAS,EAAE,SAAS;QACpB,UAAU;QACV,cAAc,EAAE,sCAAsC,CAAC,OAAO,CAAC;QAC/D,OAAO;KACR,EACD,EAAE,OAAO,EAAE,OAAO,CAAC,aAAa,EAAE,CACnC,CAAC;AACJ,CAAC","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,100 @@
1
+ /*
2
+ * Copyright The OpenTelemetry Authors
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /*
6
+ * This file contains a copy of unstable semantic convention definitions
7
+ * used by this package.
8
+ * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
9
+ */
10
+ /**
11
+ * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
12
+ *
13
+ * @example 200
14
+ */
15
+ export const ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';
16
+ /**
17
+ * A name uniquely identifying the instance of the OpenTelemetry component within its containing SDK instance.
18
+ *
19
+ * @example otlp_grpc_span_exporter/0
20
+ * @example custom-name
21
+ *
22
+ * @note Implementations **SHOULD** ensure a low cardinality for this attribute, even across application or SDK restarts.
23
+ * E.g. implementations **MUST NOT** use UUIDs as values for this attribute.
24
+ *
25
+ * Implementations **MAY** achieve these goals by following a `<otel.component.type>/<instance-counter>` pattern, e.g. `batching_span_processor/0`.
26
+ * Hereby `otel.component.type` refers to the corresponding attribute value of the component.
27
+ *
28
+ * The value of `instance-counter` **MAY** be automatically assigned by the component and uniqueness within the enclosing SDK instance **MUST** be guaranteed.
29
+ * For example, `<instance-counter>` **MAY** be implemented by using a monotonically increasing counter (starting with `0`), which is incremented every time an
30
+ * instance of the given component type is started.
31
+ *
32
+ * With this implementation, for example the first Batching Span Processor would have `batching_span_processor/0`
33
+ * as `otel.component.name`, the second one `batching_span_processor/1` and so on.
34
+ * These values will therefore be reused in the case of an application restart.
35
+ *
36
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
37
+ */
38
+ export const ATTR_OTEL_COMPONENT_NAME = 'otel.component.name';
39
+ /**
40
+ * A name identifying the type of the OpenTelemetry component.
41
+ *
42
+ * @example batching_span_processor
43
+ * @example com.example.MySpanExporter
44
+ *
45
+ * @note If none of the standardized values apply, implementations **SHOULD** use the language-defined name of the type.
46
+ * E.g. for Java the fully qualified classname **SHOULD** be used in this case.
47
+ *
48
+ * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
49
+ */
50
+ export const ATTR_OTEL_COMPONENT_TYPE = 'otel.component.type';
51
+ /**
52
+ * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.
53
+ *
54
+ * @example example.com
55
+ * @example 10.1.2.80
56
+ * @example /tmp/my.sock
57
+ *
58
+ * @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.
59
+ */
60
+ export const ATTR_SERVER_ADDRESS = 'server.address';
61
+ /**
62
+ * Server port number.
63
+ *
64
+ * @example 80
65
+ * @example 8080
66
+ * @example 443
67
+ *
68
+ * @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.
69
+ */
70
+ export const ATTR_SERVER_PORT = 'server.port';
71
+ /**
72
+ * Describes a class of error the operation ended with.
73
+ *
74
+ * @example timeout
75
+ * @example java.net.UnknownHostException
76
+ * @example server_certificate_invalid
77
+ * @example 500
78
+ *
79
+ * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.
80
+ *
81
+ * When `error.type` is set to a type (e.g., an exception type), its
82
+ * canonical class name identifying the type within the artifact **SHOULD** be used.
83
+ *
84
+ * Instrumentations **SHOULD** document the list of errors they report.
85
+ *
86
+ * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.
87
+ * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
88
+ * should be prepared for `error.type` to have high cardinality at query time when no
89
+ * additional filters are applied.
90
+ *
91
+ * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.
92
+ *
93
+ * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),
94
+ * it's **RECOMMENDED** to:
95
+ *
96
+ * - Use a domain-specific attribute
97
+ * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
98
+ */
99
+ export const ATTR_ERROR_TYPE = 'error.type';
100
+ //# 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;AACH,MAAM,CAAC,MAAM,8BAA8B,GACzC,2BAAoC,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAA8B,CAAC;AAEvE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAyB,CAAC;AAE7D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAsB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,CAAC,MAAM,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.219.0";
1
+ export declare const VERSION = "0.221.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -3,5 +3,5 @@
3
3
  * SPDX-License-Identifier: Apache-2.0
4
4
  */
5
5
  // this is autogenerated file, see scripts/version-update.js
6
- export const VERSION = '0.219.0';
6
+ export const VERSION = '0.221.0';
7
7
  //# sourceMappingURL=version.js.map