Skip to content

Log backfill completion to OCI logging - #162

Closed
erics-ddog wants to merge 2 commits into
masterfrom
erics-ddog/ECI-backfill-complete-log
Closed

Log backfill completion to OCI logging#162
erics-ddog wants to merge 2 commits into
masterfrom
erics-ddog/ECI-backfill-complete-log

Conversation

@erics-ddog

@erics-ddog erics-ddog commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

Two related additions to Backfill()'s success path, both firing only on a genuinely clean completion (no fatal replay error, no list error):

  1. log.Printf logging the summary (replayed/skipped/dropped/delete_failures) — captured by OCI Logging.
  2. A direct log event sent to Datadog's Logs API (https://http-intake.logs.<site>/api/v2/logs), skipped when summary.Replayed == 0 so an empty-bucket no-op run doesn't generate noise.

Why

writeResponse(out, "success", "Backfill complete: "+summary.String(), nil) only writes that message into the function's HTTP response body — but hubmanager's invoke is detached, so nobody ever reads that response. A successful backfill drain previously left no durable trace anywhere. The error path already calls log.Println(err) before writeResponse, so failures do show up in OCI Logging; part 1 closes the equivalent gap for the success/completion case. Companion to #160, which added the equivalent "invoked" signal at the start of a run.

Part 2 sends the same signal directly to Datadog. Normally we'd be wary of that — backfill exists because the customer's Datadog pipe might be degraded, so routing observability about it back through the same pipe is circular. But by the time Backfill() reaches its success return, every object in this run has already been replayed successfully against Datadog, which proves intake is reachable right now — so notifying Datadog directly at that specific point doesn't have the same risk the "invoked" signal would.

Testing

go build ./..., go vet ./..., and go test ./... pass for datadog-functions/lib/client.

writeResponse's "Backfill complete" message was only ever written into
the detached invoke's discarded HTTP response, so a successful drain
had no durable signal anywhere. The error path already logs via
log.Println; this adds the equivalent for the success path.
If Backfill reaches its success return, every replay in the run
already succeeded against Datadog, so intake is provably reachable at
that moment — sending a completion log directly to Datadog's Logs API
doesn't have the same "pipe might be down" problem sending the trigger
signal would. Skipped for empty-bucket no-op runs (Replayed == 0) so
it stays a signal about real backfilled data, not periodic noise.
@erics-ddog erics-ddog closed this Aug 4, 2026
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.

1 participant