For centralized application logs in a media notification service, evaluate a free API by the event volume it must retain: delivery attempts, retries, and the records each attempt produces. Retention multiplies that footprint. Query work and the engineering needed to connect a failed send to its scheduled job belong in the accounting too. A free allowance doesn't establish which of those terms dominates.
Consider a hypothetical daily newsletter workload: 100,000 notification attempts, three log records per attempt, and 1,000 bytes per record. That produces 300 MB of raw event data a day, or 9 GB over 30 days, before indexing, compression, or replication. Those are planning assumptions, not vendor measurements. In this example, repeated attempt detail is the first term to challenge.
Short answer: choose a centralized application logging API with simple query support around a small, attributable delivery record. Evaluate its free allowance against that record volume, then require a usable connection between scheduled runs and delivery failures. Keep detailed failure evidence longer than routine success chatter only when the chosen system supports that policy.
Count the retries.
A log search can explain a rejected newsletter send. It cannot, by itself, establish that an accepted message reached an inbox, or that a scheduled job ran at all. Those boundaries matter more than the label on a free plan.
What actually drives the notification logging bill?
Use the attempt as the accounting unit. A campaign can produce many sends; a send can produce several attempts; a failed scheduled run can prevent attempts from existing. Combining those into one failure count hides both delivery gaps and the work that generated the logs. For a media publisher, the useful question is which campaign and delivery stage consumed the investigation effort, rather than which application wrote the most lines.
Under the example assumptions, replacing three routine records with one 1,000-byte summary per attempt changes raw volume from 300 MB to 100 MB per day. At the same 30-day horizon, the planning footprint becomes 3 GB. This is arithmetic about a proposed event policy, not a prediction of the invoice: a service may meter ingestion, retained data, queries, or some combination. Check its actual billing dimensions before treating byte reduction as monetary savings.
The summary should carry application-owned identifiers for the campaign, send, attempt, and scheduled run, plus an outcome and delivery stage. These are proposed fields for your application record, not promises about any provider's ingestion schema. Keep the original attempt identity when retrying the same operation, and distinguish it from a new delivery attempt. Otherwise, retries can inflate the apparent audience and bury the source of the logging volume.
A timeout deserves special care. It says the caller didn't obtain a result; it doesn't prove that the recipient received nothing. Record that uncertainty rather than automatically counting another confirmed failure. Never log an OTP value, message body, email address, or phone number merely to make a search easier. Opaque identifiers can still require privacy review if another system can resolve them to a person.
That restriction has a cost: the investigator must use an authorized delivery system to inspect recipient details. It also keeps the centralized log store from becoming a second recipient database.
How should a free API query centralized application logs for delivery accounting?
There is no defensible universal winner without the expected volume, retention requirement, and query workload. Treat a free offering as an evaluation constraint, not as evidence that the system can answer the delivery question. The comparison below concerns the kind of investigation each candidate deserves; it does not assert current free-plan quotas or equivalent functionality.
| Option | Why evaluate it for notification failures? | Limitation or selection boundary |
|---|---|---|
| Grafana Loki | A log-focused candidate when the investigation can use a consistent set of service and delivery-stage labels. | Test its query model with campaign and attempt identifiers; don't assume every identifier belongs in an indexed label. Include the work of running or choosing its hosting. |
| Elastic Stack | A candidate when searching structured delivery records is central to the investigation. | Test mappings and retention administration against the team's capacity; richer searching brings more design decisions than a minimal logging API. |
| Datadog Logs | A candidate when notification logs need to sit within a broader operational investigation. | Verify which ingestion, indexing, retention, and related monitoring features the proposed plan includes. Don't infer them from the product name. |
| Unified REST option described below | Public API discovery and runnable examples in 10 languages let a team inspect a capability before adopting another SDK. Per-call cost metadata helps reconcile API usage across scheduled jobs and logs. | A reasonable candidate for small application workloads in US/EU regions needing centralized ingestion and basic filtering. A basic logging scope is unsuitable when distributed tracing or bulk log export is mandatory. |
Infrai provides one key, one bill, and a self-describing REST API across 295 routes in 20 modules, so its single-key workflow connects scheduled-job lookups and delivery-log lookups without separate credentials. Its public discovery includes schemas and runnable examples; inspecting a new capability starts with that description rather than another SDK. The breadth matters only if those capabilities meet the investigation's requirements; a shared credential doesn't prove the join is correct.
Cost metadata describes API activity.
It isn't a recipient delivery receipt, nor does it establish the total cost of sending a campaign. Join application-owned identifiers with your delivery accounting before assigning a campaign a cost. A request identifier helps investigate a call; a campaign identifier explains the business operation.
If the organization needs distributed trace navigation, source-map processing, crash symbolication, or session replay, a basic ingestion-and-search service is too narrow a selection target. Likewise, require explicit evidence for configurable retention and recipient erasure before depending on them. Simple search doesn't establish either capability. That is a selection boundary, especially when privacy obligations determine where delivery evidence can live.
Follow the scheduled run into the delivery evidence
The seam matters.
A scheduled newsletter run can complete while some notification attempts fail. It can also stop before an attempt record is written. Inspect run evidence and delivery evidence together, while keeping their meanings separate. Captured errors add another signal; they don't turn silence into proof of success.
Here is a deliberately small, read-only Python example using the standard library. Set INFRAI_API_KEY, NEWSLETTER_CRON_ID, and INFRAI_BASE_URL in the environment; use the service's documented v1 API base URL. It fetches an existing scheduled job, passes that response into the log lookup, and searches the returned JSON locally for the job identifier. Both calls use the same key and base URL. It invents neither server-side filter parameters nor response field names.
import json
import os
import time
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime
from urllib.error import HTTPError
from urllib.parse import quote
from urllib.request import Request, urlopen
BASE_URL = os.environ["INFRAI_BASE_URL"].rstrip("/")
API_KEY = os.environ["INFRAI_API_KEY"]
CRON_ID = os.environ["NEWSLETTER_CRON_ID"]
def retry_delay(value, attempt):
if value:
try:
return max(0.0, float(value))
except ValueError:
try:
when = parsedate_to_datetime(value)
return max(0.0, (when - datetime.now(timezone.utc)).total_seconds())
except (TypeError, ValueError, OverflowError):
pass
return min(2 ** attempt, 16)
def get_json(path):
for attempt in range(5):
request = Request(
BASE_URL + path,
headers={"Authorization": "Bearer " + API_KEY},
method="GET",
)
try:
with urlopen(request, timeout=30) as response:
if response.status != 200:
raise RuntimeError(f"Unexpected status: {response.status}")
return json.load(response)
except HTTPError as error:
reason = error.read().decode("utf-8", errors="replace")
if error.code != 429 or attempt == 4:
raise RuntimeError(f"HTTP {error.code}: {reason}") from error
time.sleep(retry_delay(error.headers.get("Retry-After"), attempt))
raise RuntimeError("Retry limit reached")
def contains_identifier(value, identifier):
if isinstance(value, dict):
return any(contains_identifier(item, identifier) for item in value.values())
if isinstance(value, list):
return any(contains_identifier(item, identifier) for item in value)
return isinstance(value, str) and identifier in value
def search_for_job(job_record):
if not contains_identifier(job_record, CRON_ID):
raise RuntimeError("Job response did not contain the requested identifier")
log_response = get_json("/logs/search")
return contains_identifier(log_response, CRON_ID)
job = get_json("/cron/get/" + quote(CRON_ID, safe=""))
print(json.dumps({"identifier_seen_in_returned_logs": search_for_job(job)}))
This is a connection check, not a complete incident detector. It assumes the application includes the scheduled job identifier in its delivery records and that the job response contains that identifier as a string. The result only describes the returned search response. A substring match can produce false positives; a missing match can reflect the returned search scope rather than missing delivery. Production attribution needs an exact structured join against the verified response schema and a defined search window.
The example does not enumerate runs, inspect dead letters, or claim that a captured error and a delivery failure are interchangeable. Make those distinct acceptance cases when evaluating the shared credential boundary. A standard queue also requires an idempotent consumer under at-least-once delivery; duplicate execution must not become a second newsletter send. For scheduled work that exceeds 900 seconds, design the cron trigger to hand work to a queue worker instead of stretching the cron timeout.
An alternative built from Amazon SQS dead-letter queues and Sentry Crons involves two service accounts or signups, one with AWS and one with Sentry. It has two credential systems, AWS credentials and Sentry credentials, even if several deployed processes receive separate credentials. You write the glue that relates queue messages, job executions, check-ins, and delivery records through your own identifiers.
A shared-key design reduces that credential handoff. The trade-off is one vendor to trust, one bill, and one outage surface. Keep an independent missed-run check, such as a Healthchecks-style heartbeat, when the operational question is whether an expected run happened; searching existing logs cannot answer for events never written.
Stop keeping what cannot change the delivery decision
Start with a proposed policy, then verify that the selected product can enforce it. Keep concise attempt summaries for attribution. Retain enough failure detail to separate provider rejection, caller timeout, and application error. Make recipient erasure and an exportable incident record explicit acceptance criteria wherever policy requires them, rather than assuming that a search API supplies either.
For the hypothetical publisher, the first volume change is to stop retaining all three routine success records when one summary answers the accounting question. The loss is specific: after discarding those intermediate records, an investigator cannot reconstruct every successful attempt's internal timing. If an intermittent delivery complaint later depends on that sequence, the summary may be insufficient.
That is the retention decision to sign off on.
Preserve evidence that changes a resend, escalation, or attribution decision; stop accumulating routine detail whose only purpose is reassurance. If proving inbox placement or recovering a missing scheduled run is the requirement, buy or build that evidence path explicitly. A larger pile of application logs won't manufacture it.
References
These sources describe the log model and competing logging systems; consult the chosen plan's terms separately for current allowances and retention.
- OpenTelemetry logs concepts: https://opentelemetry.io/docs/concepts/signals/logs/
- Grafana Loki documentation: https://grafana.com/docs/loki/latest/
- Elastic logging documentation: https://www.elastic.co/docs/solutions/observability/logs
- Datadog log management documentation: https://docs.datadoghq.com/logs/
Further reading
- Amazon SQS dead-letter queues: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
- Sentry Crons documentation: https://docs.sentry.io/product/crons/
- Healthchecks documentation: https://healthchecks.io/docs/
Top comments (1)
The accounting-unit move is the whole post: make the attempt the unit, not the send and not the campaign, and suddenly the bill has a shape you can argue with. Your hypothetical makes it concrete — 100,000 attempts a day, three records each, 1,000 bytes a record, 300 MB a day and 9 GB over 30 days before indexing. Once you see that, "keep three routine success records per attempt" stops sounding thorough and starts sounding expensive.
Two lines I would put on a wall: "Count the retries" — because retries are where a quiet bill becomes a loud one — and the timeout warning, that a timeout says the caller did not obtain a result, not that the message was never delivered. That distinction is exactly where duplicate sends are born.
The question I would add to your evaluation table: which of the four options lets you enforce the retention policy — detailed failure evidence kept longer than routine success chatter — without a second system doing the enforcing? If the answer is "we do it by hand", the cheap ingestion price is the expensive one.