How to use the matrix-appservice-bridge.PrometheusMetrics function in matrix-appservice-bridge

To help you get started, we’ve selected a few matrix-appservice-bridge 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 matrix-org / matrix-bifrost / src / Metrics.ts View on Github external
public static init(bridge: any) {
        this.metrics = new PrometheusMetrics();
        this.metrics.registerMatrixSdkMetrics();
        this.metrics.registerBridgeGauges(() => this.bridgeGauges);
        this.metrics.addAppServicePath(bridge);
        this.remoteCallCounter = this.metrics.addCounter({
            name: "remote_api_calls",
            help: "Count of the number of remote API calls made",
            labels: ["method"],
        });
        this.matrixRequest = this.metrics.addTimer({
            name: "matrix_request_seconds",
            help: "Histogram of processing durations of received Matrix messages",
            labels: ["outcome"],
        });
        this.remoteRequest = this.metrics.addTimer({
            name: "remote_request_seconds",
            help: "Histogram of processing durations of received remote messages",
github Half-Shot / matrix-appservice-discord / src / metrics.ts View on Github external
public init(bridge: Bridge) {
        this.metrics = new PrometheusMetrics();
        this.metrics.registerMatrixSdkMetrics();
        this.metrics.registerBridgeGauges(() => this.bridgeGauges);
        this.metrics.addAppServicePath(bridge);
        this.remoteCallCounter = this.metrics.addCounter({
            help: "Count of remote API calls made",
            labels: ["method"],
            name: "remote_api_calls",
        });
        this.storeCallCounter = this.metrics.addCounter({
            help: "Count of store function calls made",
            labels: ["method", "cached"],
            name: "store_calls",
        });
        this.presenceGauge = this.metrics.addGauge({
            help: "Count of users in the presence queue",
            labels: [],