Skip to content

Commit

Permalink
feat(ingest): add failure/warning counts to ingest_stats (datahub-pro…
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored and cccs-Dustin committed Feb 1, 2023
1 parent 95dd1c5 commit e110244
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions metadata-ingestion/src/datahub/ingestion/run/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,11 @@ def raise_from_status(self, raise_warnings: bool = False) -> None:
)

def log_ingestion_stats(self) -> None:
source_failures = self._approx_all_vals(self.source.get_report().failures)
source_warnings = self._approx_all_vals(self.source.get_report().warnings)
sink_failures = len(self.sink.get_report().failures)
sink_warnings = len(self.sink.get_report().warnings)

telemetry.telemetry_instance.ping(
"ingest_stats",
{
Expand All @@ -471,6 +476,12 @@ def log_ingestion_stats(self) -> None:
"records_written": stats.discretize(
self.sink.get_report().total_records_written
),
"source_failures": stats.discretize(source_failures),
"source_warnings": stats.discretize(source_warnings),
"sink_failures": stats.discretize(sink_failures),
"sink_warnings": stats.discretize(sink_warnings),
"failures": stats.discretize(source_failures + sink_failures),
"warnings": stats.discretize(source_warnings + sink_warnings),
},
self.ctx.graph,
)
Expand Down

0 comments on commit e110244

Please sign in to comment.