Skip to content

feat(inkless:storage): split S3 error metrics by operation#716

Open
jeqo wants to merge 1 commit into
mainfrom
jeqo/s3-throttling-per-op-metric
Open

feat(inkless:storage): split S3 error metrics by operation#716
jeqo wants to merge 1 commit into
mainfrom
jeqo/s3-throttling-per-op-metric

Conversation

@jeqo

@jeqo jeqo commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

The S3 MetricCollector recorded every SDK error (throttling, server, timeout, IO, other) into a single global sensor per error type, so a throttle could not be attributed to a specific operation. The ops question "are our deletes being throttled?" was unanswerable from metrics.

Record each error into an additional operation-tagged sensor (operation=, e.g. DeleteObjects) alongside the existing untagged global sensor. The global metrics are unchanged, so existing dashboards/alerts keep working; the tagged variants appear under a new MBean (type=s3-client-metrics,operation=...).

Tagged sensors are created lazily and stored in a ConcurrentHashMap to stay safe under concurrent SDK publish callbacks. Per-operation attribution is skipped when the operation name is ambiguous.

Adds MetricCollectorTest which builds SDK MetricCollections directly to exercise publish() without WireMock, and regenerates metrics.rst.

The S3 MetricCollector recorded every SDK error (throttling, server,
timeout, IO, other) into a single global sensor per error type, so a
throttle could not be attributed to a specific operation. The ops
question "are our deletes being throttled?" was unanswerable from
metrics.

Record each error into an additional operation-tagged sensor
(operation=<OperationName>, e.g. DeleteObjects) alongside the existing
untagged global sensor. The global metrics are unchanged, so existing
dashboards/alerts keep working; the tagged variants appear under a new
MBean (type=s3-client-metrics,operation=...).

Tagged sensors are created lazily and stored in a ConcurrentHashMap to
stay safe under concurrent SDK publish callbacks. Per-operation
attribution is skipped when the operation name is ambiguous.

Adds MetricCollectorTest which builds SDK MetricCollections directly to
exercise publish() without WireMock, and regenerates metrics.rst.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves observability of the Inkless S3 storage backend by attributing AWS SDK error metrics (throttling, server, timeout, IO, other) to specific S3 operations, while keeping the existing global (untagged) metrics intact for backwards-compatible dashboards and alerts.

Changes:

  • Add per-operation (tagged) variants of S3 error metrics via new MetricNameTemplates in MetricRegistry.
  • Extend MetricCollector.publish() to record SDK errors into both the existing global sensors and lazily-created operation-tagged sensors (when operation name is unambiguous).
  • Add MetricCollectorTest that constructs SDK MetricCollections directly to validate global vs per-operation error recording behavior, and regenerate docs/inkless/metrics.rst accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
storage/inkless/src/test/java/io/aiven/inkless/storage_backend/s3/MetricCollectorTest.java Adds unit coverage for per-operation vs global error metrics and ambiguous-operation behavior.
storage/inkless/src/main/java/io/aiven/inkless/storage_backend/s3/MetricRegistry.java Introduces operation-tagged metric templates and includes them in the registry’s exported list for docs/JMX.
storage/inkless/src/main/java/io/aiven/inkless/storage_backend/s3/MetricCollector.java Records SDK errors into new operation-tagged sensors (lazily, concurrency-safe) in addition to existing global sensors.
docs/inkless/metrics.rst Documents the new type=s3-client-metrics,operation=... MBean and its attributes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@jeqo
jeqo marked this pull request as ready for review July 22, 2026 18:31
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