|
1 | | -import { context as api_context, trace, SpanOptions, SpanKind, Exception, SpanStatusCode } from '@opentelemetry/api' |
| 1 | +import { context as api_context, Exception, SpanKind, SpanOptions, SpanStatusCode, trace } from '@opentelemetry/api' |
2 | 2 | import { SemanticAttributes } from '@opentelemetry/semantic-conventions' |
| 3 | +import { Initialiser, setConfig } from '../config.js' |
| 4 | +import { DOConstructorTrigger } from '../types.js' |
3 | 5 | import { passthroughGet, unwrap, wrap } from '../wrap.js' |
| 6 | +import { instrumentStorage } from './do-storage.js' |
| 7 | +import { instrumentEnv } from './env.js' |
4 | 8 | import { |
5 | | - getParentContextFromHeaders, |
6 | 9 | gatherIncomingCfAttributes, |
7 | 10 | gatherRequestAttributes, |
8 | 11 | gatherResponseAttributes, |
| 12 | + getParentContextFromHeaders, |
9 | 13 | instrumentClientFetch, |
10 | 14 | } from './fetch.js' |
11 | | -import { instrumentEnv } from './env.js' |
12 | | -import { Initialiser, setConfig } from '../config.js' |
13 | | -import { instrumentStorage } from './do-storage.js' |
14 | | -import { DOConstructorTrigger } from '../types.js' |
15 | 15 |
|
16 | 16 | import { DurableObject as DurableObjectClass } from 'cloudflare:workers' |
17 | 17 |
|
@@ -217,8 +217,8 @@ function instrumentDurableObject( |
217 | 217 | } else { |
218 | 218 | const result = Reflect.get(target, prop) |
219 | 219 | if (typeof result === 'function') { |
220 | | - result.bind(doObj) |
221 | | - return instrumentAnyFn(result, initialiser, env, state.id) |
| 220 | + const boundResult = result.bind(doObj) |
| 221 | + return instrumentAnyFn(boundResult, initialiser, env, state.id) |
222 | 222 | } |
223 | 223 | return result |
224 | 224 | } |
|
0 commit comments