@moostjs/otel 0.4.16 → 0.4.17

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
@@ -127,6 +127,10 @@ function withSpan(span, cb, postProcess) {
127
127
  const finalizeSpan = (e, r) => {
128
128
  if (e) {
129
129
  _span.recordException(e);
130
+ _span.setStatus({
131
+ code: api.SpanStatusCode.ERROR,
132
+ message: e.message || 'Unknown Error',
133
+ });
130
134
  }
131
135
  if (postProcess) {
132
136
  postProcess(_span, e, r);
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { trace, context, metrics, SpanKind } from '@opentelemetry/api';
1
+ import { trace, context, metrics, SpanStatusCode, SpanKind } from '@opentelemetry/api';
2
2
  import { useAsyncEventContext as useAsyncEventContext$1, ContextInjector, useControllerContext, getConstructor as getConstructor$2, replaceContextInjector } from 'moost';
3
3
  import { randomUUID } from 'crypto';
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
@@ -125,6 +125,10 @@ function withSpan(span, cb, postProcess) {
125
125
  const finalizeSpan = (e, r) => {
126
126
  if (e) {
127
127
  _span.recordException(e);
128
+ _span.setStatus({
129
+ code: SpanStatusCode.ERROR,
130
+ message: e.message || 'Unknown Error',
131
+ });
128
132
  }
129
133
  if (postProcess) {
130
134
  postProcess(_span, e, r);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moostjs/otel",
3
- "version": "0.4.16",
3
+ "version": "0.4.17",
4
4
  "description": "@moostjs/otel",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -39,6 +39,6 @@
39
39
  "dependencies": {
40
40
  "@opentelemetry/api": "^1.9.0",
41
41
  "@opentelemetry/sdk-trace-base": "^1.25.1",
42
- "moost": "0.4.16"
42
+ "moost": "0.4.17"
43
43
  }
44
44
  }