Skip to content

Instrument File Methods#84

Merged
aaditjuneja merged 2 commits intomainfrom
aadit/instrument-file-methods
Jan 21, 2026
Merged

Instrument File Methods#84
aaditjuneja merged 2 commits intomainfrom
aadit/instrument-file-methods

Conversation

@aaditjuneja
Copy link
Contributor

Instrument File Methods

Checklist

  • I have read both the CONTRIBUTING.md and Contributor License Agreement documents.
  • I have created an issue or feature request and received approval from xAI maintainers. (minor changes like fixing typos can skip this step)
  • I have tested my changes locally and they pass all CI checks.
  • I have added necessary documentation or updated existing documentation.

Description

We add instrumentation for the upload and delete methods for the files SDK.

For upload, the emitted span looks like:

name: file.upload
kind: CLIENT
attributes: {
   operation.name: file.upload,
   provider.name: xai,
   file.id: {file_id},
   file.name: {file_name
}

For delete, the emitted span will look like:

name: file.delete
kind: CLIENT
attributes: {
   operation.name: file.delete,
   provider.name: xai,
   file.id: {file_id}
}


I wasn't able to find a popular telemetry standard for files, so I elected for this structure. I didn't instrument read-only methods because it didn't seem super reasonable to me, but let me know your thoughts.

I also didn't instrument batch_upload since it's just concurrent executions of upload which would each receive their own instrumentation.

Related Issue

N/A

Type of Change

Instrumentation for Files methods in SDK

Additional Notes

N/A

@aaditjuneja aaditjuneja requested a review from a team as a code owner January 21, 2026 01:23
@aaditjuneja aaditjuneja force-pushed the aadit/instrument-file-methods branch from a5876a3 to 179ad67 Compare January 21, 2026 18:37
@aaditjuneja aaditjuneja merged commit c41cb22 into main Jan 21, 2026
7 checks passed
@aaditjuneja aaditjuneja deleted the aadit/instrument-file-methods branch January 21, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants