• Setup a prometheus metric monitoring endpoint using an express application. By default, standard nodejs process metrics are collected. All gathered metrics are exported via a '/metrics' path. If custom metrics are required, they can be defined on a separate metric-registry and passed in as arguments.

    Parameters

    • config: ValueObject<{
          environment: (() => "test" | "development" | "production");
          fullDevLogs: (() => boolean);
          healthEndpointPort: (() => number);
          isDev: (() => boolean);
          isProd: (() => boolean);
          logLevel: (() => "" | "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE");
          logMaskKeywords: (() => string[]);
          logMaskMaxDepth: (() => number);
          secureLoggingMode: (() => MaskMode);
          serviceId: (() => string);
      }> & ValueObject<{
          metricsEndpointPort: (() => number);
      }>

      A service config object containing service-id & environment values to be used as metric labels.

    • monitoringOptions: IMonitoringOptions = {}

      An object containing monitoring options.

    • Optional logger: Logger

      A logger object to use for output generated inside the middleware.

    Returns Registry<"text/plain; version=0.0.4; charset=utf-8">

    A instance of Registry. This can be used to further configure necessary metrics.

Generated using TypeDoc