autotel-hono 0.4.50 → 0.4.51

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/dist/index.cjs CHANGED
@@ -102,7 +102,7 @@ function otel(userConfig = {}) {
102
102
  const name = rawName.toLowerCase();
103
103
  if (config.requestHeaderSet.has(name)) deferredRequestHeaderAttributes[(0, autotel.httpRequestHeaderAttribute)(name)] = typeof value === "string" ? value : value[0] ?? "";
104
104
  }
105
- const finalize = (span, error) => {
105
+ const finalize = (span, cause) => {
106
106
  try {
107
107
  const status = c.res.status;
108
108
  if (span) {
@@ -112,9 +112,9 @@ function otel(userConfig = {}) {
112
112
  }
113
113
  span.setAttribute(autotel.HTTPAttributes.responseStatusCode, status);
114
114
  if (status >= 500) span.setStatus({ code: autotel.SpanStatusCode.ERROR });
115
- if (error) {
115
+ if (cause) {
116
116
  try {
117
- span.recordException(error);
117
+ span.recordException(cause);
118
118
  } catch {}
119
119
  span.setStatus({ code: autotel.SpanStatusCode.ERROR });
120
120
  }
package/dist/index.js CHANGED
@@ -101,7 +101,7 @@ function otel(userConfig = {}) {
101
101
  const name = rawName.toLowerCase();
102
102
  if (config.requestHeaderSet.has(name)) deferredRequestHeaderAttributes[httpRequestHeaderAttribute(name)] = typeof value === "string" ? value : value[0] ?? "";
103
103
  }
104
- const finalize = (span, error) => {
104
+ const finalize = (span, cause) => {
105
105
  try {
106
106
  const status = c.res.status;
107
107
  if (span) {
@@ -111,9 +111,9 @@ function otel(userConfig = {}) {
111
111
  }
112
112
  span.setAttribute(HTTPAttributes.responseStatusCode, status);
113
113
  if (status >= 500) span.setStatus({ code: SpanStatusCode.ERROR });
114
- if (error) {
114
+ if (cause) {
115
115
  try {
116
- span.recordException(error);
116
+ span.recordException(cause);
117
117
  } catch {}
118
118
  span.setStatus({ code: SpanStatusCode.ERROR });
119
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel-hono",
3
- "version": "0.4.50",
3
+ "version": "0.4.51",
4
4
  "description": "OpenTelemetry Hono middleware powered by autotel",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -19,8 +19,8 @@
19
19
  "README.md"
20
20
  ],
21
21
  "dependencies": {
22
- "autotel": "6.5.0",
23
- "autotel-adapters": "2.0.8"
22
+ "autotel": "7.0.0",
23
+ "autotel-adapters": "2.0.9"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "hono": ">=4.12.31"