Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/express-prometheus-middleware

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/express-prometheus-middleware - npm Package Compare versions

Comparing version 1.0.0 to 1.2.0

74

express-prometheus-middleware/index.d.ts

@@ -1,2 +0,2 @@

// Type definitions for express-prometheus-middleware 1.0
// Type definitions for express-prometheus-middleware 1.2
// Project: https://github.com/joao-fontenele/express-prometheus-middleware#readme

@@ -6,40 +6,46 @@ // Definitions by: Floris de Bijl <https://github.com/Fdebijl>

import express = require('express');
import express = require("express");
interface Labels {
route: string;
method: string;
status: string;
/** Custom labels */
[key: string]: string;
route: string;
method: string;
status: string;
/** Custom labels */
[key: string]: string;
}
interface UserOptions {
/** Url route that will expose the metrics for scraping. Defaults to '/metrics' */
metricsPath?: string;
/** Express app that will expose metrics endpoint, if an app is provided, use it, instead of instantiating a new one */
metricsApp?: express.Express;
/**
* Optional authentication predicate, the function should receive as argument, the req object and return truthy for sucessfull authentication, or falsy, otherwise.
* This option supports Promise results.
*/
authenticate?: ((req: express.Request) => boolean) | ((req: express.Request) => Promise<boolean>);
/** Whether or not to collect prom-client default metrics. These metrics are usefull for collecting saturation metrics, for example. Defaults to true */
collectDefaultMetrics?: boolean;
/**
* Whether or not to collect garbage collection metrics via module prometheus-gc-stats.
* Dependency prometheus-gc-stats is marked as optional, hence if this option is set to true but npm/yarn could not install the dependency,
* no garbage collection metric will be collected. Defaults to false.
*/
collectGCMetrics?: boolean;
/** Buckets for the request duration metrics (in milliseconds) histogram. */
requestDurationBuckets?: number[];
/** Optional, list of regexes to be used as argument to url-value-parser, this will cause extra route params, to be replaced with a #val placeholder. */
extraMasks?: RegExp[];
/** Optional prefix for the metrics name. By default, no prefix is added. */
prefix?: string;
/** Optional Array containing extra labels, used together with transformLabels */
customLabels?: string[];
/** Optional function(labels, req, res) adds to the labels object dynamic values for each label in customLabels */
transformLabels?: (labels: Labels, req: express.Request, res: express.Response) => void;
/** Url route that will expose the metrics for scraping. Defaults to '/metrics' */
metricsPath?: string;
/** Express app that will expose metrics endpoint, if an app is provided, use it, instead of instantiating a new one */
metricsApp?: express.Express;
/**
* Optional authentication predicate, the function should receive as argument, the req object and return truthy for sucessfull authentication, or falsy, otherwise.
* This option supports Promise results.
*/
authenticate?: ((req: express.Request) => boolean) | ((req: express.Request) => Promise<boolean>);
/** Whether or not to collect prom-client default metrics. These metrics are useful for collecting saturation metrics, for example. Defaults to true */
collectDefaultMetrics?: boolean;
/**
* Whether or not to collect garbage collection metrics via module prometheus-gc-stats.
* Dependency prometheus-gc-stats is marked as optional, hence if this option is set to true but npm/yarn could not install the dependency,
* no garbage collection metric will be collected. Defaults to false.
*/
collectGCMetrics?: boolean;
/** Buckets for the request duration metrics (in milliseconds) histogram. */
requestDurationBuckets?: number[];
/** Buckets for the request length metrics (in bytes) histogram. Defaults to [] */
requestLengthBuckets?: number[];
/** Buckets for the response length metrics (in bytes) histogram. Defaults to [] */
responseLengthBuckets?: number[];
/** Optional, list of regexes to be used as argument to url-value-parser, this will cause extra route params, to be replaced with a #val placeholder. */
extraMasks?: RegExp[];
/** Optional prefix for the metrics name. By default, no prefix is added. */
prefix?: string;
/** Optional Array containing extra labels, used together with transformLabels */
customLabels?: string[];
/** Optional function(labels, req, res) adds to the labels object dynamic values for each label in customLabels */
transformLabels?: (labels: Labels, req: express.Request, res: express.Response) => void;
/** Whether or not to normalize http status codes. Defaults to true */
normalizeStatus?: boolean;
}

@@ -46,0 +52,0 @@

{
"name": "@types/express-prometheus-middleware",
"version": "1.0.0",
"version": "1.2.0",
"description": "TypeScript definitions for express-prometheus-middleware",

@@ -24,4 +24,4 @@ "license": "MIT",

},
"typesPublisherContentHash": "a0916988c5a447ce1b888bf0bffc2f852fa2028812c4b2141e488540fd97ba8a",
"typeScriptVersion": "3.4"
"typesPublisherContentHash": "817003df2a0a04f6f4e95c96fe3e6b3afa06d2d3efb4bf1406ae9fb05c5bebb0",
"typeScriptVersion": "3.5"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Mon, 01 Feb 2021 19:29:49 GMT
* Last updated: Mon, 26 Apr 2021 09:31:19 GMT
* Dependencies: [@types/express](https://npmjs.com/package/@types/express)

@@ -14,0 +14,0 @@ * Global values: none

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc