@lucaapp/service-utils 1.27.0 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -170,7 +170,7 @@ options) => {
170
170
  const responseMap = buildResponseConfig(responseSchemas);
171
171
  registry.registerPath({
172
172
  method,
173
- path: prefixPath + path,
173
+ path: (prefixPath + path).replaceAll(/\:([^\:\/]+)/g, '{$1}'),
174
174
  summary,
175
175
  // description: summary,
176
176
  request: {
@@ -1 +1,2 @@
1
1
  export * from './metricsClient';
2
+ export * from './sequelize';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./metricsClient"), exports);
18
+ __exportStar(require("./sequelize"), exports);
@@ -0,0 +1,4 @@
1
+ import { metricsClient } from './metricsClient';
2
+ export declare const queryDurationSeconds: metricsClient.Histogram<string>;
3
+ export declare const queryDurationSecondsCount: metricsClient.Counter<string>;
4
+ export declare const slowQueryCount: metricsClient.Counter<string>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.slowQueryCount = exports.queryDurationSecondsCount = exports.queryDurationSeconds = void 0;
4
+ const metricsClient_1 = require("./metricsClient");
5
+ const labelNames = ['query'];
6
+ exports.queryDurationSeconds = new metricsClient_1.metricsClient.Histogram({
7
+ name: 'sequelize_query_duration_seconds',
8
+ help: 'A histogram of sequelize query duration in seconds',
9
+ buckets: [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10],
10
+ });
11
+ exports.queryDurationSecondsCount = new metricsClient_1.metricsClient.Counter({
12
+ name: 'sequelize_query_duration_seconds_count',
13
+ help: 'A counter for sequelize query duration in seconds ',
14
+ });
15
+ exports.slowQueryCount = new metricsClient_1.metricsClient.Counter({
16
+ name: 'sequelize_slow_query_count',
17
+ help: 'A counter for sequelize query with execution time greater than 1 second.',
18
+ labelNames,
19
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [