[Blob] Add some metric when write blob from http.#8464
Conversation
| <tr> | ||
| <td>blobFetchTotal</td> | ||
| <td>Counter</td> | ||
| <td>Total number of blob fetch attempts during write, including successful fetches, failures, and failures written as NULL.</td> |
There was a problem hiding this comment.
Could we avoid calling this an "attempt"? recordMissingFileNullWritten also increments blobFetchTotal, and the pre-checked missing-descriptor path records this metric after isNullAt without opening the blob. Something like "blob fetch outcomes handled during write" would match the counter semantics better.
There was a problem hiding this comment.
Good point, thanks. I updated the blobFetchTotal description to avoid calling it an attempt. It now describes the counter as blob fetch outcomes handled during write, including successful fetches, failures, and missing resources written as NULL. I also ran mvn spotless:apply and force-pushed the update.
93e827c to
bd860d8
Compare
| if (bytes != null && BlobDescriptor.isBlobDescriptor(bytes)) { | ||
| return BlobDescriptor.deserialize(bytes); | ||
| } | ||
| } catch (RuntimeException ignored) { |
There was a problem hiding this comment.
Looks tricky. A better way?
There was a problem hiding this comment.
Thanks, agreed. I removed the raw getBinary / descriptor deserialize / catch path. The writer now uses the row BLOB abstraction directly: element.getBlob(0) returns a BlobRef for descriptor-backed values, and the metric is recorded from BlobRef#toDescriptor(). Plain user NULL values are ignored for this pre-check metric, and I added a test to cover that case.
bd860d8 to
9bec498
Compare
|
@JingsongLi |
Background
For tables with BLOB columns, writers may fetch external HTTP resources through blob descriptors. After
blob-write-null-on-missing-fileandblob-write-null-on-fetch-failureare available, users can choose to write NULL instead of failing the write for missing files or non-404 fetch failures. However, it is still difficult to observe how often blob fetches succeed, fail, or are converted to NULL during write.Changes
This PR adds table-level blob fetch metrics for the write path. The metrics include total fetch attempts, successful fetches, successfully fetched bytes, NULLs written by missing-file handling, NULLs written by fetch-failure handling, unhandled fetch failures, and failure categories such as HTTP 404, non-404 HTTP 4xx, HTTP 5xx, invalid URI, and other errors.
The implementation uses fixed metric names under the
blobFetchmetric group and does not extend the publicMetricGroupAPI with dynamic subgroups. It also records success only after the blob stream is fully copied, and records failures from both opening and reading the blob stream. Missing-file NULLs produced by the Flink descriptor existence pre-check are also counted when the writer receives a NULL blob field carrying a blob descriptor.Kmon Result
Tests
Added unit coverage for metric registration and failure classification in
BlobFetchMetricsTest, and writer-side reporter coverage inBlobFormatWriterTestfor successful fetches, fetch failures written as NULL, unhandled fetch failures, and pre-checked missing-file NULLs.Verified with:
mvn -pl paimon-format,paimon-core -am -DfailIfNoTests=false -Dtest=BlobFormatWriterTest,BlobFetchMetricsTest test