UNPKG

@azure/monitor-opentelemetry

Version:
30 lines 1.27 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { createQuickpulse, } from "./api/index.js"; import { publish, isSubscribed } from "./api/operations.js"; export class QuickpulseClient { _client; /** The pipeline used by this client to make requests */ pipeline; /** Live Metrics REST APIs. */ constructor(credential, options = {}) { const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-client` : `azsdk-js-client`; this._client = createQuickpulse(credential, { ...options, userAgentOptions: { userAgentPrefix }, }); this.pipeline = this._client.pipeline; } /** Publish live metrics to the Live Metrics service when there is an active subscription to the metrics. */ publish(ikey, options = { requestOptions: {} }) { return publish(this._client, ikey, options); } /** Determine whether there is any subscription to the metrics and documents. */ isSubscribed(ikey, options = { requestOptions: {} }) { return isSubscribed(this._client, ikey, options); } } //# sourceMappingURL=quickpulseClient.js.map