{"version":3,"file":"MetricExporter.js","sourceRoot":"","sources":["../../../src/export/MetricExporter.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ExportResult } from '@opentelemetry/core';\nimport type { AggregationTemporality } from './AggregationTemporality';\nimport type { InstrumentType, ResourceMetrics } from './MetricData';\nimport type { AggregationOption } from '../view/AggregationOption';\n\n/**\n * An interface that allows different metric services to export recorded data\n * in their own format.\n *\n * To export data this MUST be registered to the Metrics SDK with a MetricReader.\n */\nexport interface PushMetricExporter {\n  /**\n   * Called to export sampled {@link ResourceMetrics}.\n   * @param metrics the metric data to be exported.\n   * @param resultCallback callback for when the export has completed\n   */\n  export(\n    metrics: ResourceMetrics,\n    resultCallback: (result: ExportResult) => void\n  ): void;\n\n  /**\n   * Ensure that the export of any metrics the exporter has received is\n   * completed before the returned promise is settled.\n   */\n  forceFlush(): Promise<void>;\n\n  /**\n   * Select the {@link AggregationTemporality} for the given\n   * {@link InstrumentType} for this exporter.\n   */\n  selectAggregationTemporality?(\n    instrumentType: InstrumentType\n  ): AggregationTemporality;\n\n  /**\n   * Select the {@link Aggregation} for the given\n   * {@link InstrumentType} for this exporter.\n   */\n  selectAggregation?(instrumentType: InstrumentType): AggregationOption;\n\n  /**\n   * Returns a promise which resolves when the last exportation is completed.\n   * Further calls to {@link PushMetricExporter.export} may not export the\n   * data.\n   */\n  shutdown(): Promise<void>;\n}\n"]}