Skip to main content

Overview

Attributes and tags are two ways to add metadata to traces:
  • Attributes: Key-value pairs for detailed, queryable data
  • Tags: Simple labels for categorization and filtering

Attributes

Adding Single Attributes

Adding Multiple Attributes

Complex Values

Objects are automatically stringified to JSON:

Common Attribute Patterns

Tags

Adding Single Tags

Adding Multiple Tags

Tag Use Cases

Tags are ideal for:
  • Chain identification: ethereum, polygon, arbitrum
  • Operation type: swap, transfer, mint, stake
  • Environment: production, staging, development
  • Feature flags: beta, experimental
  • Priority: critical, high, normal

Attributes vs Tags

When to Use Attributes

  • Specific values you’ll query: user IDs, amounts, addresses
  • Data that varies per trace: transaction hashes, block numbers
  • Structured information: configuration objects

When to Use Tags

  • Categories that group traces: chain names, operation types
  • Boolean-like flags: is this production? is this a swap?
  • Simple labels for filtering dashboards

Method Signatures

Attributes

Tags

Best Practices

Be Consistent with Keys

Use a consistent naming convention:

Don’t Store Sensitive Data

Avoid including private keys, passwords, or PII:

Use Meaningful Tag Names

Tags should be immediately understandable:

Next Steps

Transaction Hints

Correlate traces with blockchain transactions

Browser Metadata

Automatic environment data collection