From a01683aabb4d7237aa4f90634c73b3de95731e07 Mon Sep 17 00:00:00 2001 From: Mayur Kale Date: Mon, 1 Jul 2019 17:15:19 -0700 Subject: [PATCH] Add SpanExporter --- .../src/trace/export/SpanExporter.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/opentelemetry-types/src/trace/export/SpanExporter.ts diff --git a/packages/opentelemetry-types/src/trace/export/SpanExporter.ts b/packages/opentelemetry-types/src/trace/export/SpanExporter.ts new file mode 100644 index 00000000000..5cdad429af2 --- /dev/null +++ b/packages/opentelemetry-types/src/trace/export/SpanExporter.ts @@ -0,0 +1,32 @@ +/** + * Copyright 2019, OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Span } from '../span'; + +/** + * An interface that allows different tracing services to export recorded data + * for sampled spans in their own format. + */ +export interface SpanExporter { + /** + * Called to export sampled {@link Span}s. + * @param spans the list of sampled Spans to be exported. + */ + export(spans: Span[]): void; + + /** Stops the exporter. */ + stop(): void; +}