# Which Hotel Suppliers Failed Our Searches and Bookings Yesterday? A Travel Booking Site's Morning Report From Datadog Logs

A hotel booking website runs an agent each morning that counts yesterday's failed supplier calls in Datadog logs, by supplier and error, and drafts a note to each.

[Run this on Rush](https://cloud.getrush.ai/run/list-failed-supplier-calls-each-morning/datadog/). Opens the console with this prompt ready to send. Connect Datadog there first.

## What the agent does

This is for an online hotel booking business that sells rooms from a handful of suppliers: two bed banks, a channel manager that connects independent hotels, and a few chains' own APIs. Every search, price check and booking calls one or more of them, and the booking service logs each call to Datadog with the supplier, the operation, the status and the error. When a supplier has a bad night, customers see fewer hotels, prices that change at checkout, or a booking that fails after payment. The partnerships manager needs to know by nine which supplier failed, how often and how, so they can raise it with that supplier's account manager the same morning.

The partnerships manager connects Datadog once with `POST /me/connections {"type": "mcp", "name": "datadog", "url": "https://mcp.datadoghq.com/api/unstable/mcp-server/mcp"}` and signs in on Datadog's page. Datadog's MCP server forwards the signed-in user's own credentials and "cannot grant a user access beyond what that user already has", so the manager's account needs the Logs Read Data and Logs Read Index Data permissions the log tools list. The request names `datadog` in `connections`. Rush's row is Datadog's US1 site; a business on another site adds its server as a custom one.

On a run the agent uses `analyze_datadog_logs`, which Datadog describes as analysing logs "using SQL queries for counting, aggregations, and numerical analysis", to count yesterday's supplier calls by `supplier`, `operation` (search, price check, book, cancel) and outcome, using the attribute names given in the request. It then uses `search_datadog_logs` to pull a sample of the failed calls for each supplier and error, reading the error code and message the service logged, so the report quotes the supplier's own words rather than a count alone. It compares each supplier's failure rate with the same weekday a week earlier.

It writes `supplier-report.md`: one section per supplier with calls, failures and failure rate by operation, the top errors with a count and an example, the hours when failures clustered, and the change from last week; failed bookings get their own table, since each one may be a customer who paid and has no room. It also writes `notes/<supplier>.md`, a short factual draft to that supplier's account manager with the counts, times and example request ids. It reads logs only: it creates no monitor, notebook or incident, and contacts no one.

## Start it with one API call

`POST https://api.phoenix.so/o/{org}/sessions`

```json
{
  "agent": "claude",
  "input": "Morning supplier failure report for Wayfare Stays, for yesterday 2026-11-22 (00:00 to 24:00 UTC). Use the datadog connection, read only. Logs: service:booking-gateway; attributes @supplier, @operation (search, price, book, cancel), @outcome (ok, error, timeout), @error.code, @error.message, @request_id. 1) With analyze_datadog_logs, count calls by supplier, operation and outcome for yesterday and for 2026-11-15. 2) For each supplier and error.code with 10 or more failures yesterday, use search_datadog_logs to read up to 5 examples (time, operation, error.code, error.message, request_id). 3) For operation book, list every failure with time, supplier, error and request_id. Write supplier-report.md: suppliers sorted by failure rate, each with a table by operation (calls, failures, rate, rate a week ago), top errors with counts and one quoted example, the hours (UTC) with the most failures; then a table of failed bookings. Write notes/<supplier>.md for each supplier above 2% failure on any operation: 5 to 8 factual sentences to their account manager with counts, times and 3 example request_ids, no blame and no demands. Never create or edit monitors, notebooks, dashboards or incidents.",
  "connections": [
    "datadog"
  ]
}
```

1. **Get an API key.** In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
2. **Send the request.** POST the body in request.json to https://api.phoenix.so/o/{org}/sessions. The run starts in its own cloud sandbox.
3. **Read what came back.** Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

## What comes back

`supplier-report.md` ranks suppliers by how badly their calls failed yesterday and lists every failed booking with its request id. It is one of the session's artifacts. Each supplier gets a table by operation against the same day last week, the errors behind the failures with a quoted example, and the hours they bunched in. A draft note in `notes/` for each supplier over the threshold gives the counts, the times and example request ids their support team can look up.

What the partnerships manager checks before sending a note: failures that were the site's own fault, such as a deploy at 02:00 that broke one supplier's mapping, which the error messages usually show; a supplier's planned maintenance they announced by email; and the failed bookings, each of which the customer service team checks against the payment before anyone writes to a customer. The manager sends the notes from their own email.

## Run it on every morning before the partnerships call

In the console, a Project automation with a `schedule` trigger, `cron` `0 7 * * *` and the business's `timezone`, runs a saved agent whose connections name `datadog` with this prompt. The schedule fills in no date, so the saved instructions say "yesterday, UTC" and "the same weekday one week earlier", and the agent works out the ranges.

On a bad night the on-call engineer can start the same saved agent by hand in the console with a narrower window, such as the last three hours for one supplier, and the result reads the same way as the morning report.

## Why run it on Rush?

The Datadog sign-in is held in Rush's connection, not as an API key and application key in a cron job, and the agent acts with the partnerships manager's own Datadog permissions, which an admin can limit to log reads. Datadog's documentation says administrators can turn off the MCP server's write tools for the whole organization, which suits a report that never writes.

Each run has its own computer and a record of every query it sent to Datadog, so when a supplier disputes a count, the manager opens that morning's session and shows the query and the log lines behind it. The session's `total_cost_usd` shows what the morning report costs, beside the bookings one supplier's bad night can lose.

## Frequently asked questions

### What if our logs use different attribute names?

Put your names in the prompt. The agent builds its queries from the attributes it is given; if a name returns nothing, it says so in the report instead of guessing another field.

### Can it open a Datadog incident when a supplier is down?

Not in this prompt, which forbids writes. Incidents and monitors are for the engineering on-call; this report is for the partnerships team, who talk to suppliers, not to Datadog.

### Does it read customers' personal details from the logs?

It reads what the log lines contain. The prompt asks only for supplier, operation, outcome, error and request id, and a business that logs guest names should restrict them with Datadog's own data access controls, which the MCP server respects.

## More Datadog jobs

- [Find Noisy Datadog Monitors](https://getrush.ai/run/monitor-noise-audit/datadog/)
- [Build an SLO Report From Datadog](https://getrush.ai/run/slo-report/datadog/)
- [Which Customers Hit the Most Errors This Week? A SaaS Customer-Success Team's Weekly Report From Datadog Logs](https://getrush.ai/run/weekly-failed-requests-by-customer/datadog/)

## More jobs like this: Produce a report or file, no repo

- [Which Invoice Emails Bounced This Week? Invoicing Software for Tradespeople Lists Them From Resend](https://getrush.ai/run/list-invoice-emails-that-bounced/resend/)
- [Which Clients Still Owe Us Documents? An Accounting Firm's Weekly Check of Client Folders in OneDrive](https://getrush.ai/run/list-missing-client-documents/onedrive/)
- [What's Still Open on Each Deal Closing in the Next 10 Days? A Real Estate Brokerage's Monday Checklist From ClickUp](https://getrush.ai/run/list-open-items-before-each-closing/clickup/)

## Keep reading

- [Connect Datadog to Rush once, then name it on any run](https://getrush.ai/integrations/datadog/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
