@aurox/telemetry
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -5,1 +5,2 @@ export * from './service'; | ||
export * from './logger'; | ||
export * as instrument from './instrument'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.instrument = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -8,2 +9,3 @@ (0, tslib_1.__exportStar)(require("./service"), exports); | ||
(0, tslib_1.__exportStar)(require("./logger"), exports); | ||
exports.instrument = (0, tslib_1.__importStar)(require("./instrument")); | ||
//# sourceMappingURL=index.js.map |
export * from './Logger'; | ||
export * from './setup'; | ||
export * from './utils'; | ||
export * as instrument from './instrument'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.instrument = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -8,3 +7,2 @@ (0, tslib_1.__exportStar)(require("./Logger"), exports); | ||
(0, tslib_1.__exportStar)(require("./utils"), exports); | ||
exports.instrument = (0, tslib_1.__importStar)(require("./instrument")); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import client from 'prom-client'; | ||
import client, { Registry } from 'prom-client'; | ||
import { TelemetryService } from '../service'; | ||
@@ -7,5 +7,6 @@ export interface SetupMetricsOptions { | ||
} | ||
export declare function setupMetrics(service: TelemetryService, options?: SetupMetricsOptions): { | ||
export interface Metrics { | ||
client: typeof client; | ||
registry: client.Registry; | ||
}; | ||
registry: Registry; | ||
} | ||
export declare function setupMetrics(service: TelemetryService, options?: SetupMetricsOptions): Metrics; |
@@ -10,5 +10,4 @@ "use strict"; | ||
function listen(port) { | ||
server.listen(port ?? config_1.servicePort, () => { | ||
console.info(`Telemetry service initialized on port ${port}`); | ||
}); | ||
const targetPort = port ?? config_1.servicePort; | ||
server.listen(targetPort, () => console.info(`Telemetry service initialized on port ${targetPort}`)); | ||
} | ||
@@ -15,0 +14,0 @@ return { |
{ | ||
"name": "@aurox/telemetry", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "A universal solution for logging, tracing, metrics, health-checks and more", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,1 +5,2 @@ export * from './service'; | ||
export * from './logger'; | ||
export * as instrument from './instrument'; |
export * from './Logger'; | ||
export * from './setup'; | ||
export * from './utils'; | ||
export * as instrument from './instrument'; |
@@ -1,2 +0,2 @@ | ||
import client, { collectDefaultMetrics } from 'prom-client'; | ||
import client, { collectDefaultMetrics, Registry } from 'prom-client'; | ||
import Router from '@koa/router'; | ||
@@ -12,3 +12,8 @@ | ||
export function setupMetrics(service: TelemetryService, options?: SetupMetricsOptions) { | ||
export interface Metrics { | ||
client: typeof client; | ||
registry: Registry; | ||
} | ||
export function setupMetrics(service: TelemetryService, options?: SetupMetricsOptions): Metrics { | ||
const path = options?.path ?? '/metrics'; | ||
@@ -15,0 +20,0 @@ |
@@ -21,5 +21,5 @@ import Koa, { DefaultState, DefaultContext } from 'koa'; | ||
function listen(port?: number): void { | ||
server.listen(port ?? servicePort, () => { | ||
console.info(`Telemetry service initialized on port ${port}`); | ||
}); | ||
const targetPort = port ?? servicePort; | ||
server.listen(targetPort, () => console.info(`Telemetry service initialized on port ${targetPort}`)); | ||
} | ||
@@ -26,0 +26,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
89713
90
1586