This prompt is designed for real-time data pipeline and streaming system builders who need to programmatically monitor the timeliness of incoming data. The core job-to-be-done is generating a structured health report that flags stale sources, calculates latency percentiles, and scores the reliability of each data feed. The ideal user is an engineering lead or platform engineer responsible for data quality in event-driven architectures, where a silent stall in a Kafka topic or a delayed API response can corrupt downstream models and dashboards. You should use this prompt when you have a stream of timestamped events and need an automated, repeatable way to answer the question: 'Is our data fresh enough to trust right now?'
Prompt
Real-Time Data Freshness Evaluation Prompt

When to Use This Prompt
Defines the job, ideal user, required context, and boundaries for the Real-Time Data Freshness Evaluation Prompt.
The prompt requires a well-defined input context: a list of data sources with their expected update frequencies, a window of recent timestamps, and a set of freshness thresholds (e.g., maximum acceptable latency in seconds). It is not a general-purpose data quality tool. Do not use this prompt for static document corpora, historical analysis, or batch ETL validation where recency is not the primary concern. It is also unsuitable for systems where event time and processing time cannot be reliably distinguished, or where clock skew across distributed sources exceeds the latency thresholds you are trying to measure. In those cases, you need infrastructure-level time synchronization before a prompt-based evaluation can be meaningful.
Before wiring this into a production harness, you must define clear Service Level Objectives (SLOs) for each data source. The prompt template uses placeholders like [SOURCES] and [FRESHNESS_THRESHOLDS] that should be populated from a configuration store, not hardcoded. The output is a structured JSON health report with staleness alerts and reliability scores, which your application can route to alerting systems like PagerDuty or log to an observability platform. The next step after reading this section is to copy the prompt template, map your source metadata into the placeholders, and run it against a known-good and known-stale dataset to calibrate your thresholds before deploying to production.
Use Case Fit
Where the Real-Time Data Freshness Evaluation Prompt delivers value and where it introduces operational risk.
Good Fit: Streaming Data Pipelines
Use when: You have live data feeds (Kafka, Kinesis, WebSockets) and need to verify that data is arriving within acceptable latency windows. Guardrail: Define explicit latency thresholds per feed type before evaluation; a 500ms threshold for market data is a failure for nightly batch ingestion.
Bad Fit: Static Knowledge Bases
Avoid when: Your data source is a pre-indexed, static document corpus with no real-time ingestion path. Freshness evaluation on a snapshot produces meaningless alerts. Guardrail: Route this prompt only when the data source has a known update frequency and a timestamped ingestion log.
Required Inputs
What you need: A stream of records with ingestion timestamps, a defined latency SLA per source, and a lookback window for evaluation. Guardrail: Reject evaluation requests that lack source-level timestamp metadata; freshness cannot be assessed without a temporal reference point.
Operational Risk: False Staleness Alerts
What to watch: Scheduled maintenance windows, backfill events, or source-side outages can trigger staleness alerts that are not actionable. Guardrail: Cross-reference staleness flags with source health status and maintenance calendars before escalating. Suppress alerts during known downtime windows.
Operational Risk: Silent Data Gaps
What to watch: A source may stop emitting data entirely without triggering a latency violation if the evaluation only checks the most recent record. Guardrail: Add a heartbeat check that verifies the expected record count per time window, not just the age of the latest record.
Scale Consideration: High-Cardinality Sources
What to watch: Evaluating freshness across thousands of partitions or shards can produce noisy, high-cardinality alert storms. Guardrail: Aggregate freshness scores by source group or topic before generating alerts. Use percentile-based thresholds (p95, p99) rather than per-partition pass/fail to reduce noise.
Copy-Ready Prompt Template
A reusable prompt template for evaluating real-time data freshness across streaming sources, with placeholders for your specific pipeline configuration.
This prompt template evaluates whether live data feeds, API responses, and streaming sources are delivering data within acceptable latency windows. It produces structured freshness health reports with staleness alerts and source reliability scores. The template is designed to be wired into a monitoring harness that periodically samples data sources and passes their metadata to the model for assessment.
textYou are a real-time data freshness evaluator. Your job is to assess whether streaming data sources are delivering data within acceptable latency windows and to produce a structured freshness health report. ## INPUT DATA [SOURCE_METADATA] ## EVALUATION PARAMETERS - Acceptable latency threshold: [MAX_LATENCY_SECONDS] seconds - Evaluation window: [EVALUATION_WINDOW_MINUTES] minutes - Domain: [DOMAIN] - Risk level: [RISK_LEVEL] ## OUTPUT SCHEMA Return a JSON object with this exact structure: { "evaluation_timestamp": "ISO 8601 timestamp of evaluation", "overall_health": "healthy|degraded|stale|critical", "sources": [ { "source_id": "string", "source_name": "string", "last_event_timestamp": "ISO 8601 or null", "latency_seconds": "number or null if no recent event", "freshness_status": "fresh|delayed|stale|offline|unknown", "reliability_score": "0.0 to 1.0", "staleness_reason": "string or null", "recommended_action": "string or null" } ], "alerts": [ { "severity": "warning|critical", "source_id": "string", "message": "string", "detected_at": "ISO 8601" } ], "summary": "One-paragraph human-readable assessment of overall freshness health" } ## CONSTRAINTS - If a source has no events in the evaluation window, mark it as offline or unknown with a null latency. - Reliability scores must reflect both recent latency performance and historical consistency. - Generate alerts only for sources exceeding the latency threshold or showing degraded patterns. - If risk level is high, flag any source with latency above 50% of the threshold as a warning. - Do not fabricate timestamps. Use only the data provided in [SOURCE_METADATA]. - If source metadata is insufficient to determine freshness, set status to unknown and explain why in staleness_reason. ## EXAMPLES [EXAMPLES] ## TOOLS AVAILABLE [TOOLS]
Adaptation guidance: Replace [SOURCE_METADATA] with a structured array of source records containing at minimum source_id, source_name, last_event_timestamp, and any historical latency data. Set [MAX_LATENCY_SECONDS] based on your domain's freshness requirements—sub-second for financial trading, seconds for operational dashboards, minutes for batch analytics. The [EXAMPLES] placeholder should contain 2-3 few-shot examples showing correct output for common scenarios like healthy sources, delayed sources, and offline sources. If your pipeline has access to historical uptime data or source health metrics, pass those through [TOOLS] as available function signatures. For high-risk domains such as financial data or safety-critical monitoring, always route alerts through human review before automated actions.
Prompt Variables
Required and optional inputs for the Real-Time Data Freshness Evaluation Prompt. Each placeholder must be populated before the prompt is assembled and sent. Validation checks should be applied at the application layer before model invocation.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[DATA_SOURCE_IDENTIFIER] | Unique name or endpoint label for the streaming source being evaluated | payment-events-kafka-us-east-1 | Non-empty string. Must match a known source in the monitoring registry. Reject if null or whitespace. |
[EXPECTED_LATENCY_MS] | Maximum acceptable end-to-end latency in milliseconds for this data feed | 5000 | Positive integer. Must be > 0. Reject if non-numeric or negative. Convert string representations to integer before validation. |
[OBSERVATION_WINDOW_MINUTES] | Lookback period in minutes over which to evaluate freshness | 15 | Positive integer between 1 and 1440. Reject if outside range. Default to 15 if not provided but warn in logs. |
[LATEST_EVENT_TIMESTAMP] | ISO 8601 timestamp of the most recent event received from the source | 2025-03-15T14:32:17Z | Must parse as valid ISO 8601 UTC. Reject if unparseable, future-dated beyond 5-minute clock skew tolerance, or null. Compare against system clock. |
[CURRENT_SYSTEM_TIME] | Current wall-clock time in ISO 8601 UTC for staleness calculation | 2025-03-15T14:35:00Z | Must parse as valid ISO 8601 UTC. Reject if unparseable. Should be set by the harness, not user-provided, to prevent manipulation. |
[SOURCE_HEALTH_METRICS] | Recent health signals: error rate, connection status, throughput, last heartbeat | {"error_rate": 0.02, "status": "healthy", "throughput_rps": 1200, "last_heartbeat": "2025-03-15T14:34:55Z"} | Must be valid JSON object. Required fields: status (enum: healthy, degraded, down), last_heartbeat (ISO 8601). Optional fields: error_rate (0-1 float), throughput_rps (positive number). Reject if status is missing. |
[ALERT_THRESHOLD_OVERRIDES] | Optional map of threshold overrides for specific alert conditions | {"staleness_warning_pct": 150, "staleness_critical_pct": 300} | Optional. If provided, must be valid JSON object with numeric values. Allowed keys: staleness_warning_pct, staleness_critical_pct, error_rate_threshold. Reject if keys are unrecognized or values are non-numeric. |
[OUTPUT_SCHEMA_VERSION] | Schema version for the freshness report output format | 1.2.0 | Must match semver pattern. Reject if format is invalid. Supported versions: 1.0.0, 1.1.0, 1.2.0. Reject unsupported versions with clear error message listing valid options. |
Implementation Harness Notes
How to wire the Real-Time Data Freshness Evaluation Prompt into a streaming monitoring pipeline with validation, alerting, and model selection.
This prompt is designed to run inside a scheduled or event-driven monitoring harness, not as a one-off chat interaction. The typical deployment pattern is a background worker that polls live data sources, assembles a freshness evaluation request, calls the model, parses the structured output, and writes the result to a monitoring dashboard or alerting system. The prompt expects a batch of source metadata—timestamps, source identifiers, expected update cadences—and returns a freshness health report with per-source staleness alerts and reliability scores.
Wire the prompt into your application by building a thin orchestration layer that handles three responsibilities: input assembly, output validation, and alert routing. For input assembly, collect the latest last_updated timestamps, expected_freshness_seconds thresholds, and source_id labels from your streaming sources or API health endpoints. Pack these into the [SOURCE_METADATA] placeholder as a JSON array. For output validation, parse the model's JSON response and run schema checks: every source in the input must appear in the output, staleness_seconds must be a non-negative number, and freshness_status must be one of fresh, degraded, or stale. Reject and retry any response that fails schema validation. For alert routing, publish stale and degraded entries to your incident channel with the recommended_action field included. Use a model that supports structured JSON output (such as gpt-4o with response_format or Claude with tool-use extraction) to reduce parsing failures. Log every evaluation run—input, output, model, latency, and validation result—so you can track source reliability trends and model drift over time.
Do not use this prompt for sources where freshness cannot be measured objectively (e.g., human-reported status without timestamps). Do not skip output validation: a hallucinated fresh status on a stale source will suppress alerts and create a false sense of system health. If a source consistently triggers staleness alerts, investigate whether the expected_freshness_seconds threshold is misconfigured before adjusting the prompt. For high-criticality pipelines, add a human review step for any evaluation where more than 20% of sources are flagged as stale, since this may indicate a systemic ingestion failure rather than individual source lag.
Expected Output Contract
Defines the exact fields, types, and validation rules for the Real-Time Data Freshness Evaluation Prompt output. Use this contract to parse, validate, and integrate the freshness health report into a monitoring pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
source_id | string | Must match a known source identifier from the input [SOURCE_LIST]. Non-empty. | |
source_name | string | Human-readable name. Must not be null or empty. | |
last_observed_timestamp | ISO 8601 UTC string | Must parse as a valid UTC datetime. Must be before the current system time. | |
expected_latency_seconds | integer | Must be a non-negative integer. Compare against [LATENCY_THRESHOLD] to determine health. | |
freshness_status | string enum | Must be one of: 'fresh', 'stale', 'degraded', 'unknown'. 'unknown' is only allowed if last_observed_timestamp is null. | |
staleness_severity | string enum or null | Required if freshness_status is 'stale'. Must be one of: 'warning', 'critical'. Null otherwise. | |
source_reliability_score | float | Must be a number between 0.0 and 1.0 inclusive. Represents the historical reliability of the source's data feed. | |
alert_reason | string or null | Required if freshness_status is 'stale' or 'degraded'. Must provide a concise, human-readable reason for the alert. Null otherwise. |
Common Failure Modes
Real-time freshness evaluation fails in predictable ways. These cards cover the most common production failure modes and how to guard against them before stale data reaches downstream systems.
Clock Drift Masks Real Staleness
What to watch: When producer and consumer clocks drift apart, data that is actually stale appears fresh because the evaluator compares against a skewed consumer clock. A 30-second drift can hide minutes of real latency. Guardrail: Always compare producer timestamps against a trusted NTP-synchronized reference clock, not local system time. Include clock skew detection in the freshness harness and alert when drift exceeds your tolerance threshold.
Silent Source Failures Produce False Freshness
What to watch: A streaming source or API stops publishing new data but continues returning HTTP 200 with the last known payload. The freshness evaluator sees a recent timestamp on stale data and reports healthy latency. Guardrail: Track the delta between successive event timestamps, not just the wall-clock gap. Alert when the inter-event interval exceeds the expected publishing cadence, even if the last timestamp looks recent.
Timestamp Parsing Ambiguity Corrupts Latency Math
What to watch: Sources emit timestamps in inconsistent formats (epoch milliseconds vs. seconds, timezone-naive ISO 8601, ambiguous date-only strings). The evaluator misparses these and computes wildly incorrect latency values, flagging fresh data as stale or vice versa. Guardrail: Normalize all timestamps to UTC epoch milliseconds at ingestion before any freshness calculation. Add a parsing validation step that rejects ambiguous formats and logs the raw value for debugging.
Bursty Traffic Triggers False Staleness Alerts
What to watch: During traffic spikes, backpressure delays data delivery across the pipeline. The freshness evaluator sees elevated latency and fires staleness alerts, but the data is still arriving—just slowly. Operations teams get flooded with noise. Guardrail: Use percentile-based latency windows (p95, p99) rather than point-in-time checks. Require sustained staleness above threshold for multiple evaluation cycles before alerting, and distinguish 'delayed' from 'missing' in alert severity.
Watermark Tracking Lags Behind Actual Arrival
What to watch: In streaming systems, the freshness evaluator reads watermark progress to determine how current the data is. When watermarks stall due to a slow partition or idle source, the evaluator reports staleness even though most data is arriving on time. Guardrail: Evaluate freshness per partition, not only at the aggregate watermark level. Report partition-level staleness separately and exclude idle partitions from overall health scores when they have no expected traffic.
Freshness Windows Ignore Domain-Specific Decay Rates
What to watch: A single static latency threshold (e.g., 'data must be under 5 seconds old') is applied uniformly across all data sources. Financial tick data tolerates sub-second staleness, while daily batch reports are fine at several hours. The evaluator either over-alerts on slow sources or under-alerts on fast ones. Guardrail: Define per-source or per-topic freshness SLAs with explicit latency windows and decay functions. Store these in configuration, not hardcoded in the prompt, and validate that each source has a registered SLA before evaluation runs.
Evaluation Rubric
Use this rubric to test the Real-Time Data Freshness Evaluation Prompt before deploying it into a production monitoring pipeline. Each criterion targets a specific failure mode common in streaming data freshness assessment.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Staleness Alert Accuracy | All data sources exceeding their [MAX_LATENCY_MS] threshold are flagged with a staleness alert | A source with a last-recorded timestamp older than [MAX_LATENCY_MS] is reported as fresh or healthy | Inject a mock source with a known stale timestamp and verify the output contains a staleness alert for that source ID |
Source Reliability Score Calibration | Reliability scores correlate with the ratio of on-time deliveries to total expected deliveries over the [EVALUATION_WINDOW_SEC] | A source with 50% missed deliveries receives a reliability score above 0.8 | Run the prompt against a 100-record test feed where exactly 20 records are intentionally delayed; confirm the reliability score is between 0.75 and 0.85 |
Output Schema Compliance | The output is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present and correctly typed | The output is missing the source_reliability_scores array or contains a string where a float is expected | Parse the output with a JSON schema validator using the exact [OUTPUT_SCHEMA] definition and assert zero validation errors |
Latency Window Boundary Handling | A record arriving exactly at the [MAX_LATENCY_MS] boundary is classified as healthy, not stale | A record with latency equal to [MAX_LATENCY_MS] is incorrectly flagged as stale | Send a test payload where one source's last record latency equals [MAX_LATENCY_MS] exactly and assert staleness_status is false |
Multi-Source Aggregation Correctness | The overall freshness health report correctly reflects the worst-case status across all sources | The overall status is reported as healthy when one source is stale | Provide a batch with 4 healthy sources and 1 stale source; assert the top-level health_status field is degraded or critical, not healthy |
Missing Data Source Handling | Sources with zero records in the [EVALUATION_WINDOW_SEC] are reported with a staleness alert and a reliability score of null | A silent source is omitted from the report or assigned a default reliability score of 1.0 | Include a source_id in the input configuration that has no records in the test feed and verify it appears in the output with staleness_alert: true and reliability_score: null |
Timestamp Parsing Robustness | ISO 8601, Unix epoch milliseconds, and RFC 3339 timestamps in [INPUT] are all parsed correctly | A valid Unix epoch timestamp is misinterpreted, causing a false staleness alert | Run the prompt with three identical latency scenarios using the three timestamp formats; assert all three produce the same staleness_status and latency_ms values |
Confidence Score Grounding | Any confidence score below 0.7 is accompanied by a specific reason in the confidence_factors array | A low confidence score is returned with an empty or generic confidence_factors list | Introduce a source with intermittent connectivity in the test feed; assert that if the confidence score is below 0.7, the confidence_factors array contains at least one non-empty string |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a single streaming source and relaxed latency thresholds. Replace the full schema with a simple JSON object containing source_id, last_event_ts, and freshness_status. Skip the reliability scoring and staleness alert tiers.
codeEvaluate freshness for [SOURCE_ID]. Last event timestamp: [LAST_EVENT_TS]. Current time: [NOW]. Max acceptable latency: [MAX_LATENCY_MS]ms. Return: { "source_id": "...", "last_event_ts": "...", "latency_ms": ..., "freshness_status": "fresh" | "stale" | "unknown" }
Watch for
- Clock skew between the evaluation script and the data source
- Missing
last_event_tscausing false "stale" classifications - No handling of backfill or replay scenarios

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us