Skip to content

Commit

Permalink
Rename service binding and client fetch spans (#137)
Browse files Browse the repository at this point in the history
* Rename service binding and client fetch spans

* Add changeset

* Also rename Durable Objects
  • Loading branch information
DaniFoldi authored May 28, 2024
1 parent 6f1c790 commit 52100b5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-coins-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@microlabs/otel-cf-workers": minor
---

[Breaking] Rename durable object fetch, client fetch and service binding spans
2 changes: 1 addition & 1 deletion src/instrumentation/do.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function instrumentBindingStub(stub: DurableObjectStub, nsName: string): Durable
if (prop === 'fetch') {
const fetcher = Reflect.get(target, prop)
const attrs = {
name: `durable_object:${nsName}`,
name: `Durable Object ${nsName}`,
'do.namespace': nsName,
'do.id': target.id.toString(),
'do.id.name': target.id.name,
Expand Down
2 changes: 1 addition & 1 deletion src/instrumentation/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function instrumentServiceBinding(fetcher: Fetcher, envName: string): Fet
if (prop === 'fetch') {
const fetcher = Reflect.get(target, prop)
const attrs = {
name: `service_binding:${envName}`,
name: `Service Binding ${envName}`,
}
return instrumentClientFetch(fetcher, () => ({ includeTraceContext: true }), attrs)
} else {
Expand Down

0 comments on commit 52100b5

Please sign in to comment.