@opentelemetry/exporter-metrics-otlp-http 0.212.0 → 0.213.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 (58) hide show
  1. package/build/esm/OTLPMetricExporterBase.js +1 -12
  2. package/build/esm/OTLPMetricExporterBase.js.map +1 -1
  3. package/build/esm/OTLPMetricExporterOptions.js +1 -12
  4. package/build/esm/OTLPMetricExporterOptions.js.map +1 -1
  5. package/build/esm/index.js +1 -12
  6. package/build/esm/index.js.map +1 -1
  7. package/build/esm/platform/browser/OTLPMetricExporter.js +1 -12
  8. package/build/esm/platform/browser/OTLPMetricExporter.js.map +1 -1
  9. package/build/esm/platform/browser/index.js +1 -12
  10. package/build/esm/platform/browser/index.js.map +1 -1
  11. package/build/esm/platform/index.js +1 -12
  12. package/build/esm/platform/index.js.map +1 -1
  13. package/build/esm/platform/node/OTLPMetricExporter.js +1 -12
  14. package/build/esm/platform/node/OTLPMetricExporter.js.map +1 -1
  15. package/build/esm/platform/node/index.js +1 -12
  16. package/build/esm/platform/node/index.js.map +1 -1
  17. package/build/esm/version.d.ts +1 -1
  18. package/build/esm/version.js +1 -1
  19. package/build/esm/version.js.map +1 -1
  20. package/build/esnext/OTLPMetricExporterBase.js +1 -12
  21. package/build/esnext/OTLPMetricExporterBase.js.map +1 -1
  22. package/build/esnext/OTLPMetricExporterOptions.js +1 -12
  23. package/build/esnext/OTLPMetricExporterOptions.js.map +1 -1
  24. package/build/esnext/index.js +1 -12
  25. package/build/esnext/index.js.map +1 -1
  26. package/build/esnext/platform/browser/OTLPMetricExporter.js +1 -12
  27. package/build/esnext/platform/browser/OTLPMetricExporter.js.map +1 -1
  28. package/build/esnext/platform/browser/index.js +1 -12
  29. package/build/esnext/platform/browser/index.js.map +1 -1
  30. package/build/esnext/platform/index.js +1 -12
  31. package/build/esnext/platform/index.js.map +1 -1
  32. package/build/esnext/platform/node/OTLPMetricExporter.js +1 -12
  33. package/build/esnext/platform/node/OTLPMetricExporter.js.map +1 -1
  34. package/build/esnext/platform/node/index.js +1 -12
  35. package/build/esnext/platform/node/index.js.map +1 -1
  36. package/build/esnext/version.d.ts +1 -1
  37. package/build/esnext/version.js +1 -1
  38. package/build/esnext/version.js.map +1 -1
  39. package/build/src/OTLPMetricExporterBase.js +1 -12
  40. package/build/src/OTLPMetricExporterBase.js.map +1 -1
  41. package/build/src/OTLPMetricExporterOptions.js +1 -12
  42. package/build/src/OTLPMetricExporterOptions.js.map +1 -1
  43. package/build/src/index.js +1 -12
  44. package/build/src/index.js.map +1 -1
  45. package/build/src/platform/browser/OTLPMetricExporter.js +1 -12
  46. package/build/src/platform/browser/OTLPMetricExporter.js.map +1 -1
  47. package/build/src/platform/browser/index.js +1 -12
  48. package/build/src/platform/browser/index.js.map +1 -1
  49. package/build/src/platform/index.js +1 -12
  50. package/build/src/platform/index.js.map +1 -1
  51. package/build/src/platform/node/OTLPMetricExporter.js +1 -12
  52. package/build/src/platform/node/OTLPMetricExporter.js.map +1 -1
  53. package/build/src/platform/node/index.js +1 -12
  54. package/build/src/platform/node/index.js.map +1 -1
  55. package/build/src/version.d.ts +1 -1
  56. package/build/src/version.js +1 -1
  57. package/build/src/version.js.map +1 -1
  58. package/package.json +7 -7
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { getStringFromEnv } from '@opentelemetry/core';
17
6
  import { AggregationTemporality, InstrumentType, AggregationType, } from '@opentel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AA+B,CAAiC;IAChE,oBAAoB,CAAsB;IAE3D,YACE,QAA8C,EAC9C,MAAkC;QAElC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,EAAE,qBAAqB,CAC9B,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,4BAA4B,CAC1B,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n AggregationSelector,\n AggregationOption,\n AggregationType,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport {\n IOtlpExportDelegate,\n OTLPExporterBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.GAUGE:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.GAUGE:\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const configuredTemporality = (\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??\n 'cumulative'\n ).toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${configuredTemporality}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nconst DEFAULT_AGGREGATION = Object.freeze({\n type: AggregationType.DEFAULT,\n});\n\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n): AggregationSelector {\n return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION);\n}\n\nexport class OTLPMetricExporterBase\n extends OTLPExporterBase<ResourceMetrics>\n implements PushMetricExporter\n{\n private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;\n private readonly _aggregationSelector: AggregationSelector;\n\n constructor(\n delegate: IOtlpExportDelegate<ResourceMetrics>,\n config?: OTLPMetricExporterOptions\n ) {\n super(delegate);\n this._aggregationSelector = chooseAggregationSelector(config);\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n selectAggregation(instrumentType: InstrumentType): AggregationOption {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,sBAAsB,EAEtB,cAAc,EAKd,eAAe,GAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gCAAgC,GAEjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,6BAA6B,GACxC,GAAG,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,wBAAwB,GAAmC,CACtE,cAA8B,EAC9B,EAAE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,OAAO,6BAA6B,CAAC;AACvC,CAAC;AAED,SAAS,yBAAyB,CAChC,qBAE0B;IAE1B,2CAA2C;IAC3C,IAAI,qBAAqB,IAAI,IAAI,EAAE;QACjC,IAAI,qBAAqB,KAAK,gCAAgC,CAAC,KAAK,EAAE;YACpE,OAAO,wBAAwB,CAAC;SACjC;aAAM,IACL,qBAAqB,KAAK,gCAAgC,CAAC,SAAS,EACpE;YACA,OAAO,4BAA4B,CAAC;SACrC;QACD,OAAO,6BAA6B,CAAC;KACtC;IAED,OAAO,wCAAwC,EAAE,CAAC;AACpD,CAAC;AAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,eAAe,CAAC,OAAO;CAC9B,CAAC,CAAC;AAEH,SAAS,yBAAyB,CAChC,MAA6C;IAE7C,OAAO,MAAM,EAAE,qBAAqB,IAAI,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,OAAO,sBACX,SAAQ,gBAAiC;IAGxB,+BAA+B,CAAiC;IAChE,oBAAoB,CAAsB;IAE3D,YACE,QAA8C,EAC9C,MAAkC;QAElC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,EAAE,qBAAqB,CAC9B,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,4BAA4B,CAC1B,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n AggregationSelector,\n AggregationOption,\n AggregationType,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport {\n IOtlpExportDelegate,\n OTLPExporterBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.GAUGE:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.GAUGE:\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const configuredTemporality = (\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??\n 'cumulative'\n ).toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${configuredTemporality}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nconst DEFAULT_AGGREGATION = Object.freeze({\n type: AggregationType.DEFAULT,\n});\n\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n): AggregationSelector {\n return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION);\n}\n\nexport class OTLPMetricExporterBase\n extends OTLPExporterBase<ResourceMetrics>\n implements PushMetricExporter\n{\n private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;\n private readonly _aggregationSelector: AggregationSelector;\n\n constructor(\n delegate: IOtlpExportDelegate<ResourceMetrics>,\n config?: OTLPMetricExporterOptions\n ) {\n super(delegate);\n this._aggregationSelector = chooseAggregationSelector(config);\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n selectAggregation(instrumentType: InstrumentType): AggregationOption {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export var AggregationTemporalityPreference;
