Repository navigation
[GOBBLIN-2271] Add retention (deletion) counts to DatasetMetric in GaaSJobObservabilityEvent - #4209
Merged
Blazer-007 merged 1 commit intoOct 15, 2026
Conversation
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open findings
Using a long positional constructor call is brittle and easy to break as the Avro schema evolves… · New The constant nameSUMMARY_LISTis a bit ambiguous since it’s actually aTypetoken for a list… · New This test validates the new retention counters, but it doesn’t assert other key fields present in… · New
What changed in this PR
Adds retention (deletion) counters to per-dataset observability metrics so data-retention jobs can report work (versions considered/deleted and directories pruned) through GaaSJobObservabilityEvent.datasetsMetrics[].
Changes:
- Extend
DatasetMetricAvro schema with nullable retention-only fields:versionsTotal,versionsDeleted,directoriesPruned - Thread the new fields through
DatasetTaskSummary.toDatasetMetric(...) - Add unit tests validating JSON deserialization + mapping behavior for retention vs write jobs
| File | Description |
|---|---|
| gobblin-runtime/src/main/java/org/apache/gobblin/runtime/DatasetTaskSummary.java | Maps new retention counters from DatasetTaskSummary into DatasetMetric |
| gobblin-runtime/src/test/java/org/apache/gobblin/runtime/DatasetTaskSummaryTest.java | Adds tests for JSON->DatasetTaskSummary->DatasetMetric mapping and null behavior for write jobs |
| gobblin-metrics-libs/gobblin-metrics-base/src/main/avro/GaaSJobObservabilityEvent.avsc | Adds three backward-compatible nullable fields to DatasetMetric schema |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
agam-99
force-pushed
the
GOBBLIN-retention-dataset-metrics
branch
from
October 13, 2026 13:51
656c7b7 to
7d49191
Compare
Copilot stopped reviewing on behalf of
Blazer-007 due to an error
October 13, 2026 18:51
agam-99
force-pushed
the
GOBBLIN-retention-dataset-metrics
branch
from
October 14, 2026 09:17
7d49191 to
d6cd8d9
Compare
DatasetMetric (GaaSJobObservabilityEvent.datasetsMetrics) models only writes, so a data-retention job cannot report per-dataset deletions: the counts it puts in datasetTaskSummaries are dropped when GaaS parses them into DatasetTaskSummary. Add optional versionsTotal, versionsDeleted and directoriesPruned (nullable long, default null) to DatasetMetric and DatasetTaskSummary, and map them in toDatasetMetric. Existing producers and consumers are unaffected; the 5-arg DatasetTaskSummary constructor is unchanged.
agam-99
force-pushed
the
GOBBLIN-retention-dataset-metrics
branch
from
October 14, 2026 09:24
d6cd8d9 to
8af1788
Compare
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.


Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!
JIRA
Description
GaaSJobObservabilityEvent.datasetsMetrics[](DatasetMetric) only models writes:bytesWritten,entitiesWritten,successfullyCommitted,dataQualityStatus, and, since GOBBLIN-2269,snapshotsCommitted/partitionsCommitted. Data-retention (deletion) jobs have no way to report per-dataset work through this channel. A job that removes aged-out dataset versions can already emit onedatasetTaskSummariesentry per dataset root, but the deletion counts are dropped when GaaS parses them intoDatasetTaskSummary.This PR adds three optional, retention-only counts and threads them through. It follows the same pattern as GOBBLIN-2269 (#4206).
GaaSJobObservabilityEvent.avsc:DatasetMetricgains three fields, each["null","long"]withdefault: null:versionsTotal: versions considered under the dataset root (deletable + retained);versionsDeleted: versions deleted, or on a dry run, those that would be;directoriesPruned: now-empty parent directories pruned after the deletes.Because they are nullable with null defaults, the schema change is backward compatible, and every existing producer and consumer is unaffected.
DatasetTaskSummary: adds the three fields as nullableLong, intentionally not@NonNull. That keeps the 5-arg@RequiredArgsConstructorused byAbstractJobLauncherandCommitActivityImplintact. The fields are populated by Gson during deserialization of events that carry them.toDatasetMetricmaps them through, and they staynullfor write jobs.The first producer is the ddm-executor retention run (linkedin-multiproduct/ddm-executor#507). It emits one row per dataset root in a single
JobSummaryTimerevent, rather than one event per dataset, which would collide on the job-execution identity. Each row carriesrecordsWritten = bytesWritten = 0plus these counts.Tests
New
DatasetTaskSummaryTest:testToDatasetMetricMapsRetentionCountsFromJson: parses the exact JSON a retention run emits, viaGsonUtils.GSON_WITH_DATE_HANDLING(the pathGaaSJobObservabilityEventProduceruses), and asserts the counts reachDatasetMetric.The existing
GaaSJobObservabilityProducerTeststill passes, so write-jobdatasetsMetricsare unchanged.End-to-end check, done locally and not committed:
datasetTaskSummaries=[{"datasetUrn":"abfss://…","recordsWritten":0,"bytesWritten":0,"successfullyCommitted":true,"versionsTotal":3,"versionsDeleted":1,"directoriesPruned":1}].GaaSJobObservabilityEventProduceron this branch, yieldsdatasetsMetrics=[{…, versionsTotal:3, versionsDeleted:1, directoriesPruned:1}], and the values survive theAvroBinarySerializerround-trip.master, the same input is accepted and the three fields are dropped, which confirms that this change is what carries them.Commits