Skip to content

Latest commit

 

History

History
425 lines (249 loc) · 25.3 KB

CHANGELOG.md

File metadata and controls

425 lines (249 loc) · 25.3 KB

@promster/hapi

14.0.0

Patch Changes

13.0.0

Major Changes

  • #1175 2da8d99 Thanks @tdeekens! - Remove support for Node.js v18

    We didn't adjust functionality to remove support but changed the engines requirement.

Patch Changes

12.1.0

Minor Changes

Patch Changes

12.0.0

Major Changes

Minor Changes

Patch Changes

10.0.1

Patch Changes

10.0.0

Major Changes

  • #1099 c3fbd90 Thanks @tdeekens! - Allow customization of individual metrics.

    Previously we only allowed customizing a all histogram and percentile based metrics once with a buckets and percentiles option. This is too restrictive in cases in which you need to customize metrics individually.

    As a result you can now pass metricBuckets and metricPercentiles as options. Both of which are a Record<string, number[]>. The key needs to match a an existing metric type.

    This is a more elaborate example:

    const middleware = createMiddleware({
      app,
      options: {
        metricBuckets: {
          httpRequestContentLengthInBytes: [
            100000, 200000, 500000, 1000000, 1500000, 2000000, 3000000, 5000000,
            10000000,
          ],
          httpRequestDurationInSeconds: [
            0.05, 0.1, 0.3, 0.5, 0.8, 1, 1.5, 2, 3, 10,
          ],
        },
        metricPercentiles: {
          httpRequestDurationPerPercentileInSeconds: [0.5, 0.9, 0.95, 0.98, 0.99],
          httpResponseContentLengthInBytes: [
            100000, 200000, 500000, 1000000, 1500000, 2000000, 3000000, 5000000,
            10000000,
          ],
        },
      },
    });

    If you used buckets or percentiles before you migrate the values into the structure above.

Minor Changes

  • #1096 3ce4835 Thanks @tdeekens! - Restructure TypeScript and improve types of skip-fn

    Previously the skip function received generics to pass the request and response type. These are not needed any more. The function exported from the respective package is now typed to it.

  • #1103 0476e91 Thanks @tdeekens! - Add support for generics to skip function.

    The skip function now supports generics for cases in which you have extended the request and response type in your application. The generics default to each framework's request and response type. If you need to overwrite this pass the generics as in skip<MyRequestType, MyResponseType>(request, response).

Patch Changes

9.0.0

Major Changes

  • #1088 7cfd21c Thanks @tdeekens! - Breaking droping support for Node.js v14

  • #1087 2e848c1 Thanks @roumigus! - The up metric of each server integrating @promster has been renamed to nodejs_up. This is to avoid a collision with the existing up metric Prometheus uses.

    You can still rename this metric to anything you prefer when condfigurating @promster/express for instance like this:

    const prometheusMetricsMiddleware = createPrometheusMetricsMiddleware({
      options: {
        metricNames: {
          up: ["service_name_up"],
        },
      },
    });

Patch Changes

8.0.6

Patch Changes

8.0.5

Patch Changes

8.0.4

Patch Changes

8.0.3

Patch Changes

8.0.2

Patch Changes

8.0.1

Patch Changes

  • #791 7f44d2e Thanks @tdeekens! - Refactor to use process.hrtime.bigint() over process.hrtime().

    The Node.js documentation lists process.hrtime([time]) as a legacy feature. It is no longer recommended for use, and should be avoided. As such it is recommended to use process.hrtime.bigint() which works slightly different.

    This change is backwards compatible. A new timing module was added to @promster/metrics which encapsulates timings so you never have to worry about the details.

    import { getRequestRecorder } = require('@promster/express');
    +import { timing } = require('@promster/express');
    
    +const requestTiming = timing.start();
    -const requestTiming = process.hrtime();
    
    recordRequest(requestTiming);

    We recommend to change all explicit calls to process.hrtime() with calls to timing.start() over time. The recordRequest function will continue to accept a [number, number] as the return of process.hrtime() so you can change code as you work with it.

  • Updated dependencies [7f44d2e]:

8.0.0

Major Changes

  • #778 e5658c7 Thanks @tdeekens! - This major change removes the support for the accurancies option. Historically, promster first supported milliseconds. Then learning that seconds is the default time interval in the Prometheus community. The accuracies option was added to enable a soft migration from milliseconds to seconds not to always support both time intervals.

    In case you haven't migrated your metrics to seconds and don't want to loose data we recommend to have the same metric with two names using the metricNames option ending in *_seconds and *_milliseconds. This way you only need to change the time interval in e.g. Grafana when hitting the time when the library was updated. Then migrate all dashboards and recording rules and eventually remove the *_milliseconds metricName option again.

    If you would like to read more about the reasoning of this decision head here.

Minor Changes

  • #771 dfc14a3 Thanks @tdeekens! - Allow passing a disableGcMetrics boolean option to disable Garbage Collection metrics.

Patch Changes

  • #785 c619be8 Thanks @tdeekens! - Refactor all tests to integration tests setting up two servers. One for metric exposure and the other to trigger metrics.
  • #772 402c8c0 Thanks @tdeekens! - Refactor to split metric types into gcMetrics and httpMetrics to empower future metric types.
  • #778 e5658c7 Thanks @tdeekens! - Fixes that not always a { req, res } object was passed to all normalizers in all plugins by making the typing more explicit.

7.0.0

Major Changes

  • #758 f02e6fe Thanks @tdeekens! - We droped support for Node.js < 14 via the engines field of the respective package.json files.

    We didn't make any changes to our code to prevent e.g. Node.js v9 to work but will not claim to officially support it any longer.

Patch Changes

6.1.3

Patch Changes

6.1.2

Patch Changes

6.1.1

Patch Changes

6.1.0

Minor Changes

  • #705 e2a1595 Thanks @tdeekens! - Add content length metric for both requests and responses. Both are recorded as Prometheus histograms under the name http_request_content_length_bytes and http_response_content_length_bytes.

Patch Changes

6.0.3

Patch Changes

6.0.2

Patch Changes

6.0.1

Patch Changes

6.0.0

Major Changes

  • 0eb64ca #529 Thanks @tdeekens! - # Introduction

    refactor: to use preconstruct for building

    Prior TypeScript was used to build bundles. In all this should not affect consumers of this library. Under the hood preconstruct uses rollup and babel which is now instructed to build for Node.js v12 using the preset-env preset.

    Breaking Change

    This release can potentially be breaking for you. We want to respect semantic versioning and follow it strictly.

    While migrating to preconstruct the version exports had to be removed as preconstruct's rollup will not resolve them. If you relied on this value you should either load the package.json of each module yourself or drop the usage.

    - const { version } = require('@promster/server');
    + const { version } = require('@promster/server/package.json');

Patch Changes

5.0.1

Patch Changes

5.0.0

Major Changes

  • 56fe635 #473 Thanks @tdeekens! - breaking(hapi): to bump required node to v12

    The @promster/hapi package now requires at least Node.js v12. This is rooted in the @hapi/hapi package being used which were introduced in 18.2.0.

Patch Changes

4.2.1

Patch Changes

4.2.0

Minor Changes

  • 68a8aaf #440 Thanks @todd! - Use correct status code when Hapi response is a Boom object

4.1.11

Patch Changes

  • 79bbda4 #373 Thanks @iiroj! - @promster/hapi decorator fix

    We had a breaking change sneak in. The decorator of promster of exposing the Prometheus instance was changed from a property to a function returning the property. This reverts that change.

4.1.10

Patch Changes