17
6
  (function (AggregationTemporalityPreference) {
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,MAAM,CAAN,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,KAAhC,gCAAgC,QAI3C","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport {\n AggregationTemporality,\n AggregationSelector,\n} from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n aggregationPreference?: AggregationSelector;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,MAAM,CAAN,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,KAAhC,gCAAgC,QAI3C","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport {\n AggregationTemporality,\n AggregationSelector,\n} from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n aggregationPreference?: AggregationSelector;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPMetricExporter } from './platform';
17
6
  export { AggregationTemporalityPreference } from './OTLPMetricExporterOptions';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './platform';\nexport { AggregationTemporalityPreference } from './OTLPMetricExporterOptions';\nexport type { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';\nexport {\n CumulativeTemporalitySelector,\n DeltaTemporalitySelector,\n LowMemoryTemporalitySelector,\n OTLPMetricExporterBase,\n} from './OTLPMetricExporterBase';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './platform';\nexport { AggregationTemporalityPreference } from './OTLPMetricExporterOptions';\nexport type { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';\nexport {\n CumulativeTemporalitySelector,\n DeltaTemporalitySelector,\n LowMemoryTemporalitySelector,\n OTLPMetricExporterBase,\n} from './OTLPMetricExporterBase';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
17
6
  import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,YAAY,MAA2D;QACrE,KAAK,CACH,qCAAqC,CACnC,MAAM,IAAI,EAAE,EACZ,qBAAqB,EACrB,YAAY,EACZ,EAAE,cAAc,EAAE,kBAAkB,EAAE,CACvC,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(\n createLegacyOtlpBrowserExportDelegate(\n config ?? {},\n JsonMetricsSerializer,\n 'v1/metrics',\n { 'Content-Type': 'application/json' }\n ),\n config\n );\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,YAAY,MAA2D;QACrE,KAAK,CACH,qCAAqC,CACnC,MAAM,IAAI,EAAE,EACZ,qBAAqB,EACrB,YAAY,EACZ,EAAE,cAAc,EAAE,kBAAkB,EAAE,CACvC,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(\n createLegacyOtlpBrowserExportDelegate(\n config ?? {},\n JsonMetricsSerializer,\n 'v1/metrics',\n { 'Content-Type': 'application/json' }\n ),\n config\n );\n }\n}\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPMetricExporter } from './OTLPMetricExporter';
