mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-20 05:28:25 +02:00
feat: add @actions/cache
This commit is contained in:
parent
b15fb7d098
commit
16e8c96a41
1932 changed files with 261172 additions and 10 deletions
71
node_modules/@opentelemetry/api/build/esm/trace/tracer.d.ts
generated
vendored
Normal file
71
node_modules/@opentelemetry/api/build/esm/trace/tracer.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
import { Context } from '../context/types';
|
||||
import { Span } from './span';
|
||||
import { SpanOptions } from './SpanOptions';
|
||||
/**
|
||||
* Tracer provides an interface for creating {@link Span}s.
|
||||
*/
|
||||
export interface Tracer {
|
||||
/**
|
||||
* Starts a new {@link Span}. Start the span without setting it on context.
|
||||
*
|
||||
* This method do NOT modify the current Context.
|
||||
*
|
||||
* @param name The name of the span
|
||||
* @param [options] SpanOptions used for span creation
|
||||
* @param [context] Context to use to extract parent
|
||||
* @returns Span The newly created span
|
||||
* @example
|
||||
* const span = tracer.startSpan('op');
|
||||
* span.setAttribute('key', 'value');
|
||||
* span.end();
|
||||
*/
|
||||
startSpan(name: string, options?: SpanOptions, context?: Context): Span;
|
||||
/**
|
||||
* Starts a new {@link Span} and calls the given function passing it the
|
||||
* created span as first argument.
|
||||
* Additionally the new span gets set in context and this context is activated
|
||||
* for the duration of the function call.
|
||||
*
|
||||
* @param name The name of the span
|
||||
* @param [options] SpanOptions used for span creation
|
||||
* @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
|
||||
* @example
|
||||
* const something = tracer.startActiveSpan('op', span => {
|
||||
* try {
|
||||
* do some work
|
||||
* span.setStatus({code: SpanStatusCode.OK});
|
||||
* return something;
|
||||
* } catch (err) {
|
||||
* span.setStatus({
|
||||
* code: SpanStatusCode.ERROR,
|
||||
* message: err.message,
|
||||
* });
|
||||
* throw err;
|
||||
* } finally {
|
||||
* span.end();
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* @example
|
||||
* const span = tracer.startActiveSpan('op', span => {
|
||||
* try {
|
||||
* do some work
|
||||
* return span;
|
||||
* } catch (err) {
|
||||
* span.setStatus({
|
||||
* code: SpanStatusCode.ERROR,
|
||||
* message: err.message,
|
||||
* });
|
||||
* throw err;
|
||||
* }
|
||||
* });
|
||||
* do some more work
|
||||
* span.end();
|
||||
*/
|
||||
startActiveSpan<F extends (span: Span) => unknown>(name: string, fn: F): ReturnType<F>;
|
||||
startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, fn: F): ReturnType<F>;
|
||||
startActiveSpan<F extends (span: Span) => unknown>(name: string, options: SpanOptions, context: Context, fn: F): ReturnType<F>;
|
||||
}
|
||||
//# sourceMappingURL=tracer.d.ts.map
|
Loading…
Add table
Add a link
Reference in a new issue