@hatchet-dev/typescript-sdk 1.17.1 → 1.17.2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "1.17.1",
3
+ "version": "1.17.2",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -1,3 +1,4 @@
1
+ import { TaskStats } from '../../../clients/rest/generated/data-contracts';
1
2
  import { HatchetClient } from '../client';
2
3
  export type TaskStatusMetrics = {
3
4
  cancelled: number;
@@ -26,4 +27,14 @@ export declare class MetricsClient {
26
27
  * @returns The queue metrics for the current tenant.
27
28
  */
28
29
  getQueueMetrics(opts?: Parameters<typeof this.api.tenantGetStepRunQueueMetrics>[1]): Promise<import("../../../clients/rest/generated/data-contracts").TenantStepRunQueueMetrics>;
30
+ /**
31
+ * Scrape Prometheus metrics for the tenant.
32
+ * @returns The metrics in Prometheus text format.
33
+ */
34
+ scrapePrometheusMetrics(): Promise<string>;
35
+ /**
36
+ * Get task statistics for the tenant.
37
+ * @returns A record mapping task names to their statistics.
38
+ */
39
+ getTaskStats(): Promise<TaskStats>;
29
40
  }
@@ -44,5 +44,25 @@ class MetricsClient {
44
44
  return data;
45
45
  });
46
46
  }
47
+ /**
48
+ * Scrape Prometheus metrics for the tenant.
49
+ * @returns The metrics in Prometheus text format.
50
+ */
51
+ scrapePrometheusMetrics() {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const { data } = yield this.api.tenantGetPrometheusMetrics(this.tenantId);
54
+ return data;
55
+ });
56
+ }
57
+ /**
58
+ * Get task statistics for the tenant.
59
+ * @returns A record mapping task names to their statistics.
60
+ */
61
+ getTaskStats() {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const { data } = yield this.api.tenantGetTaskStats(this.tenantId);
64
+ return data;
65
+ });
66
+ }
47
67
  }
48
68
  exports.MetricsClient = MetricsClient;
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const HATCHET_VERSION = "1.17.1";
1
+ export declare const HATCHET_VERSION = "1.17.2";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HATCHET_VERSION = void 0;
4
- exports.HATCHET_VERSION = '1.17.1';
4
+ exports.HATCHET_VERSION = '1.17.2';