17
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPMetricExporter } from './node';
17
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './node';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './node';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
17
6
  import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,YAAY,MAA+D;QACzE,KAAK,CACH,4BAA4B,CAC1B,wBAAwB,CAAC,MAAM,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE;YAC9D,cAAc,EAAE,kBAAkB;SACnC,CAAC,EACF,qBAAqB,CACtB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport {\n convertLegacyHttpOptions,\n createOtlpHttpExportDelegate,\n} from '@opentelemetry/otlp-exporter-base/node-http';\n\n/**\n * OTLP Metric Exporter for Node.js\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n createOtlpHttpExportDelegate(\n convertLegacyHttpOptions(config ?? {}, 'METRICS', 'v1/metrics', {\n 'Content-Type': 'application/json',\n }),\n JsonMetricsSerializer\n ),\n config\n );\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,YAAY,MAA+D;QACzE,KAAK,CACH,4BAA4B,CAC1B,wBAAwB,CAAC,MAAM,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE;YAC9D,cAAc,EAAE,kBAAkB;SACnC,CAAC,EACF,qBAAqB,CACtB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport {\n convertLegacyHttpOptions,\n createOtlpHttpExportDelegate,\n} from '@opentelemetry/otlp-exporter-base/node-http';\n\n/**\n * OTLP Metric Exporter for Node.js\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n createOtlpHttpExportDelegate(\n convertLegacyHttpOptions(config ?? {}, 'METRICS', 'v1/metrics', {\n 'Content-Type': 'application/json',\n }),\n JsonMetricsSerializer\n ),\n config\n );\n }\n}\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPMetricExporter } from './OTLPMetricExporter';
17
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.212.0";
1
+ export declare const VERSION = "0.213.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // this is autogenerated file, see scripts/version-update.js
17
- export const VERSION = '0.212.0';
17
+ export const VERSION = '0.213.0';
18
18
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.212.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.213.0';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { getStringFromEnv } from '@opentelemetry/core';
17
6
  import { AggregationTemporality, InstrumentType, AggregationType, } from '@opentelemetry/sdk-metrics';
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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G,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,EAAE,qBAAqB,CAC9B,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,4BAA4B,CAC1B,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n AggregationSelector,\n AggregationOption,\n AggregationType,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport {\n IOtlpExportDelegate,\n OTLPExporterBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.GAUGE:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.GAUGE:\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const configuredTemporality = (\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??\n 'cumulative'\n ).toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${configuredTemporality}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nconst DEFAULT_AGGREGATION = Object.freeze({\n type: AggregationType.DEFAULT,\n});\n\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n): AggregationSelector {\n return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION);\n}\n\nexport class OTLPMetricExporterBase\n extends OTLPExporterBase<ResourceMetrics>\n implements PushMetricExporter\n{\n private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;\n private readonly _aggregationSelector: AggregationSelector;\n\n constructor(\n delegate: IOtlpExportDelegate<ResourceMetrics>,\n config?: OTLPMetricExporterOptions\n ) {\n super(delegate);\n this._aggregationSelector = chooseAggregationSelector(config);\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n selectAggregation(instrumentType: InstrumentType): AggregationOption {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,sBAAsB,EAEtB,cAAc,EAKd,eAAe,GAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,gCAAgC,GAEjC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,gBAAgB,GACjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,6BAA6B,GACxC,GAAG,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC;AAE1C,MAAM,CAAC,MAAM,wBAAwB,GAAmC,CACtE,cAA8B,EAC9B,EAAE;IACF,QAAQ,cAAc,EAAE;QACtB,KAAK,cAAc,CAAC,OAAO,CAAC;QAC5B,KAAK,cAAc,CAAC,kBAAkB,CAAC;QACvC,KAAK,cAAc,CAAC,KAAK,CAAC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BAAqB,KAAK,gCAAgC,CAAC,KAAK,EAAE;YACpE,OAAO,wBAAwB,CAAC;SACjC;aAAM,IACL,qBAAqB,KAAK,gCAAgC,CAAC,SAAS,EACpE;YACA,OAAO,4BAA4B,CAAC;SACrC;QACD,OAAO,6BAA6B,CAAC;KACtC;IAED,OAAO,wCAAwC,EAAE,CAAC;AACpD,CAAC;AAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,eAAe,CAAC,OAAO;CAC9B,CAAC,CAAC;AAEH,SAAS,yBAAyB,CAChC,MAA6C;IAE7C,OAAO,MAAM,EAAE,qBAAqB,IAAI,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,OAAO,sBACX,SAAQ,gBAAiC;IAGxB,+BAA+B,CAAiC;IAChE,oBAAoB,CAAsB;IAE3D,YACE,QAA8C,EAC9C,MAAkC;QAElC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,EAAE,qBAAqB,CAC9B,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,4BAA4B,CAC1B,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n AggregationSelector,\n AggregationOption,\n AggregationType,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport {\n IOtlpExportDelegate,\n OTLPExporterBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.GAUGE:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.GAUGE:\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const configuredTemporality = (\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??\n 'cumulative'\n ).toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${configuredTemporality}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nconst DEFAULT_AGGREGATION = Object.freeze({\n type: AggregationType.DEFAULT,\n});\n\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n): AggregationSelector {\n return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION);\n}\n\nexport class OTLPMetricExporterBase\n extends OTLPExporterBase<ResourceMetrics>\n implements PushMetricExporter\n{\n private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;\n private readonly _aggregationSelector: AggregationSelector;\n\n constructor(\n delegate: IOtlpExportDelegate<ResourceMetrics>,\n config?: OTLPMetricExporterOptions\n ) {\n super(delegate);\n this._aggregationSelector = chooseAggregationSelector(config);\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n selectAggregation(instrumentType: InstrumentType): AggregationOption {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export var AggregationTemporalityPreference;
17
6
  (function (AggregationTemporalityPreference) {
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAeH,MAAM,CAAN,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,KAAhC,gCAAgC,QAI3C","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport {\n AggregationTemporality,\n AggregationSelector,\n} from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n aggregationPreference?: AggregationSelector;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,MAAM,CAAN,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,KAAhC,gCAAgC,QAI3C","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport {\n AggregationTemporality,\n AggregationSelector,\n} from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n aggregationPreference?: AggregationSelector;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPMetricExporter } from './platform';
17
6
  export { AggregationTemporalityPreference } from './OTLPMetricExporterOptions';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './platform';\nexport { AggregationTemporalityPreference } from './OTLPMetricExporterOptions';\nexport type { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';\nexport {\n CumulativeTemporalitySelector,\n DeltaTemporalitySelector,\n LowMemoryTemporalitySelector,\n OTLPMetricExporterBase,\n} from './OTLPMetricExporterBase';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAE/E,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,0BAA0B,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './platform';\nexport { AggregationTemporalityPreference } from './OTLPMetricExporterOptions';\nexport type { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';\nexport {\n CumulativeTemporalitySelector,\n DeltaTemporalitySelector,\n LowMemoryTemporalitySelector,\n OTLPMetricExporterBase,\n} from './OTLPMetricExporterBase';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
17
6
  import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,YAAY,MAA2D;QACrE,KAAK,CACH,qCAAqC,CACnC,MAAM,IAAI,EAAE,EACZ,qBAAqB,EACrB,YAAY,EACZ,EAAE,cAAc,EAAE,kBAAkB,EAAE,CACvC,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(\n createLegacyOtlpBrowserExportDelegate(\n config ?? {},\n JsonMetricsSerializer,\n 'v1/metrics',\n { 'Content-Type': 'application/json' }\n ),\n config\n );\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,YAAY,MAA2D;QACrE,KAAK,CACH,qCAAqC,CACnC,MAAM,IAAI,EAAE,EACZ,qBAAqB,EACrB,YAAY,EACZ,EAAE,cAAc,EAAE,kBAAkB,EAAE,CACvC,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(\n createLegacyOtlpBrowserExportDelegate(\n config ?? {},\n JsonMetricsSerializer,\n 'v1/metrics',\n { 'Content-Type': 'application/json' }\n ),\n config\n );\n }\n}\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPMetricExporter } from './OTLPMetricExporter';
17
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPMetricExporter } from './node';
17
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './node';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './node';\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
17
6
  import { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,YAAY,MAA+D;QACzE,KAAK,CACH,4BAA4B,CAC1B,wBAAwB,CAAC,MAAM,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE;YAC9D,cAAc,EAAE,kBAAkB;SACnC,CAAC,EACF,qBAAqB,CACtB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport {\n convertLegacyHttpOptions,\n createOtlpHttpExportDelegate,\n} from '@opentelemetry/otlp-exporter-base/node-http';\n\n/**\n * OTLP Metric Exporter for Node.js\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n createOtlpHttpExportDelegate(\n convertLegacyHttpOptions(config ?? {}, 'METRICS', 'v1/metrics', {\n 'Content-Type': 'application/json',\n }),\n JsonMetricsSerializer\n ),\n config\n );\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,6CAA6C,CAAC;AAErD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,sBAAsB;IAC5D,YAAY,MAA+D;QACzE,KAAK,CACH,4BAA4B,CAC1B,wBAAwB,CAAC,MAAM,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE;YAC9D,cAAc,EAAE,kBAAkB;SACnC,CAAC,EACF,qBAAqB,CACtB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport {\n convertLegacyHttpOptions,\n createOtlpHttpExportDelegate,\n} from '@opentelemetry/otlp-exporter-base/node-http';\n\n/**\n * OTLP Metric Exporter for Node.js\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n createOtlpHttpExportDelegate(\n convertLegacyHttpOptions(config ?? {}, 'METRICS', 'v1/metrics', {\n 'Content-Type': 'application/json',\n }),\n JsonMetricsSerializer\n ),\n config\n );\n }\n}\n"]}
@@ -1,17 +1,6 @@
1
1
  /*
2
2
  * Copyright The OpenTelemetry Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * https://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
3
+ * SPDX-License-Identifier: Apache-2.0
15
4
  */
