Skip to content

/

Tracing

Instrument your agent

Wrap functions, add custom spans and attach attributes you can filter by.

LAST UPDATED

Wrapping the top-level function is enough to start. Add spans where the default view is too coarse.

Custom spans

await tracewell.span('search_tickets', async () => {
  return db.tickets.search(query)
})
await tracewell.span('search_tickets', async () => {
  return db.tickets.search(query)
})
await tracewell.span('search_tickets', async () => {
  return db.tickets.search(query)
})

Attributes

Attributes are key-value pairs on a span. Keep them small and useful: customer tier, language, feature flag.

tracewell.attr({ tier: 'enterprise', locale: 'de' })
tracewell.attr({ tier: 'enterprise', locale: 'de' })
tracewell.attr({ tier: 'enterprise', locale: 'de' })

Create a free website with Framer, the website builder loved by startups, designers and agencies.