Log Your Application
Add file and URL attachments
Learn how to attach files and URLs to traces and spans for richer observability in Maxim.
- This feature is currently in beta.
- Requires
maxim-py
>= 5.6.x
Overview
Attachments let you add files (audio, images, text, etc.) or URLs to your traces and spans in Maxim. This provides extra context for debugging, analytics, and audit trails. All attachments are stored and viewable in the Maxim UI alongside your trace data.
How to Add Attachments
You can attach files or URLs to both traces and spans. There are three main types of attachments:
Attachment Type | Use For | Example Parameter(s) |
---|---|---|
FileAttachment | Local files (audio, images) | path |
UrlAttachment | Remote files or images | url , mime_type (optional) |
FileDataAttachment | Data blobs (bytes in memory) | data , name , mime_type (opt.) |
Example: Add Attachments to a Trace
Tip:
You can also add attachments to a span
or generation
by replacing trace
with your span or generation object.
Notes
- You can provide a custom name for each file by passing the
name
property. - Attachments are visible in the Maxim UI for each trace or span.
- The server detects the MIME type automatically, but you can override it by passing the
mime_type
parameter.
Best Practices
- File size limit: Each file must be under 50 MB.
- MIME type: Maxim detects MIME type on the server, but you can override it if needed.
- Name: Add names to each file to easily detect them while surfing through logs.
If you have further questions, contact support.