How to use the @azure/core-tracing.CanonicalCode.UNKNOWN function in @azure/core-tracing

To help you get started, we’ve selected a few @azure/core-tracing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-js / sdk / storage / storage-BlobLeaseClient.ts View on Github external
public async releaseLease(options: LeaseOperationOptions = {}): Promise {
    const { span, spanOptions } = createSpan(
      "BlobLeaseClient-releaseLease",
      options.tracingOptions
    );
    try {
      return await this._containerOrBlobOperation.releaseLease(this._leaseId, {
        abortSignal: options.abortSignal,
        modifiedAccessConditions: options.conditions,
        spanOptions
      });
    } catch (e) {
      span.setStatus({
        code: CanonicalCode.UNKNOWN,
        message: e.message
      });
      throw e;
    } finally {
      span.end();
    }
  }
github Azure / azure-sdk-for-js / sdk / identity / identity / src / credentials / authorizationCodeCredential.ts View on Github external
"Content-Type": "application/x-www-form-urlencoded"
          },
          abortSignal: options && options.abortSignal,
          spanOptions: newOptions.spanOptions
        });

        tokenResponse = await this.identityClient.sendTokenRequest(webResource);
      }

      this.lastTokenResponse = tokenResponse;
      return (tokenResponse && tokenResponse.accessToken) || null;
    } catch (err) {
      const code =
        err.name === AuthenticationErrorName
          ? CanonicalCode.UNAUTHENTICATED
          : CanonicalCode.UNKNOWN;
      span.setStatus({
        code,
        message: err.message
      });
      throw err;
    } finally {
      span.end();
    }
  }
}

@azure/core-tracing

Provides low-level interfaces and helper methods for tracing in Azure SDK

MIT
Latest version published 2 months ago

Package Health Score

84 / 100
Full package analysis