Skip to content

Add more information on DO spans #22729

Description

@JPeer264

Currently Cloudflare DurableObject spans for get/put/etc. are not showing the exact information of who called it with which information. It'd be good to have more information than just a plain DO call that has been triggered:

Current (based on some e2e tests):

{
      data: {
        'db.operation.name': 'put',
        'db.system.name': 'cloudflare.durable_object.storage',
        'sentry.op': 'db',
        'sentry.origin': 'auto.db.cloudflare.durable_object',
      },
      description: 'durable_object_storage_put',
      op: 'db',
      origin: 'auto.db.cloudflare.durable_object',
},

Expected:

Either in the db. attributes or in the description some information on e.g. function names.


Improve tests where this could potentially land:

expect.objectContaining({
data: {
'db.operation.name': 'put',
'db.system.name': 'cloudflare.durable_object.storage',
'sentry.op': 'db',
'sentry.origin': 'auto.db.cloudflare.durable_object',
},
description: 'durable_object_storage_put',
op: 'db',
origin: 'auto.db.cloudflare.durable_object',
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
span_id: expect.stringMatching(/[a-f0-9]{16}/),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
}),
expect.objectContaining({
data: {
'db.operation.name': 'get',
'db.system.name': 'cloudflare.durable_object.storage',
'sentry.op': 'db',
'sentry.origin': 'auto.db.cloudflare.durable_object',
},
description: 'durable_object_storage_get',
op: 'db',
origin: 'auto.db.cloudflare.durable_object',
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
span_id: expect.stringMatching(/[a-f0-9]{16}/),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
}),
expect.objectContaining({
data: {
'db.operation.name': 'get',
'db.system.name': 'cloudflare.durable_object.storage',
'sentry.op': 'db',
'sentry.origin': 'auto.db.cloudflare.durable_object',
},
description: 'durable_object_storage_get',
op: 'db',
origin: 'auto.db.cloudflare.durable_object',
parent_span_id: expect.stringMatching(/[a-f0-9]{16}/),
span_id: expect.stringMatching(/[a-f0-9]{16}/),
start_timestamp: expect.any(Number),
timestamp: expect.any(Number),
trace_id: expect.stringMatching(/[a-f0-9]{32}/),
}),
]);
(ref: #22710 (comment))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions