UNPKG

@azure/monitor-opentelemetry

Version:
23 lines 1.17 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { logger } from "../logger.js"; import { getClient } from "@azure-rest/core-client"; /** Live Metrics REST APIs. */ export function createQuickpulse(credential, options = {}) { const endpointUrl = options.endpoint ?? "https://global.livediagnostics.monitor.azure.com"; const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; const userAgentInfo = `azsdk-js-livemetrics/1.0.0-beta.1`; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` : `azsdk-js-api ${userAgentInfo}`; const { apiVersion: _, ...updatedOptions } = { ...options, userAgentOptions: { userAgentPrefix }, loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, credentials: { scopes: options.credentials?.scopes ?? ["https://monitor.azure.com/.default"] }, }; const clientContext = getClient(endpointUrl, credential, updatedOptions); const apiVersion = options.apiVersion; return { ...clientContext, apiVersion }; } //# sourceMappingURL=quickpulseContext.js.map