You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: capture x-client header for analytics (#468)
### Context
We recently added the ability to pass custom headers to identify which
Storacha client uses the Upload API (see:
storacha/upload-service#215). Now we need to
capture the custom header for analytics.
### Changes
- Updated the `ucan-invocation-handler` to log additional information if
the `X-Client` custom header is present.
- The logs are structured in JSON format that's easy to query in
CloudWatch Logs.
- The `clientId` field will contain the actual value of the `X-Client`
header which indicates the name and version of the Storacha Client +
service/project it is integrated to, e.g: `Storacha/X (js; MCP/Y)` -
where `X` = major version of the Storacha Client, and `Y` = major
version of the service/project integration.
- The `requestId` allows us to correlate this specific log entry with
other logs from the same request, which helps debug issues.
- Then we build analytics based on CloudWatch Logs Insights using some
query like this:
```
fields @timestamp, clientId
| filter message = "Client request"
| stats count(*) as requestCount by clientId
| sort requestCount desc
```
Related to: storacha/mcp-storage-server#18
0 commit comments