autotel-hono 0.4.42 → 0.4.44
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 +4 -5
- package/skills/autotel-hono/SKILL.md +0 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autotel-hono",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.44",
|
|
4
4
|
"description": "OpenTelemetry Hono middleware powered by autotel",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist",
|
|
19
|
-
"README.md"
|
|
20
|
-
"skills"
|
|
19
|
+
"README.md"
|
|
21
20
|
],
|
|
22
21
|
"dependencies": {
|
|
23
|
-
"autotel": "
|
|
24
|
-
"autotel-adapters": "2.0.
|
|
22
|
+
"autotel": "6.1.0",
|
|
23
|
+
"autotel-adapters": "2.0.2"
|
|
25
24
|
},
|
|
26
25
|
"peerDependencies": {
|
|
27
26
|
"hono": ">=4.12.31"
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: autotel-hono
|
|
3
|
-
description: >
|
|
4
|
-
OpenTelemetry middleware for Hono. Add otel() middleware to trace HTTP requests with semantic attributes, capture headers, and track request metrics.
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# autotel-hono
|
|
8
|
-
|
|
9
|
-
OpenTelemetry Hono middleware. One middleware call instruments all HTTP requests.
|
|
10
|
-
|
|
11
|
-
## Setup
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
import { Hono } from 'hono';
|
|
15
|
-
import { otel } from 'autotel-hono';
|
|
16
|
-
|
|
17
|
-
const app = new Hono();
|
|
18
|
-
app.use(otel({ serviceName: 'my-api' }));
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Configuration
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
app.use(
|
|
25
|
-
otel({
|
|
26
|
-
serviceName: 'my-api',
|
|
27
|
-
captureRequestHeaders: ['x-request-id'],
|
|
28
|
-
captureResponseHeaders: ['x-response-time'],
|
|
29
|
-
captureActiveRequests: true,
|
|
30
|
-
captureRequestDuration: true,
|
|
31
|
-
spanNameFactory: (c) => `${c.req.method} ${c.req.routePath}`,
|
|
32
|
-
}),
|
|
33
|
-
);
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## What Gets Traced
|
|
37
|
-
|
|
38
|
-
- Every HTTP request gets a span with method, route, URL, status code
|
|
39
|
-
- Errors (5xx) are recorded as span exceptions
|
|
40
|
-
- Optional: request/response headers, active request count, duration histogram
|
|
41
|
-
|
|
42
|
-
## Common Mistakes
|
|
43
|
-
|
|
44
|
-
- Do NOT call `otel()` per-route: register once with `app.use(otel(...))`.
|
|
45
|
-
- Do NOT pass a tracer unless you need a custom one: the middleware creates one from the global provider.
|
|
46
|
-
- Header capture requires listing header names upfront in config, not at request time.
|