@contractspec/lib.observability 3.7.5 → 3.7.7

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.
@@ -1,4 +1,28 @@
1
1
  // @bun
2
+ // src/metrics/index.ts
3
+ import {
4
+ metrics
5
+ } from "@opentelemetry/api";
6
+ var DEFAULT_METER_NAME = "@contractspec/lib.observability";
7
+ function getMeter(name = DEFAULT_METER_NAME) {
8
+ return metrics.getMeter(name);
9
+ }
10
+ function createCounter(name, description, meterName) {
11
+ return getMeter(meterName).createCounter(name, { description });
12
+ }
13
+ function createUpDownCounter(name, description, meterName) {
14
+ return getMeter(meterName).createUpDownCounter(name, { description });
15
+ }
16
+ function createHistogram(name, description, meterName) {
17
+ return getMeter(meterName).createHistogram(name, { description });
18
+ }
19
+ var standardMetrics = {
20
+ httpRequests: createCounter("http_requests_total", "Total HTTP requests"),
21
+ httpDuration: createHistogram("http_request_duration_seconds", "HTTP request duration"),
22
+ operationErrors: createCounter("operation_errors_total", "Total operation errors"),
23
+ workflowDuration: createHistogram("workflow_duration_seconds", "Workflow execution duration")
24
+ };
25
+
2
26
  // src/tracing/core.ts
3
27
  import {
4
28
  SpanStatusCode,
@@ -68,30 +92,6 @@ async function traceModelSelection(fn, input) {
68
92
  return result;
69
93
  });
70
94
  }
71
- // src/metrics/index.ts
72
- import {
73
- metrics
74
- } from "@opentelemetry/api";
75
- var DEFAULT_METER_NAME = "@contractspec/lib.observability";
76
- function getMeter(name = DEFAULT_METER_NAME) {
77
- return metrics.getMeter(name);
78
- }
79
- function createCounter(name, description, meterName) {
80
- return getMeter(meterName).createCounter(name, { description });
81
- }
82
- function createUpDownCounter(name, description, meterName) {
83
- return getMeter(meterName).createUpDownCounter(name, { description });
84
- }
85
- function createHistogram(name, description, meterName) {
86
- return getMeter(meterName).createHistogram(name, { description });
87
- }
88
- var standardMetrics = {
89
- httpRequests: createCounter("http_requests_total", "Total HTTP requests"),
90
- httpDuration: createHistogram("http_request_duration_seconds", "HTTP request duration"),
91
- operationErrors: createCounter("operation_errors_total", "Total operation errors"),
92
- workflowDuration: createHistogram("workflow_duration_seconds", "Workflow execution duration")
93
- };
94
-
95
95
  // src/tracing/middleware.ts
96
96
  function createTracingMiddleware(options = {}) {
97
97
  return async (req, next) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.observability",
3
- "version": "3.7.5",
3
+ "version": "3.7.7",
4
4
  "description": "OpenTelemetry-based observability primitives",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -20,24 +20,24 @@
20
20
  "dev": "contractspec-bun-build dev",
21
21
  "clean": "rimraf dist .turbo",
22
22
  "lint": "bun lint:fix",
23
- "lint:fix": "eslint src --fix",
24
- "lint:check": "eslint src",
23
+ "lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
24
+ "lint:check": "biome check .",
25
25
  "test": "bun test --pass-with-no-tests",
26
26
  "prebuild": "contractspec-bun-build prebuild",
27
27
  "typecheck": "tsc --noEmit"
28
28
  },
29
29
  "dependencies": {
30
- "@contractspec/lib.lifecycle": "3.7.5",
31
- "@contractspec/lib.contracts-spec": "3.7.5",
32
- "@contractspec/lib.contracts-integrations": "3.7.5"
30
+ "@contractspec/lib.lifecycle": "3.7.7",
31
+ "@contractspec/lib.contracts-spec": "4.0.0",
32
+ "@contractspec/lib.contracts-integrations": "3.7.7"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@opentelemetry/api": "*"
36
36
  },
37
37
  "devDependencies": {
38
- "@contractspec/tool.typescript": "3.7.5",
38
+ "@contractspec/tool.typescript": "3.7.6",
39
39
  "typescript": "^5.9.3",
40
- "@contractspec/tool.bun": "3.7.5"
40
+ "@contractspec/tool.bun": "3.7.6"
41
41
  },
42
42
  "exports": {
43
43
  ".": {