Documentation
¶
Overview ¶
Package objectobs observes the object operations the platform makes on the buckets it owns (#1896): portal assets, managed resources, thumbnails, a script's outputs, exports and webhook segments. Every put, get, list and delete is a client span named storage.<operation> and one storage_operations_total observation labeled by what the bucket is used for (its purpose), with a failure read into a reason class, so a credential or bucket-policy mistake reads differently from an outage.
The adapters that hold an S3 client (pkg/portal/s3adapter and the webhook objects) call Do around each operation with the purpose they were built for. A caller that writes for another purpose through a shared client -- the thumbnail worker through the portal's client, an export through it -- names that purpose on the context with WithPurpose, and the operation is reported under it.
Index ¶
Constants ¶
const ( OpPut = "put" OpGet = "get" OpGetRange = "get_range" OpList = "list" OpDelete = "delete" )
The operations an object adapter reports.
Variables ¶
This section is empty.
Functions ¶
func Do ¶
func Do(ctx context.Context, fallback, op, bucket string, fn func(context.Context) (int64, error)) (int64, error)
Do runs one object operation under a client span and records it. fn returns the bytes it stored (zero for anything but a put) and its error, which Do returns unchanged.
func Reason ¶
Reason classifies a failed object operation: access_denied for a refused credential or policy, bucket_missing, quota_exceeded for a store that is full, not_found for an absent object, and other for everything else (a timeout, a refused connection, a server error). Empty for nil.
The S3 error code is read when the error chain carries one; the mcp-s3 client does not always wrap with %w, so the code is also looked for in the error text, where the SDK writes it.
Types ¶
This section is empty.