Estructura inicial del proyecto
This commit is contained in:
21
backend/node_modules/@azure/core-tracing/LICENSE
generated
vendored
Normal file
21
backend/node_modules/@azure/core-tracing/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
35
backend/node_modules/@azure/core-tracing/README.md
generated
vendored
Normal file
35
backend/node_modules/@azure/core-tracing/README.md
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
# Azure Core tracing library for JavaScript
|
||||
|
||||
This is the core tracing library that provides low-level interfaces and helper methods for tracing in Azure SDK JavaScript libraries which work in the browser and Node.js.
|
||||
|
||||
## Getting started
|
||||
|
||||
### Installation
|
||||
|
||||
This package is primarily used in Azure client libraries and not meant to be used directly by consumers of Azure SDKs.
|
||||
|
||||
## Key Concepts
|
||||
|
||||
- `TracingClient` is the primary interface providing tracing functionality to client libraries. Client libraries should only be aware of and interact with a `TracingClient` instance.
|
||||
- A `TracingClient` implementation can be created using the `createTracingClient` factory function.
|
||||
- `Instrumenter` provides an abstraction over an instrumentation and acts as the interop point for using third party libraries like OpenTelemetry. By default, a no-op `Instrumenter` is used. Customers who wish to enable `OpenTelemetry` based tracing will do so by installing and registering the [@azure/opentelemetry-instrumentation-azure-sdk] package.
|
||||
- `TracingContext` is an **immutable** data container, used to pass operation-specific information around (such as span parenting information).
|
||||
- `TracingSpan` is an abstraction of a `Span` which can be used to record events, attributes, and exceptions.
|
||||
|
||||
## Examples
|
||||
|
||||
Examples can be found in the `samples` folder.
|
||||
|
||||
## Next steps
|
||||
|
||||
You can build and run the tests locally by executing `npm run test`. Explore the `test` folder to see advanced usage and behavior of the public classes.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you run into issues while using this library, please feel free to [file an issue](https://github.com/Azure/azure-sdk-for-js/issues/new).
|
||||
|
||||
## Contributing
|
||||
|
||||
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
|
||||
|
||||
[@azure/opentelemetry-instrumentation-azure-sdk]: https://www.npmjs.com/package/@azure/opentelemetry-instrumentation-azure-sdk
|
||||
4
backend/node_modules/@azure/core-tracing/dist/browser/index.d.ts
generated
vendored
Normal file
4
backend/node_modules/@azure/core-tracing/dist/browser/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export { AddEventOptions, Instrumenter, InstrumenterSpanOptions, OperationTracingOptions, OptionsWithTracingContext, Resolved, SpanStatus, SpanStatusError, SpanStatusSuccess, TracingClient, TracingClientOptions, TracingContext, TracingSpan, TracingSpanKind, TracingSpanLink, TracingSpanOptions, } from "./interfaces.js";
|
||||
export { useInstrumenter } from "./instrumenter.js";
|
||||
export { createTracingClient } from "./tracingClient.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
5
backend/node_modules/@azure/core-tracing/dist/browser/index.js
generated
vendored
Normal file
5
backend/node_modules/@azure/core-tracing/dist/browser/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
export { useInstrumenter } from "./instrumenter.js";
|
||||
export { createTracingClient } from "./tracingClient.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/browser/index.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/browser/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAoBlC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n AddEventOptions,\n Instrumenter,\n InstrumenterSpanOptions,\n OperationTracingOptions,\n OptionsWithTracingContext,\n Resolved,\n SpanStatus,\n SpanStatusError,\n SpanStatusSuccess,\n TracingClient,\n TracingClientOptions,\n TracingContext,\n TracingSpan,\n TracingSpanKind,\n TracingSpanLink,\n TracingSpanOptions,\n} from \"./interfaces.js\";\nexport { useInstrumenter } from \"./instrumenter.js\";\nexport { createTracingClient } from \"./tracingClient.js\";\n"]}
|
||||
16
backend/node_modules/@azure/core-tracing/dist/browser/instrumenter.d.ts
generated
vendored
Normal file
16
backend/node_modules/@azure/core-tracing/dist/browser/instrumenter.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import type { Instrumenter, TracingSpan } from "./interfaces.js";
|
||||
export declare function createDefaultTracingSpan(): TracingSpan;
|
||||
export declare function createDefaultInstrumenter(): Instrumenter;
|
||||
/**
|
||||
* Extends the Azure SDK with support for a given instrumenter implementation.
|
||||
*
|
||||
* @param instrumenter - The instrumenter implementation to use.
|
||||
*/
|
||||
export declare function useInstrumenter(instrumenter: Instrumenter): void;
|
||||
/**
|
||||
* Gets the currently set instrumenter, a No-Op instrumenter by default.
|
||||
*
|
||||
* @returns The currently set instrumenter
|
||||
*/
|
||||
export declare function getInstrumenter(): Instrumenter;
|
||||
//# sourceMappingURL=instrumenter.d.ts.map
|
||||
63
backend/node_modules/@azure/core-tracing/dist/browser/instrumenter.js
generated
vendored
Normal file
63
backend/node_modules/@azure/core-tracing/dist/browser/instrumenter.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { createTracingContext } from "./tracingContext.js";
|
||||
import { state } from "./state.js";
|
||||
export function createDefaultTracingSpan() {
|
||||
return {
|
||||
end: () => {
|
||||
// noop
|
||||
},
|
||||
isRecording: () => false,
|
||||
recordException: () => {
|
||||
// noop
|
||||
},
|
||||
setAttribute: () => {
|
||||
// noop
|
||||
},
|
||||
setStatus: () => {
|
||||
// noop
|
||||
},
|
||||
addEvent: () => {
|
||||
// noop
|
||||
},
|
||||
};
|
||||
}
|
||||
export function createDefaultInstrumenter() {
|
||||
return {
|
||||
createRequestHeaders: () => {
|
||||
return {};
|
||||
},
|
||||
parseTraceparentHeader: () => {
|
||||
return undefined;
|
||||
},
|
||||
startSpan: (_name, spanOptions) => {
|
||||
return {
|
||||
span: createDefaultTracingSpan(),
|
||||
tracingContext: createTracingContext({ parentContext: spanOptions.tracingContext }),
|
||||
};
|
||||
},
|
||||
withContext(_context, callback, ...callbackArgs) {
|
||||
return callback(...callbackArgs);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Extends the Azure SDK with support for a given instrumenter implementation.
|
||||
*
|
||||
* @param instrumenter - The instrumenter implementation to use.
|
||||
*/
|
||||
export function useInstrumenter(instrumenter) {
|
||||
state.instrumenterImplementation = instrumenter;
|
||||
}
|
||||
/**
|
||||
* Gets the currently set instrumenter, a No-Op instrumenter by default.
|
||||
*
|
||||
* @returns The currently set instrumenter
|
||||
*/
|
||||
export function getInstrumenter() {
|
||||
if (!state.instrumenterImplementation) {
|
||||
state.instrumenterImplementation = createDefaultInstrumenter();
|
||||
}
|
||||
return state.instrumenterImplementation;
|
||||
}
|
||||
//# sourceMappingURL=instrumenter.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/browser/instrumenter.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/browser/instrumenter.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"instrumenter.js","sourceRoot":"","sources":["../../src/instrumenter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,GAAG,EAAE,GAAG,EAAE;YACR,OAAO;QACT,CAAC;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK;QACxB,eAAe,EAAE,GAAG,EAAE;YACpB,OAAO;QACT,CAAC;QACD,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO;QACT,CAAC;QACD,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE;YACb,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,oBAAoB,EAAE,GAA2B,EAAE;YACjD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,sBAAsB,EAAE,GAA+B,EAAE;YACvD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,CACT,KAAa,EACb,WAAoC,EACmB,EAAE;YACzD,OAAO;gBACL,IAAI,EAAE,wBAAwB,EAAE;gBAChC,cAAc,EAAE,oBAAoB,CAAC,EAAE,aAAa,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC;aACpF,CAAC;QACJ,CAAC;QACD,WAAW,CAIT,QAAwB,EACxB,QAAkB,EAClB,GAAG,YAA0B;YAE7B,OAAO,QAAQ,CAAC,GAAG,YAAY,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,YAA0B;IACxD,KAAK,CAAC,0BAA0B,GAAG,YAAY,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE,CAAC;QACtC,KAAK,CAAC,0BAA0B,GAAG,yBAAyB,EAAE,CAAC;IACjE,CAAC;IACD,OAAO,KAAK,CAAC,0BAA0B,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n Instrumenter,\n InstrumenterSpanOptions,\n TracingContext,\n TracingSpan,\n} from \"./interfaces.js\";\n\nimport { createTracingContext } from \"./tracingContext.js\";\nimport { state } from \"./state.js\";\n\nexport function createDefaultTracingSpan(): TracingSpan {\n return {\n end: () => {\n // noop\n },\n isRecording: () => false,\n recordException: () => {\n // noop\n },\n setAttribute: () => {\n // noop\n },\n setStatus: () => {\n // noop\n },\n addEvent: () => {\n // noop\n },\n };\n}\n\nexport function createDefaultInstrumenter(): Instrumenter {\n return {\n createRequestHeaders: (): Record<string, string> => {\n return {};\n },\n parseTraceparentHeader: (): TracingContext | undefined => {\n return undefined;\n },\n startSpan: (\n _name: string,\n spanOptions: InstrumenterSpanOptions,\n ): { span: TracingSpan; tracingContext: TracingContext } => {\n return {\n span: createDefaultTracingSpan(),\n tracingContext: createTracingContext({ parentContext: spanOptions.tracingContext }),\n };\n },\n withContext<\n CallbackArgs extends unknown[],\n Callback extends (...args: CallbackArgs) => ReturnType<Callback>,\n >(\n _context: TracingContext,\n callback: Callback,\n ...callbackArgs: CallbackArgs\n ): ReturnType<Callback> {\n return callback(...callbackArgs);\n },\n };\n}\n\n/**\n * Extends the Azure SDK with support for a given instrumenter implementation.\n *\n * @param instrumenter - The instrumenter implementation to use.\n */\nexport function useInstrumenter(instrumenter: Instrumenter): void {\n state.instrumenterImplementation = instrumenter;\n}\n\n/**\n * Gets the currently set instrumenter, a No-Op instrumenter by default.\n *\n * @returns The currently set instrumenter\n */\nexport function getInstrumenter(): Instrumenter {\n if (!state.instrumenterImplementation) {\n state.instrumenterImplementation = createDefaultInstrumenter();\n }\n return state.instrumenterImplementation;\n}\n"]}
|
||||
288
backend/node_modules/@azure/core-tracing/dist/browser/interfaces.d.ts
generated
vendored
Normal file
288
backend/node_modules/@azure/core-tracing/dist/browser/interfaces.d.ts
generated
vendored
Normal file
@ -0,0 +1,288 @@
|
||||
/**
|
||||
* A narrower version of TypeScript 4.5's Awaited type which Recursively
|
||||
* unwraps the "awaited type", emulating the behavior of `await`.
|
||||
*/
|
||||
export type Resolved<T> = T extends {
|
||||
then(onfulfilled: infer F): any;
|
||||
} ? F extends (value: infer V) => any ? Resolved<V> : never : T;
|
||||
/**
|
||||
* Represents a client that can integrate with the currently configured {@link Instrumenter}.
|
||||
*
|
||||
* Create an instance using {@link createTracingClient}.
|
||||
*/
|
||||
export interface TracingClient {
|
||||
/**
|
||||
* Wraps a callback in a tracing span, calls the callback, and closes the span.
|
||||
*
|
||||
* This is the primary interface for using Tracing and will handle error recording as well as setting the status on the span.
|
||||
*
|
||||
* Both synchronous and asynchronous functions will be awaited in order to reflect the result of the callback on the span.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```ts snippet:ReadmeSampleWithSpanExample
|
||||
* import { createTracingClient } from "@azure/core-tracing";
|
||||
*
|
||||
* const tracingClient = createTracingClient({
|
||||
* namespace: "test.namespace",
|
||||
* packageName: "test-package",
|
||||
* packageVersion: "1.0.0",
|
||||
* });
|
||||
*
|
||||
* const options = {};
|
||||
*
|
||||
* const myOperationResult = await tracingClient.withSpan(
|
||||
* "myClassName.myOperationName",
|
||||
* options,
|
||||
* (updatedOptions) => {
|
||||
* // Do something with the updated options.
|
||||
* return "myOperationResult";
|
||||
* },
|
||||
* );
|
||||
* ```
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param operationOptions - The original options passed to the method. The callback will receive these options with the newly created {@link TracingContext}.
|
||||
* @param callback - The callback to be invoked with the updated options and newly created {@link TracingSpan}.
|
||||
*/
|
||||
withSpan<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}, Callback extends (updatedOptions: Options, span: Omit<TracingSpan, "end">) => ReturnType<Callback>>(name: string, operationOptions: Options, callback: Callback, spanOptions?: TracingSpanOptions): Promise<Resolved<ReturnType<Callback>>>;
|
||||
/**
|
||||
* Starts a given span but does not set it as the active span.
|
||||
*
|
||||
* You must end the span using {@link TracingSpan.end}.
|
||||
*
|
||||
* Most of the time you will want to use {@link withSpan} instead.
|
||||
*
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param operationOptions - The original operation options.
|
||||
* @param spanOptions - The options to use when creating the span.
|
||||
*
|
||||
* @returns A {@link TracingSpan} and the updated operation options.
|
||||
*/
|
||||
startSpan<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}>(name: string, operationOptions?: Options, spanOptions?: TracingSpanOptions): {
|
||||
span: TracingSpan;
|
||||
updatedOptions: OptionsWithTracingContext<Options>;
|
||||
};
|
||||
/**
|
||||
* Wraps a callback with an active context and calls the callback.
|
||||
* Depending on the implementation, this may set the globally available active context.
|
||||
*
|
||||
* Useful when you want to leave the boundaries of the SDK (make a request or callback to user code) and are unable to use the {@link withSpan} API.
|
||||
*
|
||||
* @param context - The {@link TracingContext} to use as the active context in the scope of the callback.
|
||||
* @param callback - The callback to be invoked with the given context set as the globally active context.
|
||||
* @param callbackArgs - The callback arguments.
|
||||
*/
|
||||
withContext<CallbackArgs extends unknown[], Callback extends (...args: CallbackArgs) => ReturnType<Callback>>(context: TracingContext, callback: Callback, ...callbackArgs: CallbackArgs): ReturnType<Callback>;
|
||||
/**
|
||||
* Parses a traceparent header value into a {@link TracingSpanContext}.
|
||||
*
|
||||
* @param traceparentHeader - The traceparent header to parse.
|
||||
* @returns An implementation-specific identifier for the span.
|
||||
*/
|
||||
parseTraceparentHeader(traceparentHeader: string): TracingContext | undefined;
|
||||
/**
|
||||
* Creates a set of request headers to propagate tracing information to a backend.
|
||||
*
|
||||
* @param tracingContext - The context containing the span to propagate.
|
||||
* @returns The set of headers to add to a request.
|
||||
*/
|
||||
createRequestHeaders(tracingContext?: TracingContext): Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Options that can be passed to {@link createTracingClient}
|
||||
*/
|
||||
export interface TracingClientOptions {
|
||||
/** The value of the az.namespace tracing attribute on newly created spans. */
|
||||
namespace: string;
|
||||
/** The name of the package invoking this trace. */
|
||||
packageName: string;
|
||||
/** An optional version of the package invoking this trace. */
|
||||
packageVersion?: string;
|
||||
}
|
||||
/** The kind of span. */
|
||||
export type TracingSpanKind = "client" | "server" | "producer" | "consumer" | "internal";
|
||||
/** Options used to configure the newly created span. */
|
||||
export interface TracingSpanOptions {
|
||||
/** The kind of span. Implementations should default this to "client". */
|
||||
spanKind?: TracingSpanKind;
|
||||
/** A collection of {@link TracingSpanLink} to link to this span. */
|
||||
spanLinks?: TracingSpanLink[];
|
||||
/** Initial set of attributes to set on a span. */
|
||||
spanAttributes?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
/** A pointer from the current {@link TracingSpan} to another span in the same or a different trace. */
|
||||
export interface TracingSpanLink {
|
||||
/** The {@link TracingContext} containing the span context to link to. */
|
||||
tracingContext: TracingContext;
|
||||
/** A set of attributes on the link. */
|
||||
attributes?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents an implementation agnostic instrumenter.
|
||||
*/
|
||||
export interface Instrumenter {
|
||||
/**
|
||||
* Creates a new {@link TracingSpan} with the given name and options and sets it on a new context.
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param spanOptions - The options to use when creating the span.
|
||||
*
|
||||
* @returns A {@link TracingSpan} that can be used to end the span, and the context this span has been set on.
|
||||
*/
|
||||
startSpan(name: string, spanOptions: InstrumenterSpanOptions): {
|
||||
span: TracingSpan;
|
||||
tracingContext: TracingContext;
|
||||
};
|
||||
/**
|
||||
* Wraps a callback with an active context and calls the callback.
|
||||
* Depending on the implementation, this may set the globally available active context.
|
||||
*
|
||||
* @param context - The {@link TracingContext} to use as the active context in the scope of the callback.
|
||||
* @param callback - The callback to be invoked with the given context set as the globally active context.
|
||||
* @param callbackArgs - The callback arguments.
|
||||
*/
|
||||
withContext<CallbackArgs extends unknown[], Callback extends (...args: CallbackArgs) => ReturnType<Callback>>(context: TracingContext, callback: Callback, ...callbackArgs: CallbackArgs): ReturnType<Callback>;
|
||||
/**
|
||||
* Provides an implementation-specific method to parse a {@link https://www.w3.org/TR/trace-context/#traceparent-header}
|
||||
* into a {@link TracingSpanContext} which can be used to link non-parented spans together.
|
||||
*/
|
||||
parseTraceparentHeader(traceparentHeader: string): TracingContext | undefined;
|
||||
/**
|
||||
* Provides an implementation-specific method to serialize a {@link TracingSpan} to a set of headers.
|
||||
* @param tracingContext - The context containing the span to serialize.
|
||||
*/
|
||||
createRequestHeaders(tracingContext?: TracingContext): Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Options passed to {@link Instrumenter.startSpan} as a superset of {@link TracingSpanOptions}.
|
||||
*/
|
||||
export interface InstrumenterSpanOptions extends TracingSpanOptions {
|
||||
/** The name of the package invoking this trace. */
|
||||
packageName: string;
|
||||
/** The version of the package invoking this trace. */
|
||||
packageVersion?: string;
|
||||
/** The current tracing context. Defaults to an implementation-specific "active" context. */
|
||||
tracingContext?: TracingContext;
|
||||
}
|
||||
/**
|
||||
* Status representing a successful operation that can be sent to {@link TracingSpan.setStatus}
|
||||
*/
|
||||
export type SpanStatusSuccess = {
|
||||
status: "success";
|
||||
};
|
||||
/**
|
||||
* Status representing an error that can be sent to {@link TracingSpan.setStatus}
|
||||
*/
|
||||
export type SpanStatusError = {
|
||||
status: "error";
|
||||
error?: Error | string;
|
||||
};
|
||||
/**
|
||||
* Represents the statuses that can be passed to {@link TracingSpan.setStatus}.
|
||||
*
|
||||
* By default, all spans will be created with status "unset".
|
||||
*/
|
||||
export type SpanStatus = SpanStatusSuccess | SpanStatusError;
|
||||
/**
|
||||
* Represents options you can pass to {@link TracingSpan.addEvent}.
|
||||
*/
|
||||
export interface AddEventOptions {
|
||||
/**
|
||||
* A set of attributes to attach to the event.
|
||||
*/
|
||||
attributes?: Record<string, unknown>;
|
||||
/**
|
||||
* The start time of the event.
|
||||
*/
|
||||
startTime?: Date;
|
||||
}
|
||||
/**
|
||||
* Represents an implementation agnostic tracing span.
|
||||
*/
|
||||
export interface TracingSpan {
|
||||
/**
|
||||
* Sets the status of the span. When an error is provided, it will be recorded on the span as well.
|
||||
*
|
||||
* @param status - The {@link SpanStatus} to set on the span.
|
||||
*/
|
||||
setStatus(status: SpanStatus): void;
|
||||
/**
|
||||
* Sets a given attribute on a span.
|
||||
*
|
||||
* @param name - The attribute's name.
|
||||
* @param value - The attribute's value to set. May be any non-nullish value.
|
||||
*/
|
||||
setAttribute(name: string, value: unknown): void;
|
||||
/**
|
||||
* Ends the span.
|
||||
*/
|
||||
end(): void;
|
||||
/**
|
||||
* Records an exception on a {@link TracingSpan} without modifying its status.
|
||||
*
|
||||
* When recording an unhandled exception that should fail the span, please use {@link TracingSpan.setStatus} instead.
|
||||
*
|
||||
* @param exception - The exception to record on the span.
|
||||
*
|
||||
*/
|
||||
recordException(exception: Error | string): void;
|
||||
/**
|
||||
* Returns true if this {@link TracingSpan} is recording information.
|
||||
*
|
||||
* Depending on the span implementation, this may return false if the span is not being sampled.
|
||||
*/
|
||||
isRecording(): boolean;
|
||||
/**
|
||||
* Adds an event to the span.
|
||||
*/
|
||||
addEvent?(name: string, options?: AddEventOptions): void;
|
||||
}
|
||||
/** An immutable context bag of tracing values for the current operation. */
|
||||
export interface TracingContext {
|
||||
/**
|
||||
* Sets a given object on a context.
|
||||
* @param key - The key of the given context value.
|
||||
* @param value - The value to set on the context.
|
||||
*
|
||||
* @returns - A new context with the given value set.
|
||||
*/
|
||||
setValue(key: symbol, value: unknown): TracingContext;
|
||||
/**
|
||||
* Gets an object from the context if it exists.
|
||||
* @param key - The key of the given context value.
|
||||
*
|
||||
* @returns - The value of the given context value if it exists, otherwise `undefined`.
|
||||
*/
|
||||
getValue(key: symbol): unknown;
|
||||
/**
|
||||
* Deletes an object from the context if it exists.
|
||||
* @param key - The key of the given context value to delete.
|
||||
*/
|
||||
deleteValue(key: symbol): TracingContext;
|
||||
}
|
||||
/**
|
||||
* Tracing options to set on an operation.
|
||||
*/
|
||||
export interface OperationTracingOptions {
|
||||
/** The context to use for created Tracing Spans. */
|
||||
tracingContext?: TracingContext;
|
||||
}
|
||||
/**
|
||||
* A utility type for when we know a TracingContext has been set
|
||||
* as part of an operation's options.
|
||||
*/
|
||||
export type OptionsWithTracingContext<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}> = Options & {
|
||||
tracingOptions: {
|
||||
tracingContext: TracingContext;
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=interfaces.d.ts.map
|
||||
4
backend/node_modules/@azure/core-tracing/dist/browser/interfaces.js
generated
vendored
Normal file
4
backend/node_modules/@azure/core-tracing/dist/browser/interfaces.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
export {};
|
||||
//# sourceMappingURL=interfaces.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/browser/interfaces.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/browser/interfaces.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
backend/node_modules/@azure/core-tracing/dist/browser/package.json
generated
vendored
Normal file
3
backend/node_modules/@azure/core-tracing/dist/browser/package.json
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
1
backend/node_modules/@azure/core-tracing/dist/browser/state-browser.mjs.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/browser/state-browser.mjs.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"state-browser.mjs","sourceRoot":"","sources":["../../src/state-browser.mts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,0BAA0B,EAAE,SAAqC;CAClE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Instrumenter } from \"./interfaces.js\";\n\n/**\n * Browser-only implementation of the module's state. The browser esm variant will not load the commonjs state, so we do not need to share state between the two.\n */\nexport const state = {\n instrumenterImplementation: undefined as Instrumenter | undefined,\n};\n"]}
|
||||
8
backend/node_modules/@azure/core-tracing/dist/browser/state.d.ts
generated
vendored
Normal file
8
backend/node_modules/@azure/core-tracing/dist/browser/state.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import type { Instrumenter } from "./interfaces.js";
|
||||
/**
|
||||
* Browser-only implementation of the module's state. The browser esm variant will not load the commonjs state, so we do not need to share state between the two.
|
||||
*/
|
||||
export declare const state: {
|
||||
instrumenterImplementation: Instrumenter | undefined;
|
||||
};
|
||||
//# sourceMappingURL=state-browser.d.mts.map
|
||||
9
backend/node_modules/@azure/core-tracing/dist/browser/state.js
generated
vendored
Normal file
9
backend/node_modules/@azure/core-tracing/dist/browser/state.js
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
/**
|
||||
* Browser-only implementation of the module's state. The browser esm variant will not load the commonjs state, so we do not need to share state between the two.
|
||||
*/
|
||||
export const state = {
|
||||
instrumenterImplementation: undefined,
|
||||
};
|
||||
//# sourceMappingURL=state-browser.mjs.map
|
||||
9
backend/node_modules/@azure/core-tracing/dist/browser/tracingClient.d.ts
generated
vendored
Normal file
9
backend/node_modules/@azure/core-tracing/dist/browser/tracingClient.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import type { TracingClient, TracingClientOptions } from "./interfaces.js";
|
||||
/**
|
||||
* Creates a new tracing client.
|
||||
*
|
||||
* @param options - Options used to configure the tracing client.
|
||||
* @returns - An instance of {@link TracingClient}.
|
||||
*/
|
||||
export declare function createTracingClient(options: TracingClientOptions): TracingClient;
|
||||
//# sourceMappingURL=tracingClient.d.ts.map
|
||||
78
backend/node_modules/@azure/core-tracing/dist/browser/tracingClient.js
generated
vendored
Normal file
78
backend/node_modules/@azure/core-tracing/dist/browser/tracingClient.js
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { getInstrumenter } from "./instrumenter.js";
|
||||
import { knownContextKeys } from "./tracingContext.js";
|
||||
/**
|
||||
* Creates a new tracing client.
|
||||
*
|
||||
* @param options - Options used to configure the tracing client.
|
||||
* @returns - An instance of {@link TracingClient}.
|
||||
*/
|
||||
export function createTracingClient(options) {
|
||||
const { namespace, packageName, packageVersion } = options;
|
||||
function startSpan(name, operationOptions, spanOptions) {
|
||||
const startSpanResult = getInstrumenter().startSpan(name, {
|
||||
...spanOptions,
|
||||
packageName: packageName,
|
||||
packageVersion: packageVersion,
|
||||
tracingContext: operationOptions?.tracingOptions?.tracingContext,
|
||||
});
|
||||
let tracingContext = startSpanResult.tracingContext;
|
||||
const span = startSpanResult.span;
|
||||
if (!tracingContext.getValue(knownContextKeys.namespace)) {
|
||||
tracingContext = tracingContext.setValue(knownContextKeys.namespace, namespace);
|
||||
}
|
||||
span.setAttribute("az.namespace", tracingContext.getValue(knownContextKeys.namespace));
|
||||
const updatedOptions = Object.assign({}, operationOptions, {
|
||||
tracingOptions: { ...operationOptions?.tracingOptions, tracingContext },
|
||||
});
|
||||
return {
|
||||
span,
|
||||
updatedOptions,
|
||||
};
|
||||
}
|
||||
async function withSpan(name, operationOptions, callback, spanOptions) {
|
||||
const { span, updatedOptions } = startSpan(name, operationOptions, spanOptions);
|
||||
try {
|
||||
const result = await withContext(updatedOptions.tracingOptions.tracingContext, () => Promise.resolve(callback(updatedOptions, span)));
|
||||
span.setStatus({ status: "success" });
|
||||
return result;
|
||||
}
|
||||
catch (err) {
|
||||
span.setStatus({ status: "error", error: err });
|
||||
throw err;
|
||||
}
|
||||
finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
function withContext(context, callback, ...callbackArgs) {
|
||||
return getInstrumenter().withContext(context, callback, ...callbackArgs);
|
||||
}
|
||||
/**
|
||||
* Parses a traceparent header value into a span identifier.
|
||||
*
|
||||
* @param traceparentHeader - The traceparent header to parse.
|
||||
* @returns An implementation-specific identifier for the span.
|
||||
*/
|
||||
function parseTraceparentHeader(traceparentHeader) {
|
||||
return getInstrumenter().parseTraceparentHeader(traceparentHeader);
|
||||
}
|
||||
/**
|
||||
* Creates a set of request headers to propagate tracing information to a backend.
|
||||
*
|
||||
* @param tracingContext - The context containing the span to serialize.
|
||||
* @returns The set of headers to add to a request.
|
||||
*/
|
||||
function createRequestHeaders(tracingContext) {
|
||||
return getInstrumenter().createRequestHeaders(tracingContext);
|
||||
}
|
||||
return {
|
||||
startSpan,
|
||||
withSpan,
|
||||
withContext,
|
||||
parseTraceparentHeader,
|
||||
createRequestHeaders,
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=tracingClient.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/browser/tracingClient.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/browser/tracingClient.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
34
backend/node_modules/@azure/core-tracing/dist/browser/tracingContext.d.ts
generated
vendored
Normal file
34
backend/node_modules/@azure/core-tracing/dist/browser/tracingContext.d.ts
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
import type { TracingContext, TracingSpan } from "./interfaces.js";
|
||||
/** @internal */
|
||||
export declare const knownContextKeys: {
|
||||
span: symbol;
|
||||
namespace: symbol;
|
||||
};
|
||||
/**
|
||||
* Creates a new {@link TracingContext} with the given options.
|
||||
* @param options - A set of known keys that may be set on the context.
|
||||
* @returns A new {@link TracingContext} with the given options.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export declare function createTracingContext(options?: CreateTracingContextOptions): TracingContext;
|
||||
/** @internal */
|
||||
export declare class TracingContextImpl implements TracingContext {
|
||||
private _contextMap;
|
||||
constructor(initialContext?: TracingContext);
|
||||
setValue(key: symbol, value: unknown): TracingContext;
|
||||
getValue(key: symbol): unknown;
|
||||
deleteValue(key: symbol): TracingContext;
|
||||
}
|
||||
/**
|
||||
* Represents a set of items that can be set when creating a new {@link TracingContext}.
|
||||
*/
|
||||
export interface CreateTracingContextOptions {
|
||||
/** The {@link parentContext} - the newly created context will contain all the values of the parent context unless overridden. */
|
||||
parentContext?: TracingContext;
|
||||
/** An initial span to set on the context. */
|
||||
span?: TracingSpan;
|
||||
/** The namespace to set on any child spans. */
|
||||
namespace?: string;
|
||||
}
|
||||
//# sourceMappingURL=tracingContext.d.ts.map
|
||||
48
backend/node_modules/@azure/core-tracing/dist/browser/tracingContext.js
generated
vendored
Normal file
48
backend/node_modules/@azure/core-tracing/dist/browser/tracingContext.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
/** @internal */
|
||||
export const knownContextKeys = {
|
||||
span: Symbol.for("@azure/core-tracing span"),
|
||||
namespace: Symbol.for("@azure/core-tracing namespace"),
|
||||
};
|
||||
/**
|
||||
* Creates a new {@link TracingContext} with the given options.
|
||||
* @param options - A set of known keys that may be set on the context.
|
||||
* @returns A new {@link TracingContext} with the given options.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export function createTracingContext(options = {}) {
|
||||
let context = new TracingContextImpl(options.parentContext);
|
||||
if (options.span) {
|
||||
context = context.setValue(knownContextKeys.span, options.span);
|
||||
}
|
||||
if (options.namespace) {
|
||||
context = context.setValue(knownContextKeys.namespace, options.namespace);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
/** @internal */
|
||||
export class TracingContextImpl {
|
||||
_contextMap;
|
||||
constructor(initialContext) {
|
||||
this._contextMap =
|
||||
initialContext instanceof TracingContextImpl
|
||||
? new Map(initialContext._contextMap)
|
||||
: new Map();
|
||||
}
|
||||
setValue(key, value) {
|
||||
const newContext = new TracingContextImpl(this);
|
||||
newContext._contextMap.set(key, value);
|
||||
return newContext;
|
||||
}
|
||||
getValue(key) {
|
||||
return this._contextMap.get(key);
|
||||
}
|
||||
deleteValue(key) {
|
||||
const newContext = new TracingContextImpl(this);
|
||||
newContext._contextMap.delete(key);
|
||||
return newContext;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=tracingContext.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/browser/tracingContext.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/browser/tracingContext.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"tracingContext.js","sourceRoot":"","sources":["../../src/tracingContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAuC,EAAE;IAC5E,IAAI,OAAO,GAAmB,IAAI,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5E,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,gBAAgB;AAChB,MAAM,OAAO,kBAAkB;IACrB,WAAW,CAAuB;IAC1C,YAAY,cAA+B;QACzC,IAAI,CAAC,WAAW;YACd,cAAc,YAAY,kBAAkB;gBAC1C,CAAC,CAAC,IAAI,GAAG,CAAkB,cAAc,CAAC,WAAW,CAAC;gBACtD,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAc;QAClC,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,UAAU,CAAC;IACpB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TracingContext, TracingSpan } from \"./interfaces.js\";\n\n/** @internal */\nexport const knownContextKeys = {\n span: Symbol.for(\"@azure/core-tracing span\"),\n namespace: Symbol.for(\"@azure/core-tracing namespace\"),\n};\n\n/**\n * Creates a new {@link TracingContext} with the given options.\n * @param options - A set of known keys that may be set on the context.\n * @returns A new {@link TracingContext} with the given options.\n *\n * @internal\n */\nexport function createTracingContext(options: CreateTracingContextOptions = {}): TracingContext {\n let context: TracingContext = new TracingContextImpl(options.parentContext);\n if (options.span) {\n context = context.setValue(knownContextKeys.span, options.span);\n }\n if (options.namespace) {\n context = context.setValue(knownContextKeys.namespace, options.namespace);\n }\n return context;\n}\n\n/** @internal */\nexport class TracingContextImpl implements TracingContext {\n private _contextMap: Map<symbol, unknown>;\n constructor(initialContext?: TracingContext) {\n this._contextMap =\n initialContext instanceof TracingContextImpl\n ? new Map<symbol, unknown>(initialContext._contextMap)\n : new Map();\n }\n\n setValue(key: symbol, value: unknown): TracingContext {\n const newContext = new TracingContextImpl(this);\n newContext._contextMap.set(key, value);\n return newContext;\n }\n\n getValue(key: symbol): unknown {\n return this._contextMap.get(key);\n }\n\n deleteValue(key: symbol): TracingContext {\n const newContext = new TracingContextImpl(this);\n newContext._contextMap.delete(key);\n return newContext;\n }\n}\n\n/**\n * Represents a set of items that can be set when creating a new {@link TracingContext}.\n */\nexport interface CreateTracingContextOptions {\n /** The {@link parentContext} - the newly created context will contain all the values of the parent context unless overridden. */\n parentContext?: TracingContext;\n /** An initial span to set on the context. */\n span?: TracingSpan;\n /** The namespace to set on any child spans. */\n namespace?: string;\n}\n"]}
|
||||
4
backend/node_modules/@azure/core-tracing/dist/commonjs/index.d.ts
generated
vendored
Normal file
4
backend/node_modules/@azure/core-tracing/dist/commonjs/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export { AddEventOptions, Instrumenter, InstrumenterSpanOptions, OperationTracingOptions, OptionsWithTracingContext, Resolved, SpanStatus, SpanStatusError, SpanStatusSuccess, TracingClient, TracingClientOptions, TracingContext, TracingSpan, TracingSpanKind, TracingSpanLink, TracingSpanOptions, } from "./interfaces.js";
|
||||
export { useInstrumenter } from "./instrumenter.js";
|
||||
export { createTracingClient } from "./tracingClient.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
10
backend/node_modules/@azure/core-tracing/dist/commonjs/index.js
generated
vendored
Normal file
10
backend/node_modules/@azure/core-tracing/dist/commonjs/index.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTracingClient = exports.useInstrumenter = void 0;
|
||||
var instrumenter_js_1 = require("./instrumenter.js");
|
||||
Object.defineProperty(exports, "useInstrumenter", { enumerable: true, get: function () { return instrumenter_js_1.useInstrumenter; } });
|
||||
var tracingClient_js_1 = require("./tracingClient.js");
|
||||
Object.defineProperty(exports, "createTracingClient", { enumerable: true, get: function () { return tracingClient_js_1.createTracingClient; } });
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/commonjs/index.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/commonjs/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAoBlC,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,uDAAyD;AAAhD,uHAAA,mBAAmB,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n AddEventOptions,\n Instrumenter,\n InstrumenterSpanOptions,\n OperationTracingOptions,\n OptionsWithTracingContext,\n Resolved,\n SpanStatus,\n SpanStatusError,\n SpanStatusSuccess,\n TracingClient,\n TracingClientOptions,\n TracingContext,\n TracingSpan,\n TracingSpanKind,\n TracingSpanLink,\n TracingSpanOptions,\n} from \"./interfaces.js\";\nexport { useInstrumenter } from \"./instrumenter.js\";\nexport { createTracingClient } from \"./tracingClient.js\";\n"]}
|
||||
16
backend/node_modules/@azure/core-tracing/dist/commonjs/instrumenter.d.ts
generated
vendored
Normal file
16
backend/node_modules/@azure/core-tracing/dist/commonjs/instrumenter.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import type { Instrumenter, TracingSpan } from "./interfaces.js";
|
||||
export declare function createDefaultTracingSpan(): TracingSpan;
|
||||
export declare function createDefaultInstrumenter(): Instrumenter;
|
||||
/**
|
||||
* Extends the Azure SDK with support for a given instrumenter implementation.
|
||||
*
|
||||
* @param instrumenter - The instrumenter implementation to use.
|
||||
*/
|
||||
export declare function useInstrumenter(instrumenter: Instrumenter): void;
|
||||
/**
|
||||
* Gets the currently set instrumenter, a No-Op instrumenter by default.
|
||||
*
|
||||
* @returns The currently set instrumenter
|
||||
*/
|
||||
export declare function getInstrumenter(): Instrumenter;
|
||||
//# sourceMappingURL=instrumenter.d.ts.map
|
||||
69
backend/node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js
generated
vendored
Normal file
69
backend/node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createDefaultTracingSpan = createDefaultTracingSpan;
|
||||
exports.createDefaultInstrumenter = createDefaultInstrumenter;
|
||||
exports.useInstrumenter = useInstrumenter;
|
||||
exports.getInstrumenter = getInstrumenter;
|
||||
const tracingContext_js_1 = require("./tracingContext.js");
|
||||
const state_js_1 = require("./state.js");
|
||||
function createDefaultTracingSpan() {
|
||||
return {
|
||||
end: () => {
|
||||
// noop
|
||||
},
|
||||
isRecording: () => false,
|
||||
recordException: () => {
|
||||
// noop
|
||||
},
|
||||
setAttribute: () => {
|
||||
// noop
|
||||
},
|
||||
setStatus: () => {
|
||||
// noop
|
||||
},
|
||||
addEvent: () => {
|
||||
// noop
|
||||
},
|
||||
};
|
||||
}
|
||||
function createDefaultInstrumenter() {
|
||||
return {
|
||||
createRequestHeaders: () => {
|
||||
return {};
|
||||
},
|
||||
parseTraceparentHeader: () => {
|
||||
return undefined;
|
||||
},
|
||||
startSpan: (_name, spanOptions) => {
|
||||
return {
|
||||
span: createDefaultTracingSpan(),
|
||||
tracingContext: (0, tracingContext_js_1.createTracingContext)({ parentContext: spanOptions.tracingContext }),
|
||||
};
|
||||
},
|
||||
withContext(_context, callback, ...callbackArgs) {
|
||||
return callback(...callbackArgs);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Extends the Azure SDK with support for a given instrumenter implementation.
|
||||
*
|
||||
* @param instrumenter - The instrumenter implementation to use.
|
||||
*/
|
||||
function useInstrumenter(instrumenter) {
|
||||
state_js_1.state.instrumenterImplementation = instrumenter;
|
||||
}
|
||||
/**
|
||||
* Gets the currently set instrumenter, a No-Op instrumenter by default.
|
||||
*
|
||||
* @returns The currently set instrumenter
|
||||
*/
|
||||
function getInstrumenter() {
|
||||
if (!state_js_1.state.instrumenterImplementation) {
|
||||
state_js_1.state.instrumenterImplementation = createDefaultInstrumenter();
|
||||
}
|
||||
return state_js_1.state.instrumenterImplementation;
|
||||
}
|
||||
//# sourceMappingURL=instrumenter.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"instrumenter.js","sourceRoot":"","sources":["../../src/instrumenter.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAYlC,4DAmBC;AAED,8DA4BC;AAOD,0CAEC;AAOD,0CAKC;AAzED,2DAA2D;AAC3D,yCAAmC;AAEnC,SAAgB,wBAAwB;IACtC,OAAO;QACL,GAAG,EAAE,GAAG,EAAE;YACR,OAAO;QACT,CAAC;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK;QACxB,eAAe,EAAE,GAAG,EAAE;YACpB,OAAO;QACT,CAAC;QACD,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO;QACT,CAAC;QACD,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE;YACb,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,yBAAyB;IACvC,OAAO;QACL,oBAAoB,EAAE,GAA2B,EAAE;YACjD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,sBAAsB,EAAE,GAA+B,EAAE;YACvD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,CACT,KAAa,EACb,WAAoC,EACmB,EAAE;YACzD,OAAO;gBACL,IAAI,EAAE,wBAAwB,EAAE;gBAChC,cAAc,EAAE,IAAA,wCAAoB,EAAC,EAAE,aAAa,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC;aACpF,CAAC;QACJ,CAAC;QACD,WAAW,CAIT,QAAwB,EACxB,QAAkB,EAClB,GAAG,YAA0B;YAE7B,OAAO,QAAQ,CAAC,GAAG,YAAY,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe,CAAC,YAA0B;IACxD,gBAAK,CAAC,0BAA0B,GAAG,YAAY,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,SAAgB,eAAe;IAC7B,IAAI,CAAC,gBAAK,CAAC,0BAA0B,EAAE,CAAC;QACtC,gBAAK,CAAC,0BAA0B,GAAG,yBAAyB,EAAE,CAAC;IACjE,CAAC;IACD,OAAO,gBAAK,CAAC,0BAA0B,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n Instrumenter,\n InstrumenterSpanOptions,\n TracingContext,\n TracingSpan,\n} from \"./interfaces.js\";\n\nimport { createTracingContext } from \"./tracingContext.js\";\nimport { state } from \"./state.js\";\n\nexport function createDefaultTracingSpan(): TracingSpan {\n return {\n end: () => {\n // noop\n },\n isRecording: () => false,\n recordException: () => {\n // noop\n },\n setAttribute: () => {\n // noop\n },\n setStatus: () => {\n // noop\n },\n addEvent: () => {\n // noop\n },\n };\n}\n\nexport function createDefaultInstrumenter(): Instrumenter {\n return {\n createRequestHeaders: (): Record<string, string> => {\n return {};\n },\n parseTraceparentHeader: (): TracingContext | undefined => {\n return undefined;\n },\n startSpan: (\n _name: string,\n spanOptions: InstrumenterSpanOptions,\n ): { span: TracingSpan; tracingContext: TracingContext } => {\n return {\n span: createDefaultTracingSpan(),\n tracingContext: createTracingContext({ parentContext: spanOptions.tracingContext }),\n };\n },\n withContext<\n CallbackArgs extends unknown[],\n Callback extends (...args: CallbackArgs) => ReturnType<Callback>,\n >(\n _context: TracingContext,\n callback: Callback,\n ...callbackArgs: CallbackArgs\n ): ReturnType<Callback> {\n return callback(...callbackArgs);\n },\n };\n}\n\n/**\n * Extends the Azure SDK with support for a given instrumenter implementation.\n *\n * @param instrumenter - The instrumenter implementation to use.\n */\nexport function useInstrumenter(instrumenter: Instrumenter): void {\n state.instrumenterImplementation = instrumenter;\n}\n\n/**\n * Gets the currently set instrumenter, a No-Op instrumenter by default.\n *\n * @returns The currently set instrumenter\n */\nexport function getInstrumenter(): Instrumenter {\n if (!state.instrumenterImplementation) {\n state.instrumenterImplementation = createDefaultInstrumenter();\n }\n return state.instrumenterImplementation;\n}\n"]}
|
||||
288
backend/node_modules/@azure/core-tracing/dist/commonjs/interfaces.d.ts
generated
vendored
Normal file
288
backend/node_modules/@azure/core-tracing/dist/commonjs/interfaces.d.ts
generated
vendored
Normal file
@ -0,0 +1,288 @@
|
||||
/**
|
||||
* A narrower version of TypeScript 4.5's Awaited type which Recursively
|
||||
* unwraps the "awaited type", emulating the behavior of `await`.
|
||||
*/
|
||||
export type Resolved<T> = T extends {
|
||||
then(onfulfilled: infer F): any;
|
||||
} ? F extends (value: infer V) => any ? Resolved<V> : never : T;
|
||||
/**
|
||||
* Represents a client that can integrate with the currently configured {@link Instrumenter}.
|
||||
*
|
||||
* Create an instance using {@link createTracingClient}.
|
||||
*/
|
||||
export interface TracingClient {
|
||||
/**
|
||||
* Wraps a callback in a tracing span, calls the callback, and closes the span.
|
||||
*
|
||||
* This is the primary interface for using Tracing and will handle error recording as well as setting the status on the span.
|
||||
*
|
||||
* Both synchronous and asynchronous functions will be awaited in order to reflect the result of the callback on the span.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```ts snippet:ReadmeSampleWithSpanExample
|
||||
* import { createTracingClient } from "@azure/core-tracing";
|
||||
*
|
||||
* const tracingClient = createTracingClient({
|
||||
* namespace: "test.namespace",
|
||||
* packageName: "test-package",
|
||||
* packageVersion: "1.0.0",
|
||||
* });
|
||||
*
|
||||
* const options = {};
|
||||
*
|
||||
* const myOperationResult = await tracingClient.withSpan(
|
||||
* "myClassName.myOperationName",
|
||||
* options,
|
||||
* (updatedOptions) => {
|
||||
* // Do something with the updated options.
|
||||
* return "myOperationResult";
|
||||
* },
|
||||
* );
|
||||
* ```
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param operationOptions - The original options passed to the method. The callback will receive these options with the newly created {@link TracingContext}.
|
||||
* @param callback - The callback to be invoked with the updated options and newly created {@link TracingSpan}.
|
||||
*/
|
||||
withSpan<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}, Callback extends (updatedOptions: Options, span: Omit<TracingSpan, "end">) => ReturnType<Callback>>(name: string, operationOptions: Options, callback: Callback, spanOptions?: TracingSpanOptions): Promise<Resolved<ReturnType<Callback>>>;
|
||||
/**
|
||||
* Starts a given span but does not set it as the active span.
|
||||
*
|
||||
* You must end the span using {@link TracingSpan.end}.
|
||||
*
|
||||
* Most of the time you will want to use {@link withSpan} instead.
|
||||
*
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param operationOptions - The original operation options.
|
||||
* @param spanOptions - The options to use when creating the span.
|
||||
*
|
||||
* @returns A {@link TracingSpan} and the updated operation options.
|
||||
*/
|
||||
startSpan<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}>(name: string, operationOptions?: Options, spanOptions?: TracingSpanOptions): {
|
||||
span: TracingSpan;
|
||||
updatedOptions: OptionsWithTracingContext<Options>;
|
||||
};
|
||||
/**
|
||||
* Wraps a callback with an active context and calls the callback.
|
||||
* Depending on the implementation, this may set the globally available active context.
|
||||
*
|
||||
* Useful when you want to leave the boundaries of the SDK (make a request or callback to user code) and are unable to use the {@link withSpan} API.
|
||||
*
|
||||
* @param context - The {@link TracingContext} to use as the active context in the scope of the callback.
|
||||
* @param callback - The callback to be invoked with the given context set as the globally active context.
|
||||
* @param callbackArgs - The callback arguments.
|
||||
*/
|
||||
withContext<CallbackArgs extends unknown[], Callback extends (...args: CallbackArgs) => ReturnType<Callback>>(context: TracingContext, callback: Callback, ...callbackArgs: CallbackArgs): ReturnType<Callback>;
|
||||
/**
|
||||
* Parses a traceparent header value into a {@link TracingSpanContext}.
|
||||
*
|
||||
* @param traceparentHeader - The traceparent header to parse.
|
||||
* @returns An implementation-specific identifier for the span.
|
||||
*/
|
||||
parseTraceparentHeader(traceparentHeader: string): TracingContext | undefined;
|
||||
/**
|
||||
* Creates a set of request headers to propagate tracing information to a backend.
|
||||
*
|
||||
* @param tracingContext - The context containing the span to propagate.
|
||||
* @returns The set of headers to add to a request.
|
||||
*/
|
||||
createRequestHeaders(tracingContext?: TracingContext): Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Options that can be passed to {@link createTracingClient}
|
||||
*/
|
||||
export interface TracingClientOptions {
|
||||
/** The value of the az.namespace tracing attribute on newly created spans. */
|
||||
namespace: string;
|
||||
/** The name of the package invoking this trace. */
|
||||
packageName: string;
|
||||
/** An optional version of the package invoking this trace. */
|
||||
packageVersion?: string;
|
||||
}
|
||||
/** The kind of span. */
|
||||
export type TracingSpanKind = "client" | "server" | "producer" | "consumer" | "internal";
|
||||
/** Options used to configure the newly created span. */
|
||||
export interface TracingSpanOptions {
|
||||
/** The kind of span. Implementations should default this to "client". */
|
||||
spanKind?: TracingSpanKind;
|
||||
/** A collection of {@link TracingSpanLink} to link to this span. */
|
||||
spanLinks?: TracingSpanLink[];
|
||||
/** Initial set of attributes to set on a span. */
|
||||
spanAttributes?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
/** A pointer from the current {@link TracingSpan} to another span in the same or a different trace. */
|
||||
export interface TracingSpanLink {
|
||||
/** The {@link TracingContext} containing the span context to link to. */
|
||||
tracingContext: TracingContext;
|
||||
/** A set of attributes on the link. */
|
||||
attributes?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents an implementation agnostic instrumenter.
|
||||
*/
|
||||
export interface Instrumenter {
|
||||
/**
|
||||
* Creates a new {@link TracingSpan} with the given name and options and sets it on a new context.
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param spanOptions - The options to use when creating the span.
|
||||
*
|
||||
* @returns A {@link TracingSpan} that can be used to end the span, and the context this span has been set on.
|
||||
*/
|
||||
startSpan(name: string, spanOptions: InstrumenterSpanOptions): {
|
||||
span: TracingSpan;
|
||||
tracingContext: TracingContext;
|
||||
};
|
||||
/**
|
||||
* Wraps a callback with an active context and calls the callback.
|
||||
* Depending on the implementation, this may set the globally available active context.
|
||||
*
|
||||
* @param context - The {@link TracingContext} to use as the active context in the scope of the callback.
|
||||
* @param callback - The callback to be invoked with the given context set as the globally active context.
|
||||
* @param callbackArgs - The callback arguments.
|
||||
*/
|
||||
withContext<CallbackArgs extends unknown[], Callback extends (...args: CallbackArgs) => ReturnType<Callback>>(context: TracingContext, callback: Callback, ...callbackArgs: CallbackArgs): ReturnType<Callback>;
|
||||
/**
|
||||
* Provides an implementation-specific method to parse a {@link https://www.w3.org/TR/trace-context/#traceparent-header}
|
||||
* into a {@link TracingSpanContext} which can be used to link non-parented spans together.
|
||||
*/
|
||||
parseTraceparentHeader(traceparentHeader: string): TracingContext | undefined;
|
||||
/**
|
||||
* Provides an implementation-specific method to serialize a {@link TracingSpan} to a set of headers.
|
||||
* @param tracingContext - The context containing the span to serialize.
|
||||
*/
|
||||
createRequestHeaders(tracingContext?: TracingContext): Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Options passed to {@link Instrumenter.startSpan} as a superset of {@link TracingSpanOptions}.
|
||||
*/
|
||||
export interface InstrumenterSpanOptions extends TracingSpanOptions {
|
||||
/** The name of the package invoking this trace. */
|
||||
packageName: string;
|
||||
/** The version of the package invoking this trace. */
|
||||
packageVersion?: string;
|
||||
/** The current tracing context. Defaults to an implementation-specific "active" context. */
|
||||
tracingContext?: TracingContext;
|
||||
}
|
||||
/**
|
||||
* Status representing a successful operation that can be sent to {@link TracingSpan.setStatus}
|
||||
*/
|
||||
export type SpanStatusSuccess = {
|
||||
status: "success";
|
||||
};
|
||||
/**
|
||||
* Status representing an error that can be sent to {@link TracingSpan.setStatus}
|
||||
*/
|
||||
export type SpanStatusError = {
|
||||
status: "error";
|
||||
error?: Error | string;
|
||||
};
|
||||
/**
|
||||
* Represents the statuses that can be passed to {@link TracingSpan.setStatus}.
|
||||
*
|
||||
* By default, all spans will be created with status "unset".
|
||||
*/
|
||||
export type SpanStatus = SpanStatusSuccess | SpanStatusError;
|
||||
/**
|
||||
* Represents options you can pass to {@link TracingSpan.addEvent}.
|
||||
*/
|
||||
export interface AddEventOptions {
|
||||
/**
|
||||
* A set of attributes to attach to the event.
|
||||
*/
|
||||
attributes?: Record<string, unknown>;
|
||||
/**
|
||||
* The start time of the event.
|
||||
*/
|
||||
startTime?: Date;
|
||||
}
|
||||
/**
|
||||
* Represents an implementation agnostic tracing span.
|
||||
*/
|
||||
export interface TracingSpan {
|
||||
/**
|
||||
* Sets the status of the span. When an error is provided, it will be recorded on the span as well.
|
||||
*
|
||||
* @param status - The {@link SpanStatus} to set on the span.
|
||||
*/
|
||||
setStatus(status: SpanStatus): void;
|
||||
/**
|
||||
* Sets a given attribute on a span.
|
||||
*
|
||||
* @param name - The attribute's name.
|
||||
* @param value - The attribute's value to set. May be any non-nullish value.
|
||||
*/
|
||||
setAttribute(name: string, value: unknown): void;
|
||||
/**
|
||||
* Ends the span.
|
||||
*/
|
||||
end(): void;
|
||||
/**
|
||||
* Records an exception on a {@link TracingSpan} without modifying its status.
|
||||
*
|
||||
* When recording an unhandled exception that should fail the span, please use {@link TracingSpan.setStatus} instead.
|
||||
*
|
||||
* @param exception - The exception to record on the span.
|
||||
*
|
||||
*/
|
||||
recordException(exception: Error | string): void;
|
||||
/**
|
||||
* Returns true if this {@link TracingSpan} is recording information.
|
||||
*
|
||||
* Depending on the span implementation, this may return false if the span is not being sampled.
|
||||
*/
|
||||
isRecording(): boolean;
|
||||
/**
|
||||
* Adds an event to the span.
|
||||
*/
|
||||
addEvent?(name: string, options?: AddEventOptions): void;
|
||||
}
|
||||
/** An immutable context bag of tracing values for the current operation. */
|
||||
export interface TracingContext {
|
||||
/**
|
||||
* Sets a given object on a context.
|
||||
* @param key - The key of the given context value.
|
||||
* @param value - The value to set on the context.
|
||||
*
|
||||
* @returns - A new context with the given value set.
|
||||
*/
|
||||
setValue(key: symbol, value: unknown): TracingContext;
|
||||
/**
|
||||
* Gets an object from the context if it exists.
|
||||
* @param key - The key of the given context value.
|
||||
*
|
||||
* @returns - The value of the given context value if it exists, otherwise `undefined`.
|
||||
*/
|
||||
getValue(key: symbol): unknown;
|
||||
/**
|
||||
* Deletes an object from the context if it exists.
|
||||
* @param key - The key of the given context value to delete.
|
||||
*/
|
||||
deleteValue(key: symbol): TracingContext;
|
||||
}
|
||||
/**
|
||||
* Tracing options to set on an operation.
|
||||
*/
|
||||
export interface OperationTracingOptions {
|
||||
/** The context to use for created Tracing Spans. */
|
||||
tracingContext?: TracingContext;
|
||||
}
|
||||
/**
|
||||
* A utility type for when we know a TracingContext has been set
|
||||
* as part of an operation's options.
|
||||
*/
|
||||
export type OptionsWithTracingContext<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}> = Options & {
|
||||
tracingOptions: {
|
||||
tracingContext: TracingContext;
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=interfaces.d.ts.map
|
||||
5
backend/node_modules/@azure/core-tracing/dist/commonjs/interfaces.js
generated
vendored
Normal file
5
backend/node_modules/@azure/core-tracing/dist/commonjs/interfaces.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=interfaces.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/commonjs/interfaces.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/commonjs/interfaces.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
backend/node_modules/@azure/core-tracing/dist/commonjs/package.json
generated
vendored
Normal file
3
backend/node_modules/@azure/core-tracing/dist/commonjs/package.json
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
1
backend/node_modules/@azure/core-tracing/dist/commonjs/state-cjs.cjs.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/commonjs/state-cjs.cjs.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"state-cjs.cjs","sourceRoot":"","sources":["../../src/state-cjs.cts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;GAIG;AACU,QAAA,KAAK,GAAG;IACnB,0BAA0B,EAAE,SAAS;CACtC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * @internal\n *\n * Holds the singleton instrumenter, to be shared across CJS and ESM imports.\n */\nexport const state = {\n instrumenterImplementation: undefined,\n};\n"]}
|
||||
9
backend/node_modules/@azure/core-tracing/dist/commonjs/state.d.ts
generated
vendored
Normal file
9
backend/node_modules/@azure/core-tracing/dist/commonjs/state.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Holds the singleton instrumenter, to be shared across CJS and ESM imports.
|
||||
*/
|
||||
export declare const state: {
|
||||
instrumenterImplementation: undefined;
|
||||
};
|
||||
//# sourceMappingURL=state-cjs.d.cts.map
|
||||
14
backend/node_modules/@azure/core-tracing/dist/commonjs/state.js
generated
vendored
Normal file
14
backend/node_modules/@azure/core-tracing/dist/commonjs/state.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.state = void 0;
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* Holds the singleton instrumenter, to be shared across CJS and ESM imports.
|
||||
*/
|
||||
exports.state = {
|
||||
instrumenterImplementation: undefined,
|
||||
};
|
||||
//# sourceMappingURL=state-cjs.cjs.map
|
||||
9
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingClient.d.ts
generated
vendored
Normal file
9
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingClient.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import type { TracingClient, TracingClientOptions } from "./interfaces.js";
|
||||
/**
|
||||
* Creates a new tracing client.
|
||||
*
|
||||
* @param options - Options used to configure the tracing client.
|
||||
* @returns - An instance of {@link TracingClient}.
|
||||
*/
|
||||
export declare function createTracingClient(options: TracingClientOptions): TracingClient;
|
||||
//# sourceMappingURL=tracingClient.d.ts.map
|
||||
81
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js
generated
vendored
Normal file
81
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js
generated
vendored
Normal file
@ -0,0 +1,81 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createTracingClient = createTracingClient;
|
||||
const instrumenter_js_1 = require("./instrumenter.js");
|
||||
const tracingContext_js_1 = require("./tracingContext.js");
|
||||
/**
|
||||
* Creates a new tracing client.
|
||||
*
|
||||
* @param options - Options used to configure the tracing client.
|
||||
* @returns - An instance of {@link TracingClient}.
|
||||
*/
|
||||
function createTracingClient(options) {
|
||||
const { namespace, packageName, packageVersion } = options;
|
||||
function startSpan(name, operationOptions, spanOptions) {
|
||||
const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, {
|
||||
...spanOptions,
|
||||
packageName: packageName,
|
||||
packageVersion: packageVersion,
|
||||
tracingContext: operationOptions?.tracingOptions?.tracingContext,
|
||||
});
|
||||
let tracingContext = startSpanResult.tracingContext;
|
||||
const span = startSpanResult.span;
|
||||
if (!tracingContext.getValue(tracingContext_js_1.knownContextKeys.namespace)) {
|
||||
tracingContext = tracingContext.setValue(tracingContext_js_1.knownContextKeys.namespace, namespace);
|
||||
}
|
||||
span.setAttribute("az.namespace", tracingContext.getValue(tracingContext_js_1.knownContextKeys.namespace));
|
||||
const updatedOptions = Object.assign({}, operationOptions, {
|
||||
tracingOptions: { ...operationOptions?.tracingOptions, tracingContext },
|
||||
});
|
||||
return {
|
||||
span,
|
||||
updatedOptions,
|
||||
};
|
||||
}
|
||||
async function withSpan(name, operationOptions, callback, spanOptions) {
|
||||
const { span, updatedOptions } = startSpan(name, operationOptions, spanOptions);
|
||||
try {
|
||||
const result = await withContext(updatedOptions.tracingOptions.tracingContext, () => Promise.resolve(callback(updatedOptions, span)));
|
||||
span.setStatus({ status: "success" });
|
||||
return result;
|
||||
}
|
||||
catch (err) {
|
||||
span.setStatus({ status: "error", error: err });
|
||||
throw err;
|
||||
}
|
||||
finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
function withContext(context, callback, ...callbackArgs) {
|
||||
return (0, instrumenter_js_1.getInstrumenter)().withContext(context, callback, ...callbackArgs);
|
||||
}
|
||||
/**
|
||||
* Parses a traceparent header value into a span identifier.
|
||||
*
|
||||
* @param traceparentHeader - The traceparent header to parse.
|
||||
* @returns An implementation-specific identifier for the span.
|
||||
*/
|
||||
function parseTraceparentHeader(traceparentHeader) {
|
||||
return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader);
|
||||
}
|
||||
/**
|
||||
* Creates a set of request headers to propagate tracing information to a backend.
|
||||
*
|
||||
* @param tracingContext - The context containing the span to serialize.
|
||||
* @returns The set of headers to add to a request.
|
||||
*/
|
||||
function createRequestHeaders(tracingContext) {
|
||||
return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext);
|
||||
}
|
||||
return {
|
||||
startSpan,
|
||||
withSpan,
|
||||
withContext,
|
||||
parseTraceparentHeader,
|
||||
createRequestHeaders,
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=tracingClient.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
34
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingContext.d.ts
generated
vendored
Normal file
34
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingContext.d.ts
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
import type { TracingContext, TracingSpan } from "./interfaces.js";
|
||||
/** @internal */
|
||||
export declare const knownContextKeys: {
|
||||
span: symbol;
|
||||
namespace: symbol;
|
||||
};
|
||||
/**
|
||||
* Creates a new {@link TracingContext} with the given options.
|
||||
* @param options - A set of known keys that may be set on the context.
|
||||
* @returns A new {@link TracingContext} with the given options.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export declare function createTracingContext(options?: CreateTracingContextOptions): TracingContext;
|
||||
/** @internal */
|
||||
export declare class TracingContextImpl implements TracingContext {
|
||||
private _contextMap;
|
||||
constructor(initialContext?: TracingContext);
|
||||
setValue(key: symbol, value: unknown): TracingContext;
|
||||
getValue(key: symbol): unknown;
|
||||
deleteValue(key: symbol): TracingContext;
|
||||
}
|
||||
/**
|
||||
* Represents a set of items that can be set when creating a new {@link TracingContext}.
|
||||
*/
|
||||
export interface CreateTracingContextOptions {
|
||||
/** The {@link parentContext} - the newly created context will contain all the values of the parent context unless overridden. */
|
||||
parentContext?: TracingContext;
|
||||
/** An initial span to set on the context. */
|
||||
span?: TracingSpan;
|
||||
/** The namespace to set on any child spans. */
|
||||
namespace?: string;
|
||||
}
|
||||
//# sourceMappingURL=tracingContext.d.ts.map
|
||||
53
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js
generated
vendored
Normal file
53
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
"use strict";
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TracingContextImpl = exports.knownContextKeys = void 0;
|
||||
exports.createTracingContext = createTracingContext;
|
||||
/** @internal */
|
||||
exports.knownContextKeys = {
|
||||
span: Symbol.for("@azure/core-tracing span"),
|
||||
namespace: Symbol.for("@azure/core-tracing namespace"),
|
||||
};
|
||||
/**
|
||||
* Creates a new {@link TracingContext} with the given options.
|
||||
* @param options - A set of known keys that may be set on the context.
|
||||
* @returns A new {@link TracingContext} with the given options.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
function createTracingContext(options = {}) {
|
||||
let context = new TracingContextImpl(options.parentContext);
|
||||
if (options.span) {
|
||||
context = context.setValue(exports.knownContextKeys.span, options.span);
|
||||
}
|
||||
if (options.namespace) {
|
||||
context = context.setValue(exports.knownContextKeys.namespace, options.namespace);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
/** @internal */
|
||||
class TracingContextImpl {
|
||||
_contextMap;
|
||||
constructor(initialContext) {
|
||||
this._contextMap =
|
||||
initialContext instanceof TracingContextImpl
|
||||
? new Map(initialContext._contextMap)
|
||||
: new Map();
|
||||
}
|
||||
setValue(key, value) {
|
||||
const newContext = new TracingContextImpl(this);
|
||||
newContext._contextMap.set(key, value);
|
||||
return newContext;
|
||||
}
|
||||
getValue(key) {
|
||||
return this._contextMap.get(key);
|
||||
}
|
||||
deleteValue(key) {
|
||||
const newContext = new TracingContextImpl(this);
|
||||
newContext._contextMap.delete(key);
|
||||
return newContext;
|
||||
}
|
||||
}
|
||||
exports.TracingContextImpl = TracingContextImpl;
|
||||
//# sourceMappingURL=tracingContext.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"tracingContext.js","sourceRoot":"","sources":["../../src/tracingContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAiBlC,oDASC;AAtBD,gBAAgB;AACH,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,UAAuC,EAAE;IAC5E,IAAI,OAAO,GAAmB,IAAI,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5E,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,wBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,wBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,gBAAgB;AAChB,MAAa,kBAAkB;IACrB,WAAW,CAAuB;IAC1C,YAAY,cAA+B;QACzC,IAAI,CAAC,WAAW;YACd,cAAc,YAAY,kBAAkB;gBAC1C,CAAC,CAAC,IAAI,GAAG,CAAkB,cAAc,CAAC,WAAW,CAAC;gBACtD,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAc;QAClC,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAxBD,gDAwBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TracingContext, TracingSpan } from \"./interfaces.js\";\n\n/** @internal */\nexport const knownContextKeys = {\n span: Symbol.for(\"@azure/core-tracing span\"),\n namespace: Symbol.for(\"@azure/core-tracing namespace\"),\n};\n\n/**\n * Creates a new {@link TracingContext} with the given options.\n * @param options - A set of known keys that may be set on the context.\n * @returns A new {@link TracingContext} with the given options.\n *\n * @internal\n */\nexport function createTracingContext(options: CreateTracingContextOptions = {}): TracingContext {\n let context: TracingContext = new TracingContextImpl(options.parentContext);\n if (options.span) {\n context = context.setValue(knownContextKeys.span, options.span);\n }\n if (options.namespace) {\n context = context.setValue(knownContextKeys.namespace, options.namespace);\n }\n return context;\n}\n\n/** @internal */\nexport class TracingContextImpl implements TracingContext {\n private _contextMap: Map<symbol, unknown>;\n constructor(initialContext?: TracingContext) {\n this._contextMap =\n initialContext instanceof TracingContextImpl\n ? new Map<symbol, unknown>(initialContext._contextMap)\n : new Map();\n }\n\n setValue(key: symbol, value: unknown): TracingContext {\n const newContext = new TracingContextImpl(this);\n newContext._contextMap.set(key, value);\n return newContext;\n }\n\n getValue(key: symbol): unknown {\n return this._contextMap.get(key);\n }\n\n deleteValue(key: symbol): TracingContext {\n const newContext = new TracingContextImpl(this);\n newContext._contextMap.delete(key);\n return newContext;\n }\n}\n\n/**\n * Represents a set of items that can be set when creating a new {@link TracingContext}.\n */\nexport interface CreateTracingContextOptions {\n /** The {@link parentContext} - the newly created context will contain all the values of the parent context unless overridden. */\n parentContext?: TracingContext;\n /** An initial span to set on the context. */\n span?: TracingSpan;\n /** The namespace to set on any child spans. */\n namespace?: string;\n}\n"]}
|
||||
11
backend/node_modules/@azure/core-tracing/dist/commonjs/tsdoc-metadata.json
generated
vendored
Normal file
11
backend/node_modules/@azure/core-tracing/dist/commonjs/tsdoc-metadata.json
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
||||
// It should be published with your NPM package. It should not be tracked by Git.
|
||||
{
|
||||
"tsdocVersion": "0.12",
|
||||
"toolPackages": [
|
||||
{
|
||||
"packageName": "@microsoft/api-extractor",
|
||||
"packageVersion": "7.52.11"
|
||||
}
|
||||
]
|
||||
}
|
||||
4
backend/node_modules/@azure/core-tracing/dist/esm/index.d.ts
generated
vendored
Normal file
4
backend/node_modules/@azure/core-tracing/dist/esm/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export { AddEventOptions, Instrumenter, InstrumenterSpanOptions, OperationTracingOptions, OptionsWithTracingContext, Resolved, SpanStatus, SpanStatusError, SpanStatusSuccess, TracingClient, TracingClientOptions, TracingContext, TracingSpan, TracingSpanKind, TracingSpanLink, TracingSpanOptions, } from "./interfaces.js";
|
||||
export { useInstrumenter } from "./instrumenter.js";
|
||||
export { createTracingClient } from "./tracingClient.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
5
backend/node_modules/@azure/core-tracing/dist/esm/index.js
generated
vendored
Normal file
5
backend/node_modules/@azure/core-tracing/dist/esm/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
export { useInstrumenter } from "./instrumenter.js";
|
||||
export { createTracingClient } from "./tracingClient.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/esm/index.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/esm/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAoBlC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n AddEventOptions,\n Instrumenter,\n InstrumenterSpanOptions,\n OperationTracingOptions,\n OptionsWithTracingContext,\n Resolved,\n SpanStatus,\n SpanStatusError,\n SpanStatusSuccess,\n TracingClient,\n TracingClientOptions,\n TracingContext,\n TracingSpan,\n TracingSpanKind,\n TracingSpanLink,\n TracingSpanOptions,\n} from \"./interfaces.js\";\nexport { useInstrumenter } from \"./instrumenter.js\";\nexport { createTracingClient } from \"./tracingClient.js\";\n"]}
|
||||
16
backend/node_modules/@azure/core-tracing/dist/esm/instrumenter.d.ts
generated
vendored
Normal file
16
backend/node_modules/@azure/core-tracing/dist/esm/instrumenter.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import type { Instrumenter, TracingSpan } from "./interfaces.js";
|
||||
export declare function createDefaultTracingSpan(): TracingSpan;
|
||||
export declare function createDefaultInstrumenter(): Instrumenter;
|
||||
/**
|
||||
* Extends the Azure SDK with support for a given instrumenter implementation.
|
||||
*
|
||||
* @param instrumenter - The instrumenter implementation to use.
|
||||
*/
|
||||
export declare function useInstrumenter(instrumenter: Instrumenter): void;
|
||||
/**
|
||||
* Gets the currently set instrumenter, a No-Op instrumenter by default.
|
||||
*
|
||||
* @returns The currently set instrumenter
|
||||
*/
|
||||
export declare function getInstrumenter(): Instrumenter;
|
||||
//# sourceMappingURL=instrumenter.d.ts.map
|
||||
63
backend/node_modules/@azure/core-tracing/dist/esm/instrumenter.js
generated
vendored
Normal file
63
backend/node_modules/@azure/core-tracing/dist/esm/instrumenter.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { createTracingContext } from "./tracingContext.js";
|
||||
import { state } from "./state.js";
|
||||
export function createDefaultTracingSpan() {
|
||||
return {
|
||||
end: () => {
|
||||
// noop
|
||||
},
|
||||
isRecording: () => false,
|
||||
recordException: () => {
|
||||
// noop
|
||||
},
|
||||
setAttribute: () => {
|
||||
// noop
|
||||
},
|
||||
setStatus: () => {
|
||||
// noop
|
||||
},
|
||||
addEvent: () => {
|
||||
// noop
|
||||
},
|
||||
};
|
||||
}
|
||||
export function createDefaultInstrumenter() {
|
||||
return {
|
||||
createRequestHeaders: () => {
|
||||
return {};
|
||||
},
|
||||
parseTraceparentHeader: () => {
|
||||
return undefined;
|
||||
},
|
||||
startSpan: (_name, spanOptions) => {
|
||||
return {
|
||||
span: createDefaultTracingSpan(),
|
||||
tracingContext: createTracingContext({ parentContext: spanOptions.tracingContext }),
|
||||
};
|
||||
},
|
||||
withContext(_context, callback, ...callbackArgs) {
|
||||
return callback(...callbackArgs);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Extends the Azure SDK with support for a given instrumenter implementation.
|
||||
*
|
||||
* @param instrumenter - The instrumenter implementation to use.
|
||||
*/
|
||||
export function useInstrumenter(instrumenter) {
|
||||
state.instrumenterImplementation = instrumenter;
|
||||
}
|
||||
/**
|
||||
* Gets the currently set instrumenter, a No-Op instrumenter by default.
|
||||
*
|
||||
* @returns The currently set instrumenter
|
||||
*/
|
||||
export function getInstrumenter() {
|
||||
if (!state.instrumenterImplementation) {
|
||||
state.instrumenterImplementation = createDefaultInstrumenter();
|
||||
}
|
||||
return state.instrumenterImplementation;
|
||||
}
|
||||
//# sourceMappingURL=instrumenter.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/esm/instrumenter.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/esm/instrumenter.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"instrumenter.js","sourceRoot":"","sources":["../../src/instrumenter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,GAAG,EAAE,GAAG,EAAE;YACR,OAAO;QACT,CAAC;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK;QACxB,eAAe,EAAE,GAAG,EAAE;YACpB,OAAO;QACT,CAAC;QACD,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO;QACT,CAAC;QACD,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE;YACb,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,oBAAoB,EAAE,GAA2B,EAAE;YACjD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,sBAAsB,EAAE,GAA+B,EAAE;YACvD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,CACT,KAAa,EACb,WAAoC,EACmB,EAAE;YACzD,OAAO;gBACL,IAAI,EAAE,wBAAwB,EAAE;gBAChC,cAAc,EAAE,oBAAoB,CAAC,EAAE,aAAa,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC;aACpF,CAAC;QACJ,CAAC;QACD,WAAW,CAIT,QAAwB,EACxB,QAAkB,EAClB,GAAG,YAA0B;YAE7B,OAAO,QAAQ,CAAC,GAAG,YAAY,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,YAA0B;IACxD,KAAK,CAAC,0BAA0B,GAAG,YAAY,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE,CAAC;QACtC,KAAK,CAAC,0BAA0B,GAAG,yBAAyB,EAAE,CAAC;IACjE,CAAC;IACD,OAAO,KAAK,CAAC,0BAA0B,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n Instrumenter,\n InstrumenterSpanOptions,\n TracingContext,\n TracingSpan,\n} from \"./interfaces.js\";\n\nimport { createTracingContext } from \"./tracingContext.js\";\nimport { state } from \"./state.js\";\n\nexport function createDefaultTracingSpan(): TracingSpan {\n return {\n end: () => {\n // noop\n },\n isRecording: () => false,\n recordException: () => {\n // noop\n },\n setAttribute: () => {\n // noop\n },\n setStatus: () => {\n // noop\n },\n addEvent: () => {\n // noop\n },\n };\n}\n\nexport function createDefaultInstrumenter(): Instrumenter {\n return {\n createRequestHeaders: (): Record<string, string> => {\n return {};\n },\n parseTraceparentHeader: (): TracingContext | undefined => {\n return undefined;\n },\n startSpan: (\n _name: string,\n spanOptions: InstrumenterSpanOptions,\n ): { span: TracingSpan; tracingContext: TracingContext } => {\n return {\n span: createDefaultTracingSpan(),\n tracingContext: createTracingContext({ parentContext: spanOptions.tracingContext }),\n };\n },\n withContext<\n CallbackArgs extends unknown[],\n Callback extends (...args: CallbackArgs) => ReturnType<Callback>,\n >(\n _context: TracingContext,\n callback: Callback,\n ...callbackArgs: CallbackArgs\n ): ReturnType<Callback> {\n return callback(...callbackArgs);\n },\n };\n}\n\n/**\n * Extends the Azure SDK with support for a given instrumenter implementation.\n *\n * @param instrumenter - The instrumenter implementation to use.\n */\nexport function useInstrumenter(instrumenter: Instrumenter): void {\n state.instrumenterImplementation = instrumenter;\n}\n\n/**\n * Gets the currently set instrumenter, a No-Op instrumenter by default.\n *\n * @returns The currently set instrumenter\n */\nexport function getInstrumenter(): Instrumenter {\n if (!state.instrumenterImplementation) {\n state.instrumenterImplementation = createDefaultInstrumenter();\n }\n return state.instrumenterImplementation;\n}\n"]}
|
||||
288
backend/node_modules/@azure/core-tracing/dist/esm/interfaces.d.ts
generated
vendored
Normal file
288
backend/node_modules/@azure/core-tracing/dist/esm/interfaces.d.ts
generated
vendored
Normal file
@ -0,0 +1,288 @@
|
||||
/**
|
||||
* A narrower version of TypeScript 4.5's Awaited type which Recursively
|
||||
* unwraps the "awaited type", emulating the behavior of `await`.
|
||||
*/
|
||||
export type Resolved<T> = T extends {
|
||||
then(onfulfilled: infer F): any;
|
||||
} ? F extends (value: infer V) => any ? Resolved<V> : never : T;
|
||||
/**
|
||||
* Represents a client that can integrate with the currently configured {@link Instrumenter}.
|
||||
*
|
||||
* Create an instance using {@link createTracingClient}.
|
||||
*/
|
||||
export interface TracingClient {
|
||||
/**
|
||||
* Wraps a callback in a tracing span, calls the callback, and closes the span.
|
||||
*
|
||||
* This is the primary interface for using Tracing and will handle error recording as well as setting the status on the span.
|
||||
*
|
||||
* Both synchronous and asynchronous functions will be awaited in order to reflect the result of the callback on the span.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```ts snippet:ReadmeSampleWithSpanExample
|
||||
* import { createTracingClient } from "@azure/core-tracing";
|
||||
*
|
||||
* const tracingClient = createTracingClient({
|
||||
* namespace: "test.namespace",
|
||||
* packageName: "test-package",
|
||||
* packageVersion: "1.0.0",
|
||||
* });
|
||||
*
|
||||
* const options = {};
|
||||
*
|
||||
* const myOperationResult = await tracingClient.withSpan(
|
||||
* "myClassName.myOperationName",
|
||||
* options,
|
||||
* (updatedOptions) => {
|
||||
* // Do something with the updated options.
|
||||
* return "myOperationResult";
|
||||
* },
|
||||
* );
|
||||
* ```
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param operationOptions - The original options passed to the method. The callback will receive these options with the newly created {@link TracingContext}.
|
||||
* @param callback - The callback to be invoked with the updated options and newly created {@link TracingSpan}.
|
||||
*/
|
||||
withSpan<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}, Callback extends (updatedOptions: Options, span: Omit<TracingSpan, "end">) => ReturnType<Callback>>(name: string, operationOptions: Options, callback: Callback, spanOptions?: TracingSpanOptions): Promise<Resolved<ReturnType<Callback>>>;
|
||||
/**
|
||||
* Starts a given span but does not set it as the active span.
|
||||
*
|
||||
* You must end the span using {@link TracingSpan.end}.
|
||||
*
|
||||
* Most of the time you will want to use {@link withSpan} instead.
|
||||
*
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param operationOptions - The original operation options.
|
||||
* @param spanOptions - The options to use when creating the span.
|
||||
*
|
||||
* @returns A {@link TracingSpan} and the updated operation options.
|
||||
*/
|
||||
startSpan<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}>(name: string, operationOptions?: Options, spanOptions?: TracingSpanOptions): {
|
||||
span: TracingSpan;
|
||||
updatedOptions: OptionsWithTracingContext<Options>;
|
||||
};
|
||||
/**
|
||||
* Wraps a callback with an active context and calls the callback.
|
||||
* Depending on the implementation, this may set the globally available active context.
|
||||
*
|
||||
* Useful when you want to leave the boundaries of the SDK (make a request or callback to user code) and are unable to use the {@link withSpan} API.
|
||||
*
|
||||
* @param context - The {@link TracingContext} to use as the active context in the scope of the callback.
|
||||
* @param callback - The callback to be invoked with the given context set as the globally active context.
|
||||
* @param callbackArgs - The callback arguments.
|
||||
*/
|
||||
withContext<CallbackArgs extends unknown[], Callback extends (...args: CallbackArgs) => ReturnType<Callback>>(context: TracingContext, callback: Callback, ...callbackArgs: CallbackArgs): ReturnType<Callback>;
|
||||
/**
|
||||
* Parses a traceparent header value into a {@link TracingSpanContext}.
|
||||
*
|
||||
* @param traceparentHeader - The traceparent header to parse.
|
||||
* @returns An implementation-specific identifier for the span.
|
||||
*/
|
||||
parseTraceparentHeader(traceparentHeader: string): TracingContext | undefined;
|
||||
/**
|
||||
* Creates a set of request headers to propagate tracing information to a backend.
|
||||
*
|
||||
* @param tracingContext - The context containing the span to propagate.
|
||||
* @returns The set of headers to add to a request.
|
||||
*/
|
||||
createRequestHeaders(tracingContext?: TracingContext): Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Options that can be passed to {@link createTracingClient}
|
||||
*/
|
||||
export interface TracingClientOptions {
|
||||
/** The value of the az.namespace tracing attribute on newly created spans. */
|
||||
namespace: string;
|
||||
/** The name of the package invoking this trace. */
|
||||
packageName: string;
|
||||
/** An optional version of the package invoking this trace. */
|
||||
packageVersion?: string;
|
||||
}
|
||||
/** The kind of span. */
|
||||
export type TracingSpanKind = "client" | "server" | "producer" | "consumer" | "internal";
|
||||
/** Options used to configure the newly created span. */
|
||||
export interface TracingSpanOptions {
|
||||
/** The kind of span. Implementations should default this to "client". */
|
||||
spanKind?: TracingSpanKind;
|
||||
/** A collection of {@link TracingSpanLink} to link to this span. */
|
||||
spanLinks?: TracingSpanLink[];
|
||||
/** Initial set of attributes to set on a span. */
|
||||
spanAttributes?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
/** A pointer from the current {@link TracingSpan} to another span in the same or a different trace. */
|
||||
export interface TracingSpanLink {
|
||||
/** The {@link TracingContext} containing the span context to link to. */
|
||||
tracingContext: TracingContext;
|
||||
/** A set of attributes on the link. */
|
||||
attributes?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents an implementation agnostic instrumenter.
|
||||
*/
|
||||
export interface Instrumenter {
|
||||
/**
|
||||
* Creates a new {@link TracingSpan} with the given name and options and sets it on a new context.
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param spanOptions - The options to use when creating the span.
|
||||
*
|
||||
* @returns A {@link TracingSpan} that can be used to end the span, and the context this span has been set on.
|
||||
*/
|
||||
startSpan(name: string, spanOptions: InstrumenterSpanOptions): {
|
||||
span: TracingSpan;
|
||||
tracingContext: TracingContext;
|
||||
};
|
||||
/**
|
||||
* Wraps a callback with an active context and calls the callback.
|
||||
* Depending on the implementation, this may set the globally available active context.
|
||||
*
|
||||
* @param context - The {@link TracingContext} to use as the active context in the scope of the callback.
|
||||
* @param callback - The callback to be invoked with the given context set as the globally active context.
|
||||
* @param callbackArgs - The callback arguments.
|
||||
*/
|
||||
withContext<CallbackArgs extends unknown[], Callback extends (...args: CallbackArgs) => ReturnType<Callback>>(context: TracingContext, callback: Callback, ...callbackArgs: CallbackArgs): ReturnType<Callback>;
|
||||
/**
|
||||
* Provides an implementation-specific method to parse a {@link https://www.w3.org/TR/trace-context/#traceparent-header}
|
||||
* into a {@link TracingSpanContext} which can be used to link non-parented spans together.
|
||||
*/
|
||||
parseTraceparentHeader(traceparentHeader: string): TracingContext | undefined;
|
||||
/**
|
||||
* Provides an implementation-specific method to serialize a {@link TracingSpan} to a set of headers.
|
||||
* @param tracingContext - The context containing the span to serialize.
|
||||
*/
|
||||
createRequestHeaders(tracingContext?: TracingContext): Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Options passed to {@link Instrumenter.startSpan} as a superset of {@link TracingSpanOptions}.
|
||||
*/
|
||||
export interface InstrumenterSpanOptions extends TracingSpanOptions {
|
||||
/** The name of the package invoking this trace. */
|
||||
packageName: string;
|
||||
/** The version of the package invoking this trace. */
|
||||
packageVersion?: string;
|
||||
/** The current tracing context. Defaults to an implementation-specific "active" context. */
|
||||
tracingContext?: TracingContext;
|
||||
}
|
||||
/**
|
||||
* Status representing a successful operation that can be sent to {@link TracingSpan.setStatus}
|
||||
*/
|
||||
export type SpanStatusSuccess = {
|
||||
status: "success";
|
||||
};
|
||||
/**
|
||||
* Status representing an error that can be sent to {@link TracingSpan.setStatus}
|
||||
*/
|
||||
export type SpanStatusError = {
|
||||
status: "error";
|
||||
error?: Error | string;
|
||||
};
|
||||
/**
|
||||
* Represents the statuses that can be passed to {@link TracingSpan.setStatus}.
|
||||
*
|
||||
* By default, all spans will be created with status "unset".
|
||||
*/
|
||||
export type SpanStatus = SpanStatusSuccess | SpanStatusError;
|
||||
/**
|
||||
* Represents options you can pass to {@link TracingSpan.addEvent}.
|
||||
*/
|
||||
export interface AddEventOptions {
|
||||
/**
|
||||
* A set of attributes to attach to the event.
|
||||
*/
|
||||
attributes?: Record<string, unknown>;
|
||||
/**
|
||||
* The start time of the event.
|
||||
*/
|
||||
startTime?: Date;
|
||||
}
|
||||
/**
|
||||
* Represents an implementation agnostic tracing span.
|
||||
*/
|
||||
export interface TracingSpan {
|
||||
/**
|
||||
* Sets the status of the span. When an error is provided, it will be recorded on the span as well.
|
||||
*
|
||||
* @param status - The {@link SpanStatus} to set on the span.
|
||||
*/
|
||||
setStatus(status: SpanStatus): void;
|
||||
/**
|
||||
* Sets a given attribute on a span.
|
||||
*
|
||||
* @param name - The attribute's name.
|
||||
* @param value - The attribute's value to set. May be any non-nullish value.
|
||||
*/
|
||||
setAttribute(name: string, value: unknown): void;
|
||||
/**
|
||||
* Ends the span.
|
||||
*/
|
||||
end(): void;
|
||||
/**
|
||||
* Records an exception on a {@link TracingSpan} without modifying its status.
|
||||
*
|
||||
* When recording an unhandled exception that should fail the span, please use {@link TracingSpan.setStatus} instead.
|
||||
*
|
||||
* @param exception - The exception to record on the span.
|
||||
*
|
||||
*/
|
||||
recordException(exception: Error | string): void;
|
||||
/**
|
||||
* Returns true if this {@link TracingSpan} is recording information.
|
||||
*
|
||||
* Depending on the span implementation, this may return false if the span is not being sampled.
|
||||
*/
|
||||
isRecording(): boolean;
|
||||
/**
|
||||
* Adds an event to the span.
|
||||
*/
|
||||
addEvent?(name: string, options?: AddEventOptions): void;
|
||||
}
|
||||
/** An immutable context bag of tracing values for the current operation. */
|
||||
export interface TracingContext {
|
||||
/**
|
||||
* Sets a given object on a context.
|
||||
* @param key - The key of the given context value.
|
||||
* @param value - The value to set on the context.
|
||||
*
|
||||
* @returns - A new context with the given value set.
|
||||
*/
|
||||
setValue(key: symbol, value: unknown): TracingContext;
|
||||
/**
|
||||
* Gets an object from the context if it exists.
|
||||
* @param key - The key of the given context value.
|
||||
*
|
||||
* @returns - The value of the given context value if it exists, otherwise `undefined`.
|
||||
*/
|
||||
getValue(key: symbol): unknown;
|
||||
/**
|
||||
* Deletes an object from the context if it exists.
|
||||
* @param key - The key of the given context value to delete.
|
||||
*/
|
||||
deleteValue(key: symbol): TracingContext;
|
||||
}
|
||||
/**
|
||||
* Tracing options to set on an operation.
|
||||
*/
|
||||
export interface OperationTracingOptions {
|
||||
/** The context to use for created Tracing Spans. */
|
||||
tracingContext?: TracingContext;
|
||||
}
|
||||
/**
|
||||
* A utility type for when we know a TracingContext has been set
|
||||
* as part of an operation's options.
|
||||
*/
|
||||
export type OptionsWithTracingContext<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}> = Options & {
|
||||
tracingOptions: {
|
||||
tracingContext: TracingContext;
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=interfaces.d.ts.map
|
||||
4
backend/node_modules/@azure/core-tracing/dist/esm/interfaces.js
generated
vendored
Normal file
4
backend/node_modules/@azure/core-tracing/dist/esm/interfaces.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
export {};
|
||||
//# sourceMappingURL=interfaces.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/esm/interfaces.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/esm/interfaces.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
backend/node_modules/@azure/core-tracing/dist/esm/package.json
generated
vendored
Normal file
3
backend/node_modules/@azure/core-tracing/dist/esm/package.json
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
8
backend/node_modules/@azure/core-tracing/dist/esm/state.d.ts
generated
vendored
Normal file
8
backend/node_modules/@azure/core-tracing/dist/esm/state.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import type { Instrumenter } from "./interfaces.js";
|
||||
/**
|
||||
* Defines the shared state between CJS and ESM by re-exporting the CJS state.
|
||||
*/
|
||||
export declare const state: {
|
||||
instrumenterImplementation: Instrumenter | undefined;
|
||||
};
|
||||
//# sourceMappingURL=state.d.ts.map
|
||||
10
backend/node_modules/@azure/core-tracing/dist/esm/state.js
generated
vendored
Normal file
10
backend/node_modules/@azure/core-tracing/dist/esm/state.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
// @ts-expect-error The recommended approach to sharing module state between ESM and CJS.
|
||||
// See https://github.com/isaacs/tshy/blob/main/README.md#module-local-state for additional information.
|
||||
import { state as cjsState } from "../commonjs/state.js";
|
||||
/**
|
||||
* Defines the shared state between CJS and ESM by re-exporting the CJS state.
|
||||
*/
|
||||
export const state = cjsState;
|
||||
//# sourceMappingURL=state.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/esm/state.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/esm/state.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,yFAAyF;AACzF,wGAAwG;AACxG,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,QAEpB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Instrumenter } from \"./interfaces.js\";\n// @ts-expect-error The recommended approach to sharing module state between ESM and CJS.\n// See https://github.com/isaacs/tshy/blob/main/README.md#module-local-state for additional information.\nimport { state as cjsState } from \"../commonjs/state.js\";\n\n/**\n * Defines the shared state between CJS and ESM by re-exporting the CJS state.\n */\nexport const state = cjsState as {\n instrumenterImplementation: Instrumenter | undefined;\n};\n"]}
|
||||
9
backend/node_modules/@azure/core-tracing/dist/esm/tracingClient.d.ts
generated
vendored
Normal file
9
backend/node_modules/@azure/core-tracing/dist/esm/tracingClient.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import type { TracingClient, TracingClientOptions } from "./interfaces.js";
|
||||
/**
|
||||
* Creates a new tracing client.
|
||||
*
|
||||
* @param options - Options used to configure the tracing client.
|
||||
* @returns - An instance of {@link TracingClient}.
|
||||
*/
|
||||
export declare function createTracingClient(options: TracingClientOptions): TracingClient;
|
||||
//# sourceMappingURL=tracingClient.d.ts.map
|
||||
78
backend/node_modules/@azure/core-tracing/dist/esm/tracingClient.js
generated
vendored
Normal file
78
backend/node_modules/@azure/core-tracing/dist/esm/tracingClient.js
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { getInstrumenter } from "./instrumenter.js";
|
||||
import { knownContextKeys } from "./tracingContext.js";
|
||||
/**
|
||||
* Creates a new tracing client.
|
||||
*
|
||||
* @param options - Options used to configure the tracing client.
|
||||
* @returns - An instance of {@link TracingClient}.
|
||||
*/
|
||||
export function createTracingClient(options) {
|
||||
const { namespace, packageName, packageVersion } = options;
|
||||
function startSpan(name, operationOptions, spanOptions) {
|
||||
const startSpanResult = getInstrumenter().startSpan(name, {
|
||||
...spanOptions,
|
||||
packageName: packageName,
|
||||
packageVersion: packageVersion,
|
||||
tracingContext: operationOptions?.tracingOptions?.tracingContext,
|
||||
});
|
||||
let tracingContext = startSpanResult.tracingContext;
|
||||
const span = startSpanResult.span;
|
||||
if (!tracingContext.getValue(knownContextKeys.namespace)) {
|
||||
tracingContext = tracingContext.setValue(knownContextKeys.namespace, namespace);
|
||||
}
|
||||
span.setAttribute("az.namespace", tracingContext.getValue(knownContextKeys.namespace));
|
||||
const updatedOptions = Object.assign({}, operationOptions, {
|
||||
tracingOptions: { ...operationOptions?.tracingOptions, tracingContext },
|
||||
});
|
||||
return {
|
||||
span,
|
||||
updatedOptions,
|
||||
};
|
||||
}
|
||||
async function withSpan(name, operationOptions, callback, spanOptions) {
|
||||
const { span, updatedOptions } = startSpan(name, operationOptions, spanOptions);
|
||||
try {
|
||||
const result = await withContext(updatedOptions.tracingOptions.tracingContext, () => Promise.resolve(callback(updatedOptions, span)));
|
||||
span.setStatus({ status: "success" });
|
||||
return result;
|
||||
}
|
||||
catch (err) {
|
||||
span.setStatus({ status: "error", error: err });
|
||||
throw err;
|
||||
}
|
||||
finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
function withContext(context, callback, ...callbackArgs) {
|
||||
return getInstrumenter().withContext(context, callback, ...callbackArgs);
|
||||
}
|
||||
/**
|
||||
* Parses a traceparent header value into a span identifier.
|
||||
*
|
||||
* @param traceparentHeader - The traceparent header to parse.
|
||||
* @returns An implementation-specific identifier for the span.
|
||||
*/
|
||||
function parseTraceparentHeader(traceparentHeader) {
|
||||
return getInstrumenter().parseTraceparentHeader(traceparentHeader);
|
||||
}
|
||||
/**
|
||||
* Creates a set of request headers to propagate tracing information to a backend.
|
||||
*
|
||||
* @param tracingContext - The context containing the span to serialize.
|
||||
* @returns The set of headers to add to a request.
|
||||
*/
|
||||
function createRequestHeaders(tracingContext) {
|
||||
return getInstrumenter().createRequestHeaders(tracingContext);
|
||||
}
|
||||
return {
|
||||
startSpan,
|
||||
withSpan,
|
||||
withContext,
|
||||
parseTraceparentHeader,
|
||||
createRequestHeaders,
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=tracingClient.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/esm/tracingClient.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/esm/tracingClient.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
34
backend/node_modules/@azure/core-tracing/dist/esm/tracingContext.d.ts
generated
vendored
Normal file
34
backend/node_modules/@azure/core-tracing/dist/esm/tracingContext.d.ts
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
import type { TracingContext, TracingSpan } from "./interfaces.js";
|
||||
/** @internal */
|
||||
export declare const knownContextKeys: {
|
||||
span: symbol;
|
||||
namespace: symbol;
|
||||
};
|
||||
/**
|
||||
* Creates a new {@link TracingContext} with the given options.
|
||||
* @param options - A set of known keys that may be set on the context.
|
||||
* @returns A new {@link TracingContext} with the given options.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export declare function createTracingContext(options?: CreateTracingContextOptions): TracingContext;
|
||||
/** @internal */
|
||||
export declare class TracingContextImpl implements TracingContext {
|
||||
private _contextMap;
|
||||
constructor(initialContext?: TracingContext);
|
||||
setValue(key: symbol, value: unknown): TracingContext;
|
||||
getValue(key: symbol): unknown;
|
||||
deleteValue(key: symbol): TracingContext;
|
||||
}
|
||||
/**
|
||||
* Represents a set of items that can be set when creating a new {@link TracingContext}.
|
||||
*/
|
||||
export interface CreateTracingContextOptions {
|
||||
/** The {@link parentContext} - the newly created context will contain all the values of the parent context unless overridden. */
|
||||
parentContext?: TracingContext;
|
||||
/** An initial span to set on the context. */
|
||||
span?: TracingSpan;
|
||||
/** The namespace to set on any child spans. */
|
||||
namespace?: string;
|
||||
}
|
||||
//# sourceMappingURL=tracingContext.d.ts.map
|
||||
48
backend/node_modules/@azure/core-tracing/dist/esm/tracingContext.js
generated
vendored
Normal file
48
backend/node_modules/@azure/core-tracing/dist/esm/tracingContext.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
/** @internal */
|
||||
export const knownContextKeys = {
|
||||
span: Symbol.for("@azure/core-tracing span"),
|
||||
namespace: Symbol.for("@azure/core-tracing namespace"),
|
||||
};
|
||||
/**
|
||||
* Creates a new {@link TracingContext} with the given options.
|
||||
* @param options - A set of known keys that may be set on the context.
|
||||
* @returns A new {@link TracingContext} with the given options.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export function createTracingContext(options = {}) {
|
||||
let context = new TracingContextImpl(options.parentContext);
|
||||
if (options.span) {
|
||||
context = context.setValue(knownContextKeys.span, options.span);
|
||||
}
|
||||
if (options.namespace) {
|
||||
context = context.setValue(knownContextKeys.namespace, options.namespace);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
/** @internal */
|
||||
export class TracingContextImpl {
|
||||
_contextMap;
|
||||
constructor(initialContext) {
|
||||
this._contextMap =
|
||||
initialContext instanceof TracingContextImpl
|
||||
? new Map(initialContext._contextMap)
|
||||
: new Map();
|
||||
}
|
||||
setValue(key, value) {
|
||||
const newContext = new TracingContextImpl(this);
|
||||
newContext._contextMap.set(key, value);
|
||||
return newContext;
|
||||
}
|
||||
getValue(key) {
|
||||
return this._contextMap.get(key);
|
||||
}
|
||||
deleteValue(key) {
|
||||
const newContext = new TracingContextImpl(this);
|
||||
newContext._contextMap.delete(key);
|
||||
return newContext;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=tracingContext.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/esm/tracingContext.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/esm/tracingContext.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"tracingContext.js","sourceRoot":"","sources":["../../src/tracingContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAuC,EAAE;IAC5E,IAAI,OAAO,GAAmB,IAAI,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5E,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,gBAAgB;AAChB,MAAM,OAAO,kBAAkB;IACrB,WAAW,CAAuB;IAC1C,YAAY,cAA+B;QACzC,IAAI,CAAC,WAAW;YACd,cAAc,YAAY,kBAAkB;gBAC1C,CAAC,CAAC,IAAI,GAAG,CAAkB,cAAc,CAAC,WAAW,CAAC;gBACtD,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAc;QAClC,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,UAAU,CAAC;IACpB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TracingContext, TracingSpan } from \"./interfaces.js\";\n\n/** @internal */\nexport const knownContextKeys = {\n span: Symbol.for(\"@azure/core-tracing span\"),\n namespace: Symbol.for(\"@azure/core-tracing namespace\"),\n};\n\n/**\n * Creates a new {@link TracingContext} with the given options.\n * @param options - A set of known keys that may be set on the context.\n * @returns A new {@link TracingContext} with the given options.\n *\n * @internal\n */\nexport function createTracingContext(options: CreateTracingContextOptions = {}): TracingContext {\n let context: TracingContext = new TracingContextImpl(options.parentContext);\n if (options.span) {\n context = context.setValue(knownContextKeys.span, options.span);\n }\n if (options.namespace) {\n context = context.setValue(knownContextKeys.namespace, options.namespace);\n }\n return context;\n}\n\n/** @internal */\nexport class TracingContextImpl implements TracingContext {\n private _contextMap: Map<symbol, unknown>;\n constructor(initialContext?: TracingContext) {\n this._contextMap =\n initialContext instanceof TracingContextImpl\n ? new Map<symbol, unknown>(initialContext._contextMap)\n : new Map();\n }\n\n setValue(key: symbol, value: unknown): TracingContext {\n const newContext = new TracingContextImpl(this);\n newContext._contextMap.set(key, value);\n return newContext;\n }\n\n getValue(key: symbol): unknown {\n return this._contextMap.get(key);\n }\n\n deleteValue(key: symbol): TracingContext {\n const newContext = new TracingContextImpl(this);\n newContext._contextMap.delete(key);\n return newContext;\n }\n}\n\n/**\n * Represents a set of items that can be set when creating a new {@link TracingContext}.\n */\nexport interface CreateTracingContextOptions {\n /** The {@link parentContext} - the newly created context will contain all the values of the parent context unless overridden. */\n parentContext?: TracingContext;\n /** An initial span to set on the context. */\n span?: TracingSpan;\n /** The namespace to set on any child spans. */\n namespace?: string;\n}\n"]}
|
||||
4
backend/node_modules/@azure/core-tracing/dist/react-native/index.d.ts
generated
vendored
Normal file
4
backend/node_modules/@azure/core-tracing/dist/react-native/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
export { AddEventOptions, Instrumenter, InstrumenterSpanOptions, OperationTracingOptions, OptionsWithTracingContext, Resolved, SpanStatus, SpanStatusError, SpanStatusSuccess, TracingClient, TracingClientOptions, TracingContext, TracingSpan, TracingSpanKind, TracingSpanLink, TracingSpanOptions, } from "./interfaces.js";
|
||||
export { useInstrumenter } from "./instrumenter.js";
|
||||
export { createTracingClient } from "./tracingClient.js";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
5
backend/node_modules/@azure/core-tracing/dist/react-native/index.js
generated
vendored
Normal file
5
backend/node_modules/@azure/core-tracing/dist/react-native/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
export { useInstrumenter } from "./instrumenter.js";
|
||||
export { createTracingClient } from "./tracingClient.js";
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/react-native/index.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/react-native/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAoBlC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n AddEventOptions,\n Instrumenter,\n InstrumenterSpanOptions,\n OperationTracingOptions,\n OptionsWithTracingContext,\n Resolved,\n SpanStatus,\n SpanStatusError,\n SpanStatusSuccess,\n TracingClient,\n TracingClientOptions,\n TracingContext,\n TracingSpan,\n TracingSpanKind,\n TracingSpanLink,\n TracingSpanOptions,\n} from \"./interfaces.js\";\nexport { useInstrumenter } from \"./instrumenter.js\";\nexport { createTracingClient } from \"./tracingClient.js\";\n"]}
|
||||
16
backend/node_modules/@azure/core-tracing/dist/react-native/instrumenter.d.ts
generated
vendored
Normal file
16
backend/node_modules/@azure/core-tracing/dist/react-native/instrumenter.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import type { Instrumenter, TracingSpan } from "./interfaces.js";
|
||||
export declare function createDefaultTracingSpan(): TracingSpan;
|
||||
export declare function createDefaultInstrumenter(): Instrumenter;
|
||||
/**
|
||||
* Extends the Azure SDK with support for a given instrumenter implementation.
|
||||
*
|
||||
* @param instrumenter - The instrumenter implementation to use.
|
||||
*/
|
||||
export declare function useInstrumenter(instrumenter: Instrumenter): void;
|
||||
/**
|
||||
* Gets the currently set instrumenter, a No-Op instrumenter by default.
|
||||
*
|
||||
* @returns The currently set instrumenter
|
||||
*/
|
||||
export declare function getInstrumenter(): Instrumenter;
|
||||
//# sourceMappingURL=instrumenter.d.ts.map
|
||||
63
backend/node_modules/@azure/core-tracing/dist/react-native/instrumenter.js
generated
vendored
Normal file
63
backend/node_modules/@azure/core-tracing/dist/react-native/instrumenter.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { createTracingContext } from "./tracingContext.js";
|
||||
import { state } from "./state.js";
|
||||
export function createDefaultTracingSpan() {
|
||||
return {
|
||||
end: () => {
|
||||
// noop
|
||||
},
|
||||
isRecording: () => false,
|
||||
recordException: () => {
|
||||
// noop
|
||||
},
|
||||
setAttribute: () => {
|
||||
// noop
|
||||
},
|
||||
setStatus: () => {
|
||||
// noop
|
||||
},
|
||||
addEvent: () => {
|
||||
// noop
|
||||
},
|
||||
};
|
||||
}
|
||||
export function createDefaultInstrumenter() {
|
||||
return {
|
||||
createRequestHeaders: () => {
|
||||
return {};
|
||||
},
|
||||
parseTraceparentHeader: () => {
|
||||
return undefined;
|
||||
},
|
||||
startSpan: (_name, spanOptions) => {
|
||||
return {
|
||||
span: createDefaultTracingSpan(),
|
||||
tracingContext: createTracingContext({ parentContext: spanOptions.tracingContext }),
|
||||
};
|
||||
},
|
||||
withContext(_context, callback, ...callbackArgs) {
|
||||
return callback(...callbackArgs);
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Extends the Azure SDK with support for a given instrumenter implementation.
|
||||
*
|
||||
* @param instrumenter - The instrumenter implementation to use.
|
||||
*/
|
||||
export function useInstrumenter(instrumenter) {
|
||||
state.instrumenterImplementation = instrumenter;
|
||||
}
|
||||
/**
|
||||
* Gets the currently set instrumenter, a No-Op instrumenter by default.
|
||||
*
|
||||
* @returns The currently set instrumenter
|
||||
*/
|
||||
export function getInstrumenter() {
|
||||
if (!state.instrumenterImplementation) {
|
||||
state.instrumenterImplementation = createDefaultInstrumenter();
|
||||
}
|
||||
return state.instrumenterImplementation;
|
||||
}
|
||||
//# sourceMappingURL=instrumenter.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/react-native/instrumenter.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/react-native/instrumenter.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"instrumenter.js","sourceRoot":"","sources":["../../src/instrumenter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AASlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,GAAG,EAAE,GAAG,EAAE;YACR,OAAO;QACT,CAAC;QACD,WAAW,EAAE,GAAG,EAAE,CAAC,KAAK;QACxB,eAAe,EAAE,GAAG,EAAE;YACpB,OAAO;QACT,CAAC;QACD,YAAY,EAAE,GAAG,EAAE;YACjB,OAAO;QACT,CAAC;QACD,SAAS,EAAE,GAAG,EAAE;YACd,OAAO;QACT,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE;YACb,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB;IACvC,OAAO;QACL,oBAAoB,EAAE,GAA2B,EAAE;YACjD,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,sBAAsB,EAAE,GAA+B,EAAE;YACvD,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,SAAS,EAAE,CACT,KAAa,EACb,WAAoC,EACmB,EAAE;YACzD,OAAO;gBACL,IAAI,EAAE,wBAAwB,EAAE;gBAChC,cAAc,EAAE,oBAAoB,CAAC,EAAE,aAAa,EAAE,WAAW,CAAC,cAAc,EAAE,CAAC;aACpF,CAAC;QACJ,CAAC;QACD,WAAW,CAIT,QAAwB,EACxB,QAAkB,EAClB,GAAG,YAA0B;YAE7B,OAAO,QAAQ,CAAC,GAAG,YAAY,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,YAA0B;IACxD,KAAK,CAAC,0BAA0B,GAAG,YAAY,CAAC;AAClD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE,CAAC;QACtC,KAAK,CAAC,0BAA0B,GAAG,yBAAyB,EAAE,CAAC;IACjE,CAAC;IACD,OAAO,KAAK,CAAC,0BAA0B,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n Instrumenter,\n InstrumenterSpanOptions,\n TracingContext,\n TracingSpan,\n} from \"./interfaces.js\";\n\nimport { createTracingContext } from \"./tracingContext.js\";\nimport { state } from \"./state.js\";\n\nexport function createDefaultTracingSpan(): TracingSpan {\n return {\n end: () => {\n // noop\n },\n isRecording: () => false,\n recordException: () => {\n // noop\n },\n setAttribute: () => {\n // noop\n },\n setStatus: () => {\n // noop\n },\n addEvent: () => {\n // noop\n },\n };\n}\n\nexport function createDefaultInstrumenter(): Instrumenter {\n return {\n createRequestHeaders: (): Record<string, string> => {\n return {};\n },\n parseTraceparentHeader: (): TracingContext | undefined => {\n return undefined;\n },\n startSpan: (\n _name: string,\n spanOptions: InstrumenterSpanOptions,\n ): { span: TracingSpan; tracingContext: TracingContext } => {\n return {\n span: createDefaultTracingSpan(),\n tracingContext: createTracingContext({ parentContext: spanOptions.tracingContext }),\n };\n },\n withContext<\n CallbackArgs extends unknown[],\n Callback extends (...args: CallbackArgs) => ReturnType<Callback>,\n >(\n _context: TracingContext,\n callback: Callback,\n ...callbackArgs: CallbackArgs\n ): ReturnType<Callback> {\n return callback(...callbackArgs);\n },\n };\n}\n\n/**\n * Extends the Azure SDK with support for a given instrumenter implementation.\n *\n * @param instrumenter - The instrumenter implementation to use.\n */\nexport function useInstrumenter(instrumenter: Instrumenter): void {\n state.instrumenterImplementation = instrumenter;\n}\n\n/**\n * Gets the currently set instrumenter, a No-Op instrumenter by default.\n *\n * @returns The currently set instrumenter\n */\nexport function getInstrumenter(): Instrumenter {\n if (!state.instrumenterImplementation) {\n state.instrumenterImplementation = createDefaultInstrumenter();\n }\n return state.instrumenterImplementation;\n}\n"]}
|
||||
288
backend/node_modules/@azure/core-tracing/dist/react-native/interfaces.d.ts
generated
vendored
Normal file
288
backend/node_modules/@azure/core-tracing/dist/react-native/interfaces.d.ts
generated
vendored
Normal file
@ -0,0 +1,288 @@
|
||||
/**
|
||||
* A narrower version of TypeScript 4.5's Awaited type which Recursively
|
||||
* unwraps the "awaited type", emulating the behavior of `await`.
|
||||
*/
|
||||
export type Resolved<T> = T extends {
|
||||
then(onfulfilled: infer F): any;
|
||||
} ? F extends (value: infer V) => any ? Resolved<V> : never : T;
|
||||
/**
|
||||
* Represents a client that can integrate with the currently configured {@link Instrumenter}.
|
||||
*
|
||||
* Create an instance using {@link createTracingClient}.
|
||||
*/
|
||||
export interface TracingClient {
|
||||
/**
|
||||
* Wraps a callback in a tracing span, calls the callback, and closes the span.
|
||||
*
|
||||
* This is the primary interface for using Tracing and will handle error recording as well as setting the status on the span.
|
||||
*
|
||||
* Both synchronous and asynchronous functions will be awaited in order to reflect the result of the callback on the span.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```ts snippet:ReadmeSampleWithSpanExample
|
||||
* import { createTracingClient } from "@azure/core-tracing";
|
||||
*
|
||||
* const tracingClient = createTracingClient({
|
||||
* namespace: "test.namespace",
|
||||
* packageName: "test-package",
|
||||
* packageVersion: "1.0.0",
|
||||
* });
|
||||
*
|
||||
* const options = {};
|
||||
*
|
||||
* const myOperationResult = await tracingClient.withSpan(
|
||||
* "myClassName.myOperationName",
|
||||
* options,
|
||||
* (updatedOptions) => {
|
||||
* // Do something with the updated options.
|
||||
* return "myOperationResult";
|
||||
* },
|
||||
* );
|
||||
* ```
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param operationOptions - The original options passed to the method. The callback will receive these options with the newly created {@link TracingContext}.
|
||||
* @param callback - The callback to be invoked with the updated options and newly created {@link TracingSpan}.
|
||||
*/
|
||||
withSpan<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}, Callback extends (updatedOptions: Options, span: Omit<TracingSpan, "end">) => ReturnType<Callback>>(name: string, operationOptions: Options, callback: Callback, spanOptions?: TracingSpanOptions): Promise<Resolved<ReturnType<Callback>>>;
|
||||
/**
|
||||
* Starts a given span but does not set it as the active span.
|
||||
*
|
||||
* You must end the span using {@link TracingSpan.end}.
|
||||
*
|
||||
* Most of the time you will want to use {@link withSpan} instead.
|
||||
*
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param operationOptions - The original operation options.
|
||||
* @param spanOptions - The options to use when creating the span.
|
||||
*
|
||||
* @returns A {@link TracingSpan} and the updated operation options.
|
||||
*/
|
||||
startSpan<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}>(name: string, operationOptions?: Options, spanOptions?: TracingSpanOptions): {
|
||||
span: TracingSpan;
|
||||
updatedOptions: OptionsWithTracingContext<Options>;
|
||||
};
|
||||
/**
|
||||
* Wraps a callback with an active context and calls the callback.
|
||||
* Depending on the implementation, this may set the globally available active context.
|
||||
*
|
||||
* Useful when you want to leave the boundaries of the SDK (make a request or callback to user code) and are unable to use the {@link withSpan} API.
|
||||
*
|
||||
* @param context - The {@link TracingContext} to use as the active context in the scope of the callback.
|
||||
* @param callback - The callback to be invoked with the given context set as the globally active context.
|
||||
* @param callbackArgs - The callback arguments.
|
||||
*/
|
||||
withContext<CallbackArgs extends unknown[], Callback extends (...args: CallbackArgs) => ReturnType<Callback>>(context: TracingContext, callback: Callback, ...callbackArgs: CallbackArgs): ReturnType<Callback>;
|
||||
/**
|
||||
* Parses a traceparent header value into a {@link TracingSpanContext}.
|
||||
*
|
||||
* @param traceparentHeader - The traceparent header to parse.
|
||||
* @returns An implementation-specific identifier for the span.
|
||||
*/
|
||||
parseTraceparentHeader(traceparentHeader: string): TracingContext | undefined;
|
||||
/**
|
||||
* Creates a set of request headers to propagate tracing information to a backend.
|
||||
*
|
||||
* @param tracingContext - The context containing the span to propagate.
|
||||
* @returns The set of headers to add to a request.
|
||||
*/
|
||||
createRequestHeaders(tracingContext?: TracingContext): Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Options that can be passed to {@link createTracingClient}
|
||||
*/
|
||||
export interface TracingClientOptions {
|
||||
/** The value of the az.namespace tracing attribute on newly created spans. */
|
||||
namespace: string;
|
||||
/** The name of the package invoking this trace. */
|
||||
packageName: string;
|
||||
/** An optional version of the package invoking this trace. */
|
||||
packageVersion?: string;
|
||||
}
|
||||
/** The kind of span. */
|
||||
export type TracingSpanKind = "client" | "server" | "producer" | "consumer" | "internal";
|
||||
/** Options used to configure the newly created span. */
|
||||
export interface TracingSpanOptions {
|
||||
/** The kind of span. Implementations should default this to "client". */
|
||||
spanKind?: TracingSpanKind;
|
||||
/** A collection of {@link TracingSpanLink} to link to this span. */
|
||||
spanLinks?: TracingSpanLink[];
|
||||
/** Initial set of attributes to set on a span. */
|
||||
spanAttributes?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
/** A pointer from the current {@link TracingSpan} to another span in the same or a different trace. */
|
||||
export interface TracingSpanLink {
|
||||
/** The {@link TracingContext} containing the span context to link to. */
|
||||
tracingContext: TracingContext;
|
||||
/** A set of attributes on the link. */
|
||||
attributes?: {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents an implementation agnostic instrumenter.
|
||||
*/
|
||||
export interface Instrumenter {
|
||||
/**
|
||||
* Creates a new {@link TracingSpan} with the given name and options and sets it on a new context.
|
||||
* @param name - The name of the span. By convention this should be `${className}.${methodName}`.
|
||||
* @param spanOptions - The options to use when creating the span.
|
||||
*
|
||||
* @returns A {@link TracingSpan} that can be used to end the span, and the context this span has been set on.
|
||||
*/
|
||||
startSpan(name: string, spanOptions: InstrumenterSpanOptions): {
|
||||
span: TracingSpan;
|
||||
tracingContext: TracingContext;
|
||||
};
|
||||
/**
|
||||
* Wraps a callback with an active context and calls the callback.
|
||||
* Depending on the implementation, this may set the globally available active context.
|
||||
*
|
||||
* @param context - The {@link TracingContext} to use as the active context in the scope of the callback.
|
||||
* @param callback - The callback to be invoked with the given context set as the globally active context.
|
||||
* @param callbackArgs - The callback arguments.
|
||||
*/
|
||||
withContext<CallbackArgs extends unknown[], Callback extends (...args: CallbackArgs) => ReturnType<Callback>>(context: TracingContext, callback: Callback, ...callbackArgs: CallbackArgs): ReturnType<Callback>;
|
||||
/**
|
||||
* Provides an implementation-specific method to parse a {@link https://www.w3.org/TR/trace-context/#traceparent-header}
|
||||
* into a {@link TracingSpanContext} which can be used to link non-parented spans together.
|
||||
*/
|
||||
parseTraceparentHeader(traceparentHeader: string): TracingContext | undefined;
|
||||
/**
|
||||
* Provides an implementation-specific method to serialize a {@link TracingSpan} to a set of headers.
|
||||
* @param tracingContext - The context containing the span to serialize.
|
||||
*/
|
||||
createRequestHeaders(tracingContext?: TracingContext): Record<string, string>;
|
||||
}
|
||||
/**
|
||||
* Options passed to {@link Instrumenter.startSpan} as a superset of {@link TracingSpanOptions}.
|
||||
*/
|
||||
export interface InstrumenterSpanOptions extends TracingSpanOptions {
|
||||
/** The name of the package invoking this trace. */
|
||||
packageName: string;
|
||||
/** The version of the package invoking this trace. */
|
||||
packageVersion?: string;
|
||||
/** The current tracing context. Defaults to an implementation-specific "active" context. */
|
||||
tracingContext?: TracingContext;
|
||||
}
|
||||
/**
|
||||
* Status representing a successful operation that can be sent to {@link TracingSpan.setStatus}
|
||||
*/
|
||||
export type SpanStatusSuccess = {
|
||||
status: "success";
|
||||
};
|
||||
/**
|
||||
* Status representing an error that can be sent to {@link TracingSpan.setStatus}
|
||||
*/
|
||||
export type SpanStatusError = {
|
||||
status: "error";
|
||||
error?: Error | string;
|
||||
};
|
||||
/**
|
||||
* Represents the statuses that can be passed to {@link TracingSpan.setStatus}.
|
||||
*
|
||||
* By default, all spans will be created with status "unset".
|
||||
*/
|
||||
export type SpanStatus = SpanStatusSuccess | SpanStatusError;
|
||||
/**
|
||||
* Represents options you can pass to {@link TracingSpan.addEvent}.
|
||||
*/
|
||||
export interface AddEventOptions {
|
||||
/**
|
||||
* A set of attributes to attach to the event.
|
||||
*/
|
||||
attributes?: Record<string, unknown>;
|
||||
/**
|
||||
* The start time of the event.
|
||||
*/
|
||||
startTime?: Date;
|
||||
}
|
||||
/**
|
||||
* Represents an implementation agnostic tracing span.
|
||||
*/
|
||||
export interface TracingSpan {
|
||||
/**
|
||||
* Sets the status of the span. When an error is provided, it will be recorded on the span as well.
|
||||
*
|
||||
* @param status - The {@link SpanStatus} to set on the span.
|
||||
*/
|
||||
setStatus(status: SpanStatus): void;
|
||||
/**
|
||||
* Sets a given attribute on a span.
|
||||
*
|
||||
* @param name - The attribute's name.
|
||||
* @param value - The attribute's value to set. May be any non-nullish value.
|
||||
*/
|
||||
setAttribute(name: string, value: unknown): void;
|
||||
/**
|
||||
* Ends the span.
|
||||
*/
|
||||
end(): void;
|
||||
/**
|
||||
* Records an exception on a {@link TracingSpan} without modifying its status.
|
||||
*
|
||||
* When recording an unhandled exception that should fail the span, please use {@link TracingSpan.setStatus} instead.
|
||||
*
|
||||
* @param exception - The exception to record on the span.
|
||||
*
|
||||
*/
|
||||
recordException(exception: Error | string): void;
|
||||
/**
|
||||
* Returns true if this {@link TracingSpan} is recording information.
|
||||
*
|
||||
* Depending on the span implementation, this may return false if the span is not being sampled.
|
||||
*/
|
||||
isRecording(): boolean;
|
||||
/**
|
||||
* Adds an event to the span.
|
||||
*/
|
||||
addEvent?(name: string, options?: AddEventOptions): void;
|
||||
}
|
||||
/** An immutable context bag of tracing values for the current operation. */
|
||||
export interface TracingContext {
|
||||
/**
|
||||
* Sets a given object on a context.
|
||||
* @param key - The key of the given context value.
|
||||
* @param value - The value to set on the context.
|
||||
*
|
||||
* @returns - A new context with the given value set.
|
||||
*/
|
||||
setValue(key: symbol, value: unknown): TracingContext;
|
||||
/**
|
||||
* Gets an object from the context if it exists.
|
||||
* @param key - The key of the given context value.
|
||||
*
|
||||
* @returns - The value of the given context value if it exists, otherwise `undefined`.
|
||||
*/
|
||||
getValue(key: symbol): unknown;
|
||||
/**
|
||||
* Deletes an object from the context if it exists.
|
||||
* @param key - The key of the given context value to delete.
|
||||
*/
|
||||
deleteValue(key: symbol): TracingContext;
|
||||
}
|
||||
/**
|
||||
* Tracing options to set on an operation.
|
||||
*/
|
||||
export interface OperationTracingOptions {
|
||||
/** The context to use for created Tracing Spans. */
|
||||
tracingContext?: TracingContext;
|
||||
}
|
||||
/**
|
||||
* A utility type for when we know a TracingContext has been set
|
||||
* as part of an operation's options.
|
||||
*/
|
||||
export type OptionsWithTracingContext<Options extends {
|
||||
tracingOptions?: OperationTracingOptions;
|
||||
}> = Options & {
|
||||
tracingOptions: {
|
||||
tracingContext: TracingContext;
|
||||
};
|
||||
};
|
||||
//# sourceMappingURL=interfaces.d.ts.map
|
||||
4
backend/node_modules/@azure/core-tracing/dist/react-native/interfaces.js
generated
vendored
Normal file
4
backend/node_modules/@azure/core-tracing/dist/react-native/interfaces.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
export {};
|
||||
//# sourceMappingURL=interfaces.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/react-native/interfaces.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/react-native/interfaces.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
backend/node_modules/@azure/core-tracing/dist/react-native/package.json
generated
vendored
Normal file
3
backend/node_modules/@azure/core-tracing/dist/react-native/package.json
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
8
backend/node_modules/@azure/core-tracing/dist/react-native/state.d.ts
generated
vendored
Normal file
8
backend/node_modules/@azure/core-tracing/dist/react-native/state.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
import type { Instrumenter } from "./interfaces.js";
|
||||
/**
|
||||
* Defines the shared state between CJS and ESM by re-exporting the CJS state.
|
||||
*/
|
||||
export declare const state: {
|
||||
instrumenterImplementation: Instrumenter | undefined;
|
||||
};
|
||||
//# sourceMappingURL=state.d.ts.map
|
||||
10
backend/node_modules/@azure/core-tracing/dist/react-native/state.js
generated
vendored
Normal file
10
backend/node_modules/@azure/core-tracing/dist/react-native/state.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
// @ts-expect-error The recommended approach to sharing module state between ESM and CJS.
|
||||
// See https://github.com/isaacs/tshy/blob/main/README.md#module-local-state for additional information.
|
||||
import { state as cjsState } from "../commonjs/state.js";
|
||||
/**
|
||||
* Defines the shared state between CJS and ESM by re-exporting the CJS state.
|
||||
*/
|
||||
export const state = cjsState;
|
||||
//# sourceMappingURL=state.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/react-native/state.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/react-native/state.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,yFAAyF;AACzF,wGAAwG;AACxG,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,QAEpB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Instrumenter } from \"./interfaces.js\";\n// @ts-expect-error The recommended approach to sharing module state between ESM and CJS.\n// See https://github.com/isaacs/tshy/blob/main/README.md#module-local-state for additional information.\nimport { state as cjsState } from \"../commonjs/state.js\";\n\n/**\n * Defines the shared state between CJS and ESM by re-exporting the CJS state.\n */\nexport const state = cjsState as {\n instrumenterImplementation: Instrumenter | undefined;\n};\n"]}
|
||||
9
backend/node_modules/@azure/core-tracing/dist/react-native/tracingClient.d.ts
generated
vendored
Normal file
9
backend/node_modules/@azure/core-tracing/dist/react-native/tracingClient.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import type { TracingClient, TracingClientOptions } from "./interfaces.js";
|
||||
/**
|
||||
* Creates a new tracing client.
|
||||
*
|
||||
* @param options - Options used to configure the tracing client.
|
||||
* @returns - An instance of {@link TracingClient}.
|
||||
*/
|
||||
export declare function createTracingClient(options: TracingClientOptions): TracingClient;
|
||||
//# sourceMappingURL=tracingClient.d.ts.map
|
||||
78
backend/node_modules/@azure/core-tracing/dist/react-native/tracingClient.js
generated
vendored
Normal file
78
backend/node_modules/@azure/core-tracing/dist/react-native/tracingClient.js
generated
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
import { getInstrumenter } from "./instrumenter.js";
|
||||
import { knownContextKeys } from "./tracingContext.js";
|
||||
/**
|
||||
* Creates a new tracing client.
|
||||
*
|
||||
* @param options - Options used to configure the tracing client.
|
||||
* @returns - An instance of {@link TracingClient}.
|
||||
*/
|
||||
export function createTracingClient(options) {
|
||||
const { namespace, packageName, packageVersion } = options;
|
||||
function startSpan(name, operationOptions, spanOptions) {
|
||||
const startSpanResult = getInstrumenter().startSpan(name, {
|
||||
...spanOptions,
|
||||
packageName: packageName,
|
||||
packageVersion: packageVersion,
|
||||
tracingContext: operationOptions?.tracingOptions?.tracingContext,
|
||||
});
|
||||
let tracingContext = startSpanResult.tracingContext;
|
||||
const span = startSpanResult.span;
|
||||
if (!tracingContext.getValue(knownContextKeys.namespace)) {
|
||||
tracingContext = tracingContext.setValue(knownContextKeys.namespace, namespace);
|
||||
}
|
||||
span.setAttribute("az.namespace", tracingContext.getValue(knownContextKeys.namespace));
|
||||
const updatedOptions = Object.assign({}, operationOptions, {
|
||||
tracingOptions: { ...operationOptions?.tracingOptions, tracingContext },
|
||||
});
|
||||
return {
|
||||
span,
|
||||
updatedOptions,
|
||||
};
|
||||
}
|
||||
async function withSpan(name, operationOptions, callback, spanOptions) {
|
||||
const { span, updatedOptions } = startSpan(name, operationOptions, spanOptions);
|
||||
try {
|
||||
const result = await withContext(updatedOptions.tracingOptions.tracingContext, () => Promise.resolve(callback(updatedOptions, span)));
|
||||
span.setStatus({ status: "success" });
|
||||
return result;
|
||||
}
|
||||
catch (err) {
|
||||
span.setStatus({ status: "error", error: err });
|
||||
throw err;
|
||||
}
|
||||
finally {
|
||||
span.end();
|
||||
}
|
||||
}
|
||||
function withContext(context, callback, ...callbackArgs) {
|
||||
return getInstrumenter().withContext(context, callback, ...callbackArgs);
|
||||
}
|
||||
/**
|
||||
* Parses a traceparent header value into a span identifier.
|
||||
*
|
||||
* @param traceparentHeader - The traceparent header to parse.
|
||||
* @returns An implementation-specific identifier for the span.
|
||||
*/
|
||||
function parseTraceparentHeader(traceparentHeader) {
|
||||
return getInstrumenter().parseTraceparentHeader(traceparentHeader);
|
||||
}
|
||||
/**
|
||||
* Creates a set of request headers to propagate tracing information to a backend.
|
||||
*
|
||||
* @param tracingContext - The context containing the span to serialize.
|
||||
* @returns The set of headers to add to a request.
|
||||
*/
|
||||
function createRequestHeaders(tracingContext) {
|
||||
return getInstrumenter().createRequestHeaders(tracingContext);
|
||||
}
|
||||
return {
|
||||
startSpan,
|
||||
withSpan,
|
||||
withContext,
|
||||
parseTraceparentHeader,
|
||||
createRequestHeaders,
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=tracingClient.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/react-native/tracingClient.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/react-native/tracingClient.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
34
backend/node_modules/@azure/core-tracing/dist/react-native/tracingContext.d.ts
generated
vendored
Normal file
34
backend/node_modules/@azure/core-tracing/dist/react-native/tracingContext.d.ts
generated
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
import type { TracingContext, TracingSpan } from "./interfaces.js";
|
||||
/** @internal */
|
||||
export declare const knownContextKeys: {
|
||||
span: symbol;
|
||||
namespace: symbol;
|
||||
};
|
||||
/**
|
||||
* Creates a new {@link TracingContext} with the given options.
|
||||
* @param options - A set of known keys that may be set on the context.
|
||||
* @returns A new {@link TracingContext} with the given options.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export declare function createTracingContext(options?: CreateTracingContextOptions): TracingContext;
|
||||
/** @internal */
|
||||
export declare class TracingContextImpl implements TracingContext {
|
||||
private _contextMap;
|
||||
constructor(initialContext?: TracingContext);
|
||||
setValue(key: symbol, value: unknown): TracingContext;
|
||||
getValue(key: symbol): unknown;
|
||||
deleteValue(key: symbol): TracingContext;
|
||||
}
|
||||
/**
|
||||
* Represents a set of items that can be set when creating a new {@link TracingContext}.
|
||||
*/
|
||||
export interface CreateTracingContextOptions {
|
||||
/** The {@link parentContext} - the newly created context will contain all the values of the parent context unless overridden. */
|
||||
parentContext?: TracingContext;
|
||||
/** An initial span to set on the context. */
|
||||
span?: TracingSpan;
|
||||
/** The namespace to set on any child spans. */
|
||||
namespace?: string;
|
||||
}
|
||||
//# sourceMappingURL=tracingContext.d.ts.map
|
||||
48
backend/node_modules/@azure/core-tracing/dist/react-native/tracingContext.js
generated
vendored
Normal file
48
backend/node_modules/@azure/core-tracing/dist/react-native/tracingContext.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT License.
|
||||
/** @internal */
|
||||
export const knownContextKeys = {
|
||||
span: Symbol.for("@azure/core-tracing span"),
|
||||
namespace: Symbol.for("@azure/core-tracing namespace"),
|
||||
};
|
||||
/**
|
||||
* Creates a new {@link TracingContext} with the given options.
|
||||
* @param options - A set of known keys that may be set on the context.
|
||||
* @returns A new {@link TracingContext} with the given options.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export function createTracingContext(options = {}) {
|
||||
let context = new TracingContextImpl(options.parentContext);
|
||||
if (options.span) {
|
||||
context = context.setValue(knownContextKeys.span, options.span);
|
||||
}
|
||||
if (options.namespace) {
|
||||
context = context.setValue(knownContextKeys.namespace, options.namespace);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
/** @internal */
|
||||
export class TracingContextImpl {
|
||||
_contextMap;
|
||||
constructor(initialContext) {
|
||||
this._contextMap =
|
||||
initialContext instanceof TracingContextImpl
|
||||
? new Map(initialContext._contextMap)
|
||||
: new Map();
|
||||
}
|
||||
setValue(key, value) {
|
||||
const newContext = new TracingContextImpl(this);
|
||||
newContext._contextMap.set(key, value);
|
||||
return newContext;
|
||||
}
|
||||
getValue(key) {
|
||||
return this._contextMap.get(key);
|
||||
}
|
||||
deleteValue(key) {
|
||||
const newContext = new TracingContextImpl(this);
|
||||
newContext._contextMap.delete(key);
|
||||
return newContext;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=tracingContext.js.map
|
||||
1
backend/node_modules/@azure/core-tracing/dist/react-native/tracingContext.js.map
generated
vendored
Normal file
1
backend/node_modules/@azure/core-tracing/dist/react-native/tracingContext.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"tracingContext.js","sourceRoot":"","sources":["../../src/tracingContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,gBAAgB;AAChB,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,+BAA+B,CAAC;CACvD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAuC,EAAE;IAC5E,IAAI,OAAO,GAAmB,IAAI,kBAAkB,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5E,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5E,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,gBAAgB;AAChB,MAAM,OAAO,kBAAkB;IACrB,WAAW,CAAuB;IAC1C,YAAY,cAA+B;QACzC,IAAI,CAAC,WAAW;YACd,cAAc,YAAY,kBAAkB;gBAC1C,CAAC,CAAC,IAAI,GAAG,CAAkB,cAAc,CAAC,WAAW,CAAC;gBACtD,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,QAAQ,CAAC,GAAW,EAAE,KAAc;QAClC,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,QAAQ,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACnC,CAAC;IAED,WAAW,CAAC,GAAW;QACrB,MAAM,UAAU,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnC,OAAO,UAAU,CAAC;IACpB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TracingContext, TracingSpan } from \"./interfaces.js\";\n\n/** @internal */\nexport const knownContextKeys = {\n span: Symbol.for(\"@azure/core-tracing span\"),\n namespace: Symbol.for(\"@azure/core-tracing namespace\"),\n};\n\n/**\n * Creates a new {@link TracingContext} with the given options.\n * @param options - A set of known keys that may be set on the context.\n * @returns A new {@link TracingContext} with the given options.\n *\n * @internal\n */\nexport function createTracingContext(options: CreateTracingContextOptions = {}): TracingContext {\n let context: TracingContext = new TracingContextImpl(options.parentContext);\n if (options.span) {\n context = context.setValue(knownContextKeys.span, options.span);\n }\n if (options.namespace) {\n context = context.setValue(knownContextKeys.namespace, options.namespace);\n }\n return context;\n}\n\n/** @internal */\nexport class TracingContextImpl implements TracingContext {\n private _contextMap: Map<symbol, unknown>;\n constructor(initialContext?: TracingContext) {\n this._contextMap =\n initialContext instanceof TracingContextImpl\n ? new Map<symbol, unknown>(initialContext._contextMap)\n : new Map();\n }\n\n setValue(key: symbol, value: unknown): TracingContext {\n const newContext = new TracingContextImpl(this);\n newContext._contextMap.set(key, value);\n return newContext;\n }\n\n getValue(key: symbol): unknown {\n return this._contextMap.get(key);\n }\n\n deleteValue(key: symbol): TracingContext {\n const newContext = new TracingContextImpl(this);\n newContext._contextMap.delete(key);\n return newContext;\n }\n}\n\n/**\n * Represents a set of items that can be set when creating a new {@link TracingContext}.\n */\nexport interface CreateTracingContextOptions {\n /** The {@link parentContext} - the newly created context will contain all the values of the parent context unless overridden. */\n parentContext?: TracingContext;\n /** An initial span to set on the context. */\n span?: TracingSpan;\n /** The namespace to set on any child spans. */\n namespace?: string;\n}\n"]}
|
||||
112
backend/node_modules/@azure/core-tracing/package.json
generated
vendored
Normal file
112
backend/node_modules/@azure/core-tracing/package.json
generated
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
{
|
||||
"name": "@azure/core-tracing",
|
||||
"version": "1.3.1",
|
||||
"description": "Provides low-level interfaces and helper methods for tracing in Azure SDK",
|
||||
"sdk-type": "client",
|
||||
"type": "module",
|
||||
"main": "./dist/commonjs/index.js",
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"browser": "./dist/browser/index.js",
|
||||
"react-native": "./dist/react-native/index.js",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"browser": {
|
||||
"types": "./dist/browser/index.d.ts",
|
||||
"default": "./dist/browser/index.js"
|
||||
},
|
||||
"react-native": {
|
||||
"types": "./dist/react-native/index.d.ts",
|
||||
"default": "./dist/react-native/index.js"
|
||||
},
|
||||
"import": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/commonjs/index.d.ts",
|
||||
"default": "./dist/commonjs/index.js"
|
||||
}
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/",
|
||||
"!dist/**/*.d.*ts.map",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"repository": "github:Azure/azure-sdk-for-js",
|
||||
"keywords": [
|
||||
"azure",
|
||||
"tracing",
|
||||
"cloud"
|
||||
],
|
||||
"author": "Microsoft Corporation",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-tracing/README.md",
|
||||
"sideEffects": false,
|
||||
"dependencies": {
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.19.0",
|
||||
"@vitest/browser": "^3.2.3",
|
||||
"@vitest/coverage-istanbul": "^3.2.3",
|
||||
"eslint": "^9.33.0",
|
||||
"playwright": "^1.50.1",
|
||||
"typescript": "~5.8.3",
|
||||
"vitest": "^3.2.3",
|
||||
"@azure/core-auth": "^1.10.1",
|
||||
"@azure/dev-tool": "^1.0.0",
|
||||
"@azure/eslint-plugin-azure-sdk": "^3.0.0"
|
||||
},
|
||||
"//metadata": {
|
||||
"sampleConfiguration": {
|
||||
"disableDocsMs": true,
|
||||
"productName": "Azure SDK Core",
|
||||
"productSlugs": [
|
||||
"azure"
|
||||
]
|
||||
},
|
||||
"migrationDate": "2023-03-08T18:36:03.000Z"
|
||||
},
|
||||
"tshy": {
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": "./src/index.ts"
|
||||
},
|
||||
"dialects": [
|
||||
"esm",
|
||||
"commonjs"
|
||||
],
|
||||
"esmDialects": [
|
||||
"browser",
|
||||
"react-native"
|
||||
],
|
||||
"selfLink": false,
|
||||
"project": "../../../tsconfig.src.build.json"
|
||||
},
|
||||
"module": "./dist/esm/index.js",
|
||||
"scripts": {
|
||||
"build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
|
||||
"build:samples": "tsc -p tsconfig.samples.json",
|
||||
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
|
||||
"clean": "rimraf --glob dist dist-* temp types *.tgz *.log",
|
||||
"execute:samples": "echo skipped",
|
||||
"extract-api": "dev-tool run build-package && dev-tool run extract-api",
|
||||
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"samples-dev/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\"",
|
||||
"lint": "eslint package.json src test",
|
||||
"lint:fix": "eslint package.json src test --fix --fix-type [problem,suggestion]",
|
||||
"pack": "pnpm pack 2>&1",
|
||||
"test": "npm run test:node && npm run test:browser",
|
||||
"test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser",
|
||||
"test:node": "dev-tool run build-test --no-browser-test && dev-tool run test:vitest --no-test-proxy",
|
||||
"update-snippets": "dev-tool run update-snippets"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user