s3-orchestrator

observe

import "github.com/afreidah/s3-orchestrator/internal/proxy/observe"

Package observe centralizes per-operation completion observability - audit log, notification event, and span status - so storage paths in object/, multipart/, and writepath/ can mark success with one call and the audit/event attribute shapes stay defined in exactly one place.

Index

func CopyCompleted

func CopyCompleted(ctx context.Context, span trace.Span, sourceKey, destKey, sourceBackend, destBackend string, size int64)

CopyCompleted marks a successful CopyObject. Emits the storage.CopyObject audit log, an s3:ObjectCreated:Copy notification, and sets the span to Ok.

func DeleteBatchCompleted

func DeleteBatchCompleted(ctx context.Context, span trace.Span, totalKeys, deleted, errors int)

DeleteBatchCompleted marks a successful DeleteObjects batch. Emits the storage.DeleteObjects audit log, an s3:ObjectRemoved:DeleteBatch notification, and sets the span to Ok. The caller is responsible for any per-key span attributes; this helper does not synthesize a Subject (batch operations span many keys).

func DeleteCompleted

func DeleteCompleted(ctx context.Context, span trace.Span, key string, copiesDeleted int)

DeleteCompleted marks a successful DeleteObject. Emits the storage.DeleteObject audit log, an s3:ObjectRemoved:Delete notification, and sets the span to Ok.

func GetCompleted

func GetCompleted(ctx context.Context, key, backend string, size int64)

GetCompleted marks a successful GetObject. Emits the storage.GetObject audit log. Used for both backend reads (backend = backend name) and data-cache hits (backend = “cache”). Does not set span status: the read path currently relies on span.End for completion.

func HeadCompleted

func HeadCompleted(ctx context.Context, key, backend string, size int64)

HeadCompleted marks a successful HeadObject. Emits the storage.HeadObject audit log. Does not set span status (parity with today’s behavior).

func ListCompleted

func ListCompleted(ctx context.Context, prefix string, keyCount int, truncated bool)

ListCompleted marks a successful ListObjects. Emits the storage.ListObjects audit log. Does not set span status (parity with today’s behavior).

func MultipartAborted

func MultipartAborted(ctx context.Context, span trace.Span, uploadID, key, backend string, partsCleaned int)

MultipartAborted marks a successful AbortMultipartUpload. Emits the storage.AbortMultipartUpload audit log and sets the span to Ok. No notification event is emitted: AWS S3 itself does not emit a notification for an aborted upload.

func MultipartCompleted

func MultipartCompleted(ctx context.Context, span trace.Span, key, backend, uploadID string, totalSize int64, partsCount int)

MultipartCompleted marks a successful CompleteMultipartUpload. Emits the storage.CompleteMultipartUpload audit log, an s3:ObjectCreated:CompleteMultipartUpload notification, and sets the span to Ok.

func MultipartCreated

func MultipartCreated(ctx context.Context, span trace.Span, key, backend, uploadID string)

MultipartCreated marks a successful CreateMultipartUpload. Emits the storage.CreateMultipartUpload audit log and sets the span to Ok. No notification event is emitted: AWS S3 itself does not emit a notification for CreateMultipartUpload, only for the final CompleteMultipartUpload.

func PutCompleted

func PutCompleted(ctx context.Context, span trace.Span, key, backend string, size int64)

PutCompleted marks a successful PutObject. Emits the storage.PutObject audit log, an s3:ObjectCreated:Put notification, and sets the span to Ok.

func UploadPartCompleted

func UploadPartCompleted(ctx context.Context, span trace.Span, key, backend, uploadID string, partNumber int, size int64)

UploadPartCompleted marks a successful UploadPart. Emits the storage.UploadPart audit log and sets the span to Ok. No notification event is emitted: AWS S3 itself does not emit per-part notifications, only for the final CompleteMultipartUpload, so adding one here would expand notification cardinality beyond the S3 contract.

Generated by gomarkdoc