@azure/monitor-opentelemetry
Version:
Azure Monitor OpenTelemetry (Node.js)
34 lines • 1.47 kB
JavaScript
;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.QuickpulseClient = void 0;
const index_js_1 = require("./api/index.js");
const operations_js_1 = require("./api/operations.js");
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 = (0, index_js_1.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 (0, operations_js_1.publish)(this._client, ikey, options);
}
/** Determine whether there is any subscription to the metrics and documents. */
isSubscribed(ikey, options = { requestOptions: {} }) {
return (0, operations_js_1.isSubscribed)(this._client, ikey, options);
}
}
exports.QuickpulseClient = QuickpulseClient;
//# sourceMappingURL=quickpulseClient.js.map