feat(snapshot): add artifact dimension to OSS upload observability - #168
Open
huajq wants to merge 1 commit into
Open
feat(snapshot): add artifact dimension to OSS upload observability#168huajq wants to merge 1 commit into
huajq wants to merge 1 commit into
Conversation
Tag snapshot OSS upload metrics with the artifact kind (rootfs/attached-drive/memory layer, vm_state, manifest, record, alias) so slow or canceled publishes can be attributed to a specific artifact. Completed file uploads are now logged at info level with key, artifact, size, and elapsed time. The upload duration histogram keeps recording dropped operations as status="canceled", so canceled uploads now carry the artifact label as well.
Contributor
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
Comment on lines
+248
to
+249
| info!( | ||
| key = %oss_key, |
Contributor
There was a problem hiding this comment.
This logs the fully expanded OSS object key on every successful file upload. full_key prepends the configured prefix, and the repository keys include snapshot IDs (for example artifacts/{snapshot_id}/...), so centralized logs can expose tenant/repository/snapshot metadata and create high-cardinality log fields. Please avoid logging the raw key, or log only a non-sensitive operation/artifact identifier (and, if correlation is required, a suitably redacted/hash-derived value).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
agentenv_snapshot_oss_upload_bytes_total,and the
put_file/put_bytesseries ofagentenv_snapshot_oss_operation_duration_seconds) gain anartifactlabel:
rootfs_layer/attached_drive_layer/memory_layer/vm_state/manifest/record/alias.put_filelogskey,artifact,size_bytes,elapsed_msat info level.Why
Upload metrics could not distinguish memory layers from disk layers, and
canceled uploads left no per-artifact trace. Slow or canceled snapshot
publishes can now be attributed to a specific artifact.
Related issue
None.
Scope and non-goals
In scope: the OSS repository upload path and the shared
MetricGuard.Non-goals: no timeout/retry behavior changes; POSIX backend, ACR/regctl
path, and the download/resolver path are untouched.
Design and behavior changes
MetricGuard::operation_artifactlabel variant; guards droppedmid-flight still record
status="canceled", now with the artifact.OssUploadArtifactenum threaded through the publish flow;DiskImageSubjectmaps to rootfs/attached-drive artifact.debug!("uploaded managed layer to oss")(themanaged-layer key already contains the digest) and its
digestparameter.Compatibility and operations
artifactlabel;sum by (operation)-style queries remain valid. Rollback is a revert.Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Skipped checks and reasons:
make test-unit: covered by CI; the unit tests of the touched module wererun directly (see above).
path.
services/, generated code, docs, benchmarks: not affected.Risks and reviewer notes
put_file/put_bytescarry
artifact); valid Prometheus, existing aggregations unaffected.src/snapshot/repository/backends/oss/client.rs,src/snapshot/repository/backends/oss/repository.rs,src/observability/prometheus.rs.Checklist
(Label threading only; no metrics-assertion harness exists — covered by
the existing snapshot test suite and clippy.)