Class AxiosPrometheusAbstract

Description

Axios-prometheus HTTP interface

Features:

  • Metrics of you HTTP requests out of the box

Example

import { container, Types } from '@biorate/inversion';
import { IConfig, Config } from '@biorate/config';
import { AxiosPrometheus } from '@biorate/axios-prometheus';

export class Google extends AxiosPrometheus {
public baseURL = this.config.get<string>('baseURL');
public url = '/';
public method = 'get';
public timeout = 1500;
}

container.bind(Types.Config).to(Config).inSingletonScope();

container.get<IConfig>(Types.Config).merge({
baseURL: 'https://google.com',
});

(async () => {
await Google.fetch();
})();

Hierarchy

Constructors

Properties

#client: AxiosInstance

Description

Axios client cache

baseURL: string
counter: Counter
histogram: Histogram
method: string
url: string
cache: WeakMap<typeof Axios, Axios> = ...

Description

Axios instance cache

mockFields: string[] = ...
mocks: WeakMap<typeof Axios, {
    value: boolean;
}> = ...

Type declaration

  • value: boolean

Description

Axios instance cache

Accessors

Methods

Generated using TypeDoc