16
5
  export { OTLPMetricExporter } from './OTLPMetricExporter';
17
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.212.0";
1
+ export declare const VERSION = "0.213.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -14,5 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // this is autogenerated file, see scripts/version-update.js
17
- export const VERSION = '0.212.0';
17
+ export const VERSION = '0.213.0';
18
18
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.212.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.213.0';\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.OTLPMetricExporterBase = exports.LowMemoryTemporalitySelector = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,8CAAuD;AACvD,4DASoC;AACpC,2EAGqC;AACrC,0EAG2C;AAC3C,4CAA0C;AAEn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A4B,CAC1B,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF;AA3BD,wDA2BC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n AggregationSelector,\n AggregationOption,\n AggregationType,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport {\n IOtlpExportDelegate,\n OTLPExporterBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.GAUGE:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.GAUGE:\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const configuredTemporality = (\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??\n 'cumulative'\n ).toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${configuredTemporality}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nconst DEFAULT_AGGREGATION = Object.freeze({\n type: AggregationType.DEFAULT,\n});\n\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n): AggregationSelector {\n return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION);\n}\n\nexport class OTLPMetricExporterBase\n extends OTLPExporterBase<ResourceMetrics>\n implements PushMetricExporter\n{\n private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;\n private readonly _aggregationSelector: AggregationSelector;\n\n constructor(\n delegate: IOtlpExportDelegate<ResourceMetrics>,\n config?: OTLPMetricExporterOptions\n ) {\n super(delegate);\n this._aggregationSelector = chooseAggregationSelector(config);\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n selectAggregation(instrumentType: InstrumentType): AggregationOption {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporterBase.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterBase.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,8CAAuD;AACvD,4DASoC;AACpC,2EAGqC;AACrC,0EAG2C;AAC3C,4CAA0C;AAEnC,MAAM,6BAA6B,GACxC,GAAG,EAAE,CAAC,oCAAsB,CAAC,UAAU,CAAC;AAD7B,QAAA,6BAA6B,iCACA;AAEnC,MAAM,wBAAwB,GAAmC,CACtE,cAA8B,EAC9B,EAAE;IACF,QAAQ,cAAc,EAAE;QACtB,KAAK,4BAAc,CAAC,OAAO,CAAC;QAC5B,KAAK,4BAAc,CAAC,kBAAkB,CAAC;QACvC,KAAK,4BAAc,CAAC,KAAK,CAAC;QAC1B,KAAK,4BAAc,CAAC,SAAS,CAAC;QAC9B,KAAK,4BAAc,CAAC,gBAAgB;YAClC,OAAO,oCAAsB,CAAC,KAAK,CAAC;QACtC,KAAK,4BAAc,CAAC,eAAe,CAAC;QACpC,KAAK,4BAAc,CAAC,0BAA0B;YAC5C,OAAO,oCAAsB,CAAC,UAAU,CAAC;KAC5C;AACH,CAAC,CAAC;AAdW,QAAA,wBAAwB,4BAcnC;AAEK,MAAM,4BAA4B,GAAmC,CAC1E,cAA8B,EAC9B,EAAE;IACF,QAAQ,cAAc,EAAE;QACtB,KAAK,4BAAc,CAAC,OAAO,CAAC;QAC5B,KAAK,4BAAc,CAAC,SAAS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C,MAA6C;IAE7C,OAAO,MAAM,EAAE,qBAAqB,IAAI,CAAC,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC;AACtE,CAAC;AAED,MAAa,sBACX,SAAQ,qCAAiC;IAGxB,+BAA+B,CAAiC;IAChE,oBAAoB,CAAsB;IAE3D,YACE,QAA8C,EAC9C,MAAkC;QAElC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,IAAI,CAAC,oBAAoB,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC;QAC9D,IAAI,CAAC,+BAA+B,GAAG,yBAAyB,CAC9D,MAAM,EAAE,qBAAqB,CAC9B,CAAC;IACJ,CAAC;IAED,iBAAiB,CAAC,cAA8B;QAC9C,OAAO,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC;IAED,4BAA4B,CAC1B,cAA8B;QAE9B,OAAO,IAAI,CAAC,+BAA+B,CAAC,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF;AA3BD,wDA2BC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getStringFromEnv } from '@opentelemetry/core';\nimport {\n AggregationTemporality,\n AggregationTemporalitySelector,\n InstrumentType,\n PushMetricExporter,\n ResourceMetrics,\n AggregationSelector,\n AggregationOption,\n AggregationType,\n} from '@opentelemetry/sdk-metrics';\nimport {\n AggregationTemporalityPreference,\n OTLPMetricExporterOptions,\n} from './OTLPMetricExporterOptions';\nimport {\n IOtlpExportDelegate,\n OTLPExporterBase,\n} from '@opentelemetry/otlp-exporter-base';\nimport { diag } from '@opentelemetry/api';\n\nexport const CumulativeTemporalitySelector: AggregationTemporalitySelector =\n () => AggregationTemporality.CUMULATIVE;\n\nexport const DeltaTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.GAUGE:\n case InstrumentType.HISTOGRAM:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.DELTA;\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nexport const LowMemoryTemporalitySelector: AggregationTemporalitySelector = (\n instrumentType: InstrumentType\n) => {\n switch (instrumentType) {\n case InstrumentType.COUNTER:\n case InstrumentType.HISTOGRAM:\n return AggregationTemporality.DELTA;\n case InstrumentType.GAUGE:\n case InstrumentType.UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:\n case InstrumentType.OBSERVABLE_COUNTER:\n case InstrumentType.OBSERVABLE_GAUGE:\n return AggregationTemporality.CUMULATIVE;\n }\n};\n\nfunction chooseTemporalitySelectorFromEnvironment() {\n const configuredTemporality = (\n getStringFromEnv('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE') ??\n 'cumulative'\n ).toLowerCase();\n\n if (configuredTemporality === 'cumulative') {\n return CumulativeTemporalitySelector;\n }\n if (configuredTemporality === 'delta') {\n return DeltaTemporalitySelector;\n }\n if (configuredTemporality === 'lowmemory') {\n return LowMemoryTemporalitySelector;\n }\n\n diag.warn(\n `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${configuredTemporality}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`\n );\n return CumulativeTemporalitySelector;\n}\n\nfunction chooseTemporalitySelector(\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality\n): AggregationTemporalitySelector {\n // Directly passed preference has priority.\n if (temporalityPreference != null) {\n if (temporalityPreference === AggregationTemporalityPreference.DELTA) {\n return DeltaTemporalitySelector;\n } else if (\n temporalityPreference === AggregationTemporalityPreference.LOWMEMORY\n ) {\n return LowMemoryTemporalitySelector;\n }\n return CumulativeTemporalitySelector;\n }\n\n return chooseTemporalitySelectorFromEnvironment();\n}\n\nconst DEFAULT_AGGREGATION = Object.freeze({\n type: AggregationType.DEFAULT,\n});\n\nfunction chooseAggregationSelector(\n config: OTLPMetricExporterOptions | undefined\n): AggregationSelector {\n return config?.aggregationPreference ?? (() => DEFAULT_AGGREGATION);\n}\n\nexport class OTLPMetricExporterBase\n extends OTLPExporterBase<ResourceMetrics>\n implements PushMetricExporter\n{\n private readonly _aggregationTemporalitySelector: AggregationTemporalitySelector;\n private readonly _aggregationSelector: AggregationSelector;\n\n constructor(\n delegate: IOtlpExportDelegate<ResourceMetrics>,\n config?: OTLPMetricExporterOptions\n ) {\n super(delegate);\n this._aggregationSelector = chooseAggregationSelector(config);\n this._aggregationTemporalitySelector = chooseTemporalitySelector(\n config?.temporalityPreference\n );\n }\n\n selectAggregation(instrumentType: InstrumentType): AggregationOption {\n return this._aggregationSelector(instrumentType);\n }\n\n selectAggregationTemporality(\n instrumentType: InstrumentType\n ): AggregationTemporality {\n return this._aggregationTemporalitySelector(instrumentType);\n }\n}\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.AggregationTemporalityPreference = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAeH,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,GAAhC,wCAAgC,KAAhC,wCAAgC,QAI3C","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport {\n AggregationTemporality,\n AggregationSelector,\n} from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n aggregationPreference?: AggregationSelector;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporterOptions.js","sourceRoot":"","sources":["../../src/OTLPMetricExporterOptions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH,IAAY,gCAIX;AAJD,WAAY,gCAAgC;IAC1C,yFAAK,CAAA;IACL,mGAAU,CAAA;IACV,iGAAS,CAAA;AACX,CAAC,EAJW,gCAAgC,GAAhC,wCAAgC,KAAhC,wCAAgC,QAI3C","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport {\n AggregationTemporality,\n AggregationSelector,\n} from '@opentelemetry/sdk-metrics';\n\nexport interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {\n temporalityPreference?:\n | AggregationTemporalityPreference\n | AggregationTemporality;\n aggregationPreference?: AggregationSelector;\n}\n\nexport enum AggregationTemporalityPreference {\n DELTA,\n CUMULATIVE,\n LOWMEMORY,\n}\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.OTLPMetricExporterBase = exports.LowMemoryTemporalitySelector = exports.DeltaTemporalitySelector = exports.CumulativeTemporalitySelector = exports.AggregationTemporalityPreference = exports.OTLPMetricExporter = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,uCAAgD;AAAvC,8GAAA,kBAAkB,OAAA;AAC3B,yEAA+E;AAAtE,6IAAA,gCAAgC,OAAA;AAEzC,mEAKkC;AAJhC,uIAAA,6BAA6B,OAAA;AAC7B,kIAAA,wBAAwB,OAAA;AACxB,sIAAA,4BAA4B,OAAA;AAC5B,gIAAA,sBAAsB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './platform';\nexport { AggregationTemporalityPreference } from './OTLPMetricExporterOptions';\nexport type { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';\nexport {\n CumulativeTemporalitySelector,\n DeltaTemporalitySelector,\n LowMemoryTemporalitySelector,\n OTLPMetricExporterBase,\n} from './OTLPMetricExporterBase';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uCAAgD;AAAvC,8GAAA,kBAAkB,OAAA;AAC3B,yEAA+E;AAAtE,6IAAA,gCAAgC,OAAA;AAEzC,mEAKkC;AAJhC,uIAAA,6BAA6B,OAAA;AAC7B,kIAAA,wBAAwB,OAAA;AACxB,sIAAA,4BAA4B,OAAA;AAC5B,gIAAA,sBAAsB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './platform';\nexport { AggregationTemporalityPreference } from './OTLPMetricExporterOptions';\nexport type { OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';\nexport {\n CumulativeTemporalitySelector,\n DeltaTemporalitySelector,\n LowMemoryTemporalitySelector,\n OTLPMetricExporterBase,\n} from './OTLPMetricExporterBase';\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.OTLPMetricExporter = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,yEAAsE;AAEtE,sEAAwE;AACxE,iFAAuG;AAEvG;;GAEG;AACH,MAAa,kBAAmB,SAAQ,+CAAsB;IAC5D,YAAY,MAA2D;QACrE,KAAK,CACH,IAAA,oDAAqC,EACnC,MAAM,IAAI,EAAE,EACZ,wCAAqB,EACrB,YAAY,EACZ,EAAE,cAAc,EAAE,kBAAkB,EAAE,CACvC,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF;AAZD,gDAYC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(\n createLegacyOtlpBrowserExportDelegate(\n config ?? {},\n JsonMetricsSerializer,\n 'v1/metrics',\n { 'Content-Type': 'application/json' }\n ),\n config\n );\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/browser/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAAsE;AAEtE,sEAAwE;AACxE,iFAAuG;AAEvG;;GAEG;AACH,MAAa,kBAAmB,SAAQ,+CAAsB;IAC5D,YAAY,MAA2D;QACrE,KAAK,CACH,IAAA,oDAAqC,EACnC,MAAM,IAAI,EAAE,EACZ,wCAAqB,EACrB,YAAY,EACZ,EAAE,cAAc,EAAE,kBAAkB,EAAE,CACvC,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF;AAZD,gDAYC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n\n/**\n * Collector Metric Exporter for Web\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterConfigBase & OTLPMetricExporterOptions) {\n super(\n createLegacyOtlpBrowserExportDelegate(\n config ?? {},\n JsonMetricsSerializer,\n 'v1/metrics',\n { 'Content-Type': 'application/json' }\n ),\n config\n );\n }\n}\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.OTLPMetricExporter = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/browser/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.OTLPMetricExporter = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,+BAA4C;AAAnC,0GAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './node';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+BAA4C;AAAnC,0GAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './node';\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.OTLPMetricExporter = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,yEAAsE;AAEtE,sEAAwE;AACxE,2EAGqD;AAErD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,+CAAsB;IAC5D,YAAY,MAA+D;QACzE,KAAK,CACH,IAAA,wCAA4B,EAC1B,IAAA,oCAAwB,EAAC,MAAM,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE;YAC9D,cAAc,EAAE,kBAAkB;SACnC,CAAC,EACF,wCAAqB,CACtB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF;AAZD,gDAYC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport {\n convertLegacyHttpOptions,\n createOtlpHttpExportDelegate,\n} from '@opentelemetry/otlp-exporter-base/node-http';\n\n/**\n * OTLP Metric Exporter for Node.js\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n createOtlpHttpExportDelegate(\n convertLegacyHttpOptions(config ?? {}, 'METRICS', 'v1/metrics', {\n 'Content-Type': 'application/json',\n }),\n JsonMetricsSerializer\n ),\n config\n );\n }\n}\n"]}
1
+ {"version":3,"file":"OTLPMetricExporter.js","sourceRoot":"","sources":["../../../../src/platform/node/OTLPMetricExporter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,yEAAsE;AAEtE,sEAAwE;AACxE,2EAGqD;AAErD;;GAEG;AACH,MAAa,kBAAmB,SAAQ,+CAAsB;IAC5D,YAAY,MAA+D;QACzE,KAAK,CACH,IAAA,wCAA4B,EAC1B,IAAA,oCAAwB,EAAC,MAAM,IAAI,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE;YAC9D,cAAc,EAAE,kBAAkB;SACnC,CAAC,EACF,wCAAqB,CACtB,EACD,MAAM,CACP,CAAC;IACJ,CAAC;CACF;AAZD,gDAYC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';\nimport { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';\nimport { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonMetricsSerializer } from '@opentelemetry/otlp-transformer';\nimport {\n convertLegacyHttpOptions,\n createOtlpHttpExportDelegate,\n} from '@opentelemetry/otlp-exporter-base/node-http';\n\n/**\n * OTLP Metric Exporter for Node.js\n */\nexport class OTLPMetricExporter extends OTLPMetricExporterBase {\n constructor(config?: OTLPExporterNodeConfigBase & OTLPMetricExporterOptions) {\n super(\n createOtlpHttpExportDelegate(\n convertLegacyHttpOptions(config ?? {}, 'METRICS', 'v1/metrics', {\n 'Content-Type': 'application/json',\n }),\n JsonMetricsSerializer\n ),\n config\n );\n }\n}\n"]}
@@ -1,18 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Copyright The OpenTelemetry Authors
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * https://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
4
+ * SPDX-License-Identifier: Apache-2.0
16
5
  */
17
6
  Object.defineProperty(exports, "__esModule", { value: true });
18
7
  exports.OTLPMetricExporter = void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/node/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport { OTLPMetricExporter } from './OTLPMetricExporter';\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.212.0";
1
+ export declare const VERSION = "0.213.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -17,5 +17,5 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.VERSION = void 0;
19
19
  // this is autogenerated file, see scripts/version-update.js
20
- exports.VERSION = '0.212.0';
20
+ exports.VERSION = '0.213.0';
21
21
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.212.0';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,4DAA4D;AAC/C,QAAA,OAAO,GAAG,SAAS,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '0.213.0';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/exporter-metrics-otlp-http",
3
- "version": "0.212.0",
3
+ "version": "0.213.0",
4
4
  "description": "OpenTelemetry Collector Metrics Exporter allows user to send collected metrics to the OpenTelemetry Collector",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/esm/index.js",
@@ -88,13 +88,13 @@
88
88
  "@opentelemetry/api": "^1.3.0"
89
89
  },
90
90
  "dependencies": {
91
- "@opentelemetry/core": "2.5.1",
92
- "@opentelemetry/otlp-exporter-base": "0.212.0",
93
- "@opentelemetry/otlp-transformer": "0.212.0",
94
- "@opentelemetry/resources": "2.5.1",
95
- "@opentelemetry/sdk-metrics": "2.5.1"
91
+ "@opentelemetry/core": "2.6.0",
92
+ "@opentelemetry/otlp-exporter-base": "0.213.0",
93
+ "@opentelemetry/otlp-transformer": "0.213.0",
94
+ "@opentelemetry/resources": "2.6.0",
95
+ "@opentelemetry/sdk-metrics": "2.6.0"
96
96
  },
97
97
  "homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http",
98
98
  "sideEffects": false,
99
- "gitHead": "ad92be4c2c1094745a85b0b7eeff1444a11b1b4a"
99
+ "gitHead": "541e1b4ad83ad2093459794a18283228fe58d199"
100
100
  }