{"version":3,"file":"SpanProcessor.js","sourceRoot":"","sources":["../../src/SpanProcessor.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { Context } from '@opentelemetry/api';\nimport type { ReadableSpan } from './export/ReadableSpan';\nimport type { Span } from './Span';\n\n/**\n * SpanProcessor is the interface Tracer SDK uses to allow synchronous hooks\n * for when a {@link Span} is started or when a {@link Span} is ended.\n */\nexport interface SpanProcessor {\n  /**\n   * Forces to export all finished spans\n   */\n  forceFlush(): Promise<void>;\n\n  /**\n   * Called when a {@link Span} is started, if the `span.isRecording()`\n   * returns true.\n   * @param span the Span that just started.\n   */\n  onStart(span: Span, parentContext: Context): void;\n\n  /**\n   * Called when a {@link Span} is ending, if the `span.isRecording()`\n   * returns true.\n   * @param span the Span that is ending.\n   *\n   * @experimental This method is experimental and may break in minor versions of this package\n   */\n  onEnding?(span: Span): void;\n\n  /**\n   * Called when a {@link ReadableSpan} is ended, if the `span.isRecording()`\n   * returns true.\n   * @param span the Span that just ended.\n   */\n  onEnd(span: ReadableSpan): void;\n\n  /**\n   * Shuts down the processor. Called when SDK is shut down. This is an\n   * opportunity for processor to do any cleanup required.\n   */\n  shutdown(): Promise<void>;\n}\n"]}