Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc committed Jun 26, 2023
0 parents commit a7bddb1
Show file tree
Hide file tree
Showing 1,785 changed files with 39,166 additions and 0 deletions.
41 changes: 41 additions & 0 deletions api/build/esm/api/context.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { Context, ContextManager } from '../context/types';
/**
* Singleton object which represents the entry point to the OpenTelemetry Context API
*/
export declare class ContextAPI {
private static _instance?;
/** Empty private constructor prevents end users from constructing a new instance of the API */
private constructor();
/** Get the singleton instance of the Context API */
static getInstance(): ContextAPI;
/**
* Set the current context manager.
*
* @returns true if the context manager was successfully registered, else false
*/
setGlobalContextManager(contextManager: ContextManager): boolean;
/**
* Get the currently active context
*/
active(): Context;
/**
* Execute a function with an active context
*
* @param context context to be active during function execution
* @param fn function to execute in a context
* @param thisArg optional receiver to be used for calling fn
* @param args optional arguments forwarded to fn
*/
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(context: Context, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
/**
* Bind a context to a target function or event emitter
*
* @param context context to bind to the event emitter or function. Defaults to the currently active context
* @param target function or event emitter to bind
*/
bind<T>(context: Context, target: T): T;
private _getContextManager;
/** Disable and remove the global context manager */
disable(): void;
}
//# sourceMappingURL=context.d.ts.map
30 changes: 30 additions & 0 deletions api/build/esm/api/diag.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ComponentLoggerOptions, DiagLogFunction, DiagLogger, DiagLoggerApi } from '../diag/types';
/**
* Singleton object which represents the entry point to the OpenTelemetry internal
* diagnostic API
*/
export declare class DiagAPI implements DiagLogger, DiagLoggerApi {
private static _instance?;
/** Get the singleton instance of the DiagAPI API */
static instance(): DiagAPI;
/**
* Private internal constructor
* @private
*/
private constructor();
setLogger: DiagLoggerApi['setLogger'];
/**
*
*/
createComponentLogger: (options: ComponentLoggerOptions) => DiagLogger;
verbose: DiagLogFunction;
debug: DiagLogFunction;
info: DiagLogFunction;
warn: DiagLogFunction;
error: DiagLogFunction;
/**
* Unregister the global logger and return to Noop
*/
disable: () => void;
}
//# sourceMappingURL=diag.d.ts.map
28 changes: 28 additions & 0 deletions api/build/esm/api/metrics.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Meter, MeterOptions } from '../metrics/Meter';
import { MeterProvider } from '../metrics/MeterProvider';
/**
* Singleton object which represents the entry point to the OpenTelemetry Metrics API
*/
export declare class MetricsAPI {
private static _instance?;
/** Empty private constructor prevents end users from constructing a new instance of the API */
private constructor();
/** Get the singleton instance of the Metrics API */
static getInstance(): MetricsAPI;
/**
* Set the current global meter provider.
* Returns true if the meter provider was successfully registered, else false.
*/
setGlobalMeterProvider(provider: MeterProvider): boolean;
/**
* Returns the global meter provider.
*/
getMeterProvider(): MeterProvider;
/**
* Returns a meter from the global meter provider.
*/
getMeter(name: string, version?: string, options?: MeterOptions): Meter;
/** Remove the global meter provider */
disable(): void;
}
//# sourceMappingURL=metrics.d.ts.map
49 changes: 49 additions & 0 deletions api/build/esm/api/propagation.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Context } from '../context/types';
import { TextMapGetter, TextMapPropagator, TextMapSetter } from '../propagation/TextMapPropagator';
import { getBaggage, getActiveBaggage, setBaggage, deleteBaggage } from '../baggage/context-helpers';
import { createBaggage } from '../baggage/utils';
/**
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
*/
export declare class PropagationAPI {
private static _instance?;
/** Empty private constructor prevents end users from constructing a new instance of the API */
private constructor();
/** Get the singleton instance of the Propagator API */
static getInstance(): PropagationAPI;
/**
* Set the current propagator.
*
* @returns true if the propagator was successfully registered, else false
*/
setGlobalPropagator(propagator: TextMapPropagator): boolean;
/**
* Inject context into a carrier to be propagated inter-process
*
* @param context Context carrying tracing data to inject
* @param carrier carrier to inject context into
* @param setter Function used to set values on the carrier
*/
inject<Carrier>(context: Context, carrier: Carrier, setter?: TextMapSetter<Carrier>): void;
/**
* Extract context from a carrier
*
* @param context Context which the newly created context will inherit from
* @param carrier Carrier to extract context from
* @param getter Function used to extract keys from a carrier
*/
extract<Carrier>(context: Context, carrier: Carrier, getter?: TextMapGetter<Carrier>): Context;
/**
* Return a list of all fields which may be used by the propagator.
*/
fields(): string[];
/** Remove the global propagator */
disable(): void;
createBaggage: typeof createBaggage;
getBaggage: typeof getBaggage;
getActiveBaggage: typeof getActiveBaggage;
setBaggage: typeof setBaggage;
deleteBaggage: typeof deleteBaggage;
private _getGlobalPropagator;
}
//# sourceMappingURL=propagation.d.ts.map
40 changes: 40 additions & 0 deletions api/build/esm/api/trace.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { isSpanContextValid, wrapSpanContext } from '../trace/spancontext-utils';
import { Tracer } from '../trace/tracer';
import { TracerProvider } from '../trace/tracer_provider';
import { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext } from '../trace/context-utils';
/**
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
*/
export declare class TraceAPI {
private static _instance?;
private _proxyTracerProvider;
/** Empty private constructor prevents end users from constructing a new instance of the API */
private constructor();
/** Get the singleton instance of the Trace API */
static getInstance(): TraceAPI;
/**
* Set the current global tracer.
*
* @returns true if the tracer provider was successfully registered, else false
*/
setGlobalTracerProvider(provider: TracerProvider): boolean;
/**
* Returns the global tracer provider.
*/
getTracerProvider(): TracerProvider;
/**
* Returns a tracer from the global tracer provider.
*/
getTracer(name: string, version?: string): Tracer;
/** Remove the global tracer provider */
disable(): void;
wrapSpanContext: typeof wrapSpanContext;
isSpanContextValid: typeof isSpanContextValid;
deleteSpan: typeof deleteSpan;
getSpan: typeof getSpan;
getActiveSpan: typeof getActiveSpan;
getSpanContext: typeof getSpanContext;
setSpan: typeof setSpan;
setSpanContext: typeof setSpanContext;
}
//# sourceMappingURL=trace.d.ts.map
29 changes: 29 additions & 0 deletions api/build/esm/baggage/context-helpers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { Context } from '../context/types';
import { Baggage } from './types';
/**
* Retrieve the current baggage from the given context
*
* @param {Context} Context that manage all context values
* @returns {Baggage} Extracted baggage from the context
*/
export declare function getBaggage(context: Context): Baggage | undefined;
/**
* Retrieve the current baggage from the active/current context
*
* @returns {Baggage} Extracted baggage from the context
*/
export declare function getActiveBaggage(): Baggage | undefined;
/**
* Store a baggage in the given context
*
* @param {Context} Context that manage all context values
* @param {Baggage} baggage that will be set in the actual context
*/
export declare function setBaggage(context: Context, baggage: Baggage): Context;
/**
* Delete the baggage stored in the given context
*
* @param {Context} Context that manage all context values
*/
export declare function deleteBaggage(context: Context): Context;
//# sourceMappingURL=context-helpers.d.ts.map
12 changes: 12 additions & 0 deletions api/build/esm/baggage/internal/baggage-impl.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { Baggage, BaggageEntry } from '../types';
export declare class BaggageImpl implements Baggage {
private _entries;
constructor(entries?: Map<string, BaggageEntry>);
getEntry(key: string): BaggageEntry | undefined;
getAllEntries(): [string, BaggageEntry][];
setEntry(key: string, entry: BaggageEntry): BaggageImpl;
removeEntry(key: string): BaggageImpl;
removeEntries(...keys: string[]): BaggageImpl;
clear(): BaggageImpl;
}
//# sourceMappingURL=baggage-impl.d.ts.map
5 changes: 5 additions & 0 deletions api/build/esm/baggage/internal/symbol.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* Symbol used to make BaggageEntryMetadata an opaque type
*/
export declare const baggageEntryMetadataSymbol: unique symbol;
//# sourceMappingURL=symbol.d.ts.map
60 changes: 60 additions & 0 deletions api/build/esm/baggage/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { baggageEntryMetadataSymbol } from './internal/symbol';
export interface BaggageEntry {
/** `String` value of the `BaggageEntry`. */
value: string;
/**
* Metadata is an optional string property defined by the W3C baggage specification.
* It currently has no special meaning defined by the specification.
*/
metadata?: BaggageEntryMetadata;
}
/**
* Serializable Metadata defined by the W3C baggage specification.
* It currently has no special meaning defined by the OpenTelemetry or W3C.
*/
export declare type BaggageEntryMetadata = {
toString(): string;
} & {
__TYPE__: typeof baggageEntryMetadataSymbol;
};
/**
* Baggage represents collection of key-value pairs with optional metadata.
* Each key of Baggage is associated with exactly one value.
* Baggage may be used to annotate and enrich telemetry data.
*/
export interface Baggage {
/**
* Get an entry from Baggage if it exists
*
* @param key The key which identifies the BaggageEntry
*/
getEntry(key: string): BaggageEntry | undefined;
/**
* Get a list of all entries in the Baggage
*/
getAllEntries(): [string, BaggageEntry][];
/**
* Returns a new baggage with the entries from the current bag and the specified entry
*
* @param key string which identifies the baggage entry
* @param entry BaggageEntry for the given key
*/
setEntry(key: string, entry: BaggageEntry): Baggage;
/**
* Returns a new baggage with the entries from the current bag except the removed entry
*
* @param key key identifying the entry to be removed
*/
removeEntry(key: string): Baggage;
/**
* Returns a new baggage with the entries from the current bag except the removed entries
*
* @param key keys identifying the entries to be removed
*/
removeEntries(...key: string[]): Baggage;
/**
* Returns a new baggage with no entries
*/
clear(): Baggage;
}
//# sourceMappingURL=types.d.ts.map
15 changes: 15 additions & 0 deletions api/build/esm/baggage/utils.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';
/**
* Create a new Baggage with optional entries
*
* @param entries An array of baggage entries the new baggage should contain
*/
export declare function createBaggage(entries?: Record<string, BaggageEntry>): Baggage;
/**
* Create a serializable BaggageEntryMetadata object from a string.
*
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
*
*/
export declare function baggageEntryMetadataFromString(str: string): BaggageEntryMetadata;
//# sourceMappingURL=utils.d.ts.map
15 changes: 15 additions & 0 deletions api/build/esm/common/Attributes.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Attributes is a map from string to attribute values.
*
* Note: only the own enumerable keys are counted as valid attribute keys.
*/
export interface Attributes {
[attributeKey: string]: AttributeValue | undefined;
}
/**
* Attribute values may be any non-nullish primitive value except an object.
*
* null or undefined attribute values are invalid and will result in undefined behavior.
*/
export declare type AttributeValue = string | number | boolean | Array<null | undefined | string> | Array<null | undefined | number> | Array<null | undefined | boolean>;
//# sourceMappingURL=Attributes.d.ts.map
26 changes: 26 additions & 0 deletions api/build/esm/common/Exception.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
interface ExceptionWithCode {
code: string | number;
name?: string;
message?: string;
stack?: string;
}
interface ExceptionWithMessage {
code?: string | number;
message: string;
name?: string;
stack?: string;
}
interface ExceptionWithName {
code?: string | number;
message?: string;
name: string;
stack?: string;
}
/**
* Defines Exception.
*
* string or an object with one of (message or name or code) and optional stack
*/
export declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string;
export {};
//# sourceMappingURL=Exception.d.ts.map
20 changes: 20 additions & 0 deletions api/build/esm/common/Time.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* Defines High-Resolution Time.
*
* The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
* The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
* For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
* The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
* HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
* The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
* HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
* This is represented in HrTime format as [1609504210, 150000000].
*/
export declare type HrTime = [number, number];
/**
* Defines TimeInput.
*
* hrtime, epoch milliseconds, performance.now() or Date
*/
export declare type TimeInput = HrTime | number | Date;
//# sourceMappingURL=Time.d.ts.map
Loading

0 comments on commit a7bddb1

Please sign in to comment.