Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function createSpan(
operationName: string,
tracingOptions: OperationTracingOptions = {}
): { span: Span; spanOptions: SpanOptions } {
const tracer = getTracer();
const spanOptions: SpanOptions = {
...tracingOptions.spanOptions,
kind: SpanKind.INTERNAL
};
const span = tracer.startSpan(`Azure.Storage.File.${operationName}`, spanOptions);
let newOptions = tracingOptions.spanOptions || {};
if (span.isRecording()) {
newOptions = {
...tracingOptions,
parent: span
};
}
return {
span,
spanOptions: newOptions
};
export function createSpan(
operationName: string,
tracingOptions: OperationTracingOptions = {}
): { span: Span; spanOptions: SpanOptions } {
const tracer = getTracer();
const spanOptions: SpanOptions = {
...tracingOptions.spanOptions,
kind: SpanKind.INTERNAL
};
const span = tracer.startSpan(`Azure.Storage.DataLake.${operationName}`, spanOptions);
let newOptions = tracingOptions.spanOptions || {};
if (span.isRecording()) {
newOptions = {
...tracingOptions,
parent: span
};
}
return {
span,
spanOptions: newOptions
};
export function createSpan(
operationName: string,
tracingOptions: OperationTracingOptions = {}
): { span: Span; spanOptions: SpanOptions } {
const tracer = getTracer();
const spanOptions: SpanOptions = {
...tracingOptions.spanOptions,
kind: SpanKind.INTERNAL
};
const span = tracer.startSpan(`Azure.Storage.Queue.${operationName}`, spanOptions);
let newOptions = tracingOptions.spanOptions || {};
if (span.isRecording()) {
newOptions = {
...tracingOptions,
parent: span
};
}
return {
span,
spanOptions: newOptions
};
export function createSpan(
operationName: string,
options: GetTokenOptions = {}
): { span: Span; options: GetTokenOptions } {
const tracer = getTracer();
const tracingOptions = {
spanOptions: {},
...options.tracingOptions
};
tracingOptions.spanOptions = {
...tracingOptions.spanOptions,
kind: SpanKind.INTERNAL
};
const span = tracer.startSpan(`Azure.Identity.${operationName}`, tracingOptions.spanOptions);
let newOptions = options;
if (span.isRecording()) {
newOptions = {
...options,
tracingOptions: {
...tracingOptions,
spanOptions: {
...tracingOptions.spanOptions,
parent: span
}
}
};
export function createSpan(
operationName: string,
tracingOptions: OperationTracingOptions = {}
): { span: Span; spanOptions: SpanOptions } {
const tracer = getTracer();
const spanOptions: SpanOptions = {
...tracingOptions.spanOptions,
kind: SpanKind.INTERNAL
};
const span = tracer.startSpan(`Azure.Storage.Blob.${operationName}`, spanOptions);
let newOptions = tracingOptions.spanOptions || {};
if (span.isRecording()) {
newOptions = {
...tracingOptions,
parent: span
};
}
return {
span,
spanOptions: newOptions
};
private createSpan(options: T, operationName: keyof TClient) {
const span = getTracer().startSpan(`${this.baseOperationName}.${operationName}`, {
...options.spanOptions,
kind: SpanKind.INTERNAL
});
let newOptions = options;
if (span.isRecording()) {
newOptions = Spanner.addParentToOptions(options, span);
}
return { span, newOptions };
}