Logging & Alerts page
The Logging & Alerts page is where a proxy admin sends gateway traffic to logging and observability platforms and decides which alerts go where. Open it at /ui/logging-and-alerts. It sits in the left nav under Settings, then Logging & Alerts. The nav shows it to the admin session role, which covers proxy admins and proxy admin viewers. Org admins see the Settings group but not this item, and internal users do not see the group at all. The page itself has no role guard, so the URL still opens for other roles, and it relies on the gateway's route checks to keep its data and actions to admins.
Every write on this page goes to a gateway route that accepts only the proxy_admin role. A proxy admin viewer can open every tab and read the settings, with secret values redacted, but the UI does not hide the save, test and delete controls for them, and the gateway refuses each of those actions. The gateway wide callbacks and alerts on this page need no license. Two individual alert controls described below are locked without a license.
The page has seven tabs, Logging Callbacks, CloudZero Cost Tracking, Vantage Cost Export, Alerting Types, Alerting Settings, Email Alerts and MS Teams Alerts. Logging Callbacks opens first. Switching tabs keeps what you typed in the other tabs until you leave the page.
A real-world scenario
A new observability platform is adopted and the platform admin has to get every team's model traffic into it by Friday, without a redeploy. She opens this page, clicks Add Callback, picks the destination, pastes its key, saves, and clicks Test on the new row. The test event shows up in the platform a few seconds later, and from then on every request through the gateway is logged there. On the Alerting Types tab she then points Budget Alerts at the finance channel's webhook so budget warnings stop landing in the on-call channel.
Add a logging callback
-
Open Settings, then Logging & Alerts. The Logging Callbacks tab opens with the Active Logging Callbacks table.
-
Click Add Callback, pick the destination in the Callback dropdown and fill in its fields. Required fields are marked.
-
Click Add Callback in the dialog. The toast reads "Callback
added successfully" and the table refreshes with the new row, badge Success. -
Open the row's actions menu and click Test. The toast reads "Health check triggered". Check the destination for the event.
-
Confirm from the API:
curl http://localhost:4000/callbacks/list \-H "Authorization: Bearer $SPANWAY_API_KEY"Expected result:
{"success": ["langfuse", "prometheus"],"failure": ["langfuse"],"success_and_failure": ["otel"]}
Logging Callbacks tab
This tab lists the logging callbacks that run for every request on the gateway, under the heading Active Logging Callbacks.
| Column | Meaning |
|---|---|
| Callback Name | The callback's display name, or its internal name when the gateway has no display name for it. |
| Mode | Which events the callback receives, as a badge. |
| Actions | A menu with Test, Edit and Delete, or the text Read only. |
| Badge | Meaning |
|---|---|
| Success | The callback receives successful requests. |
| Failure | The callback receives failed requests. The same callback can appear twice, once as Success and once as Failure, because the two registrations fire on different events. |
| Success & Failure | The callback receives both. |
The row actions menu holds these items.
| Action | What it does |
|---|---|
| Test | Asks the gateway to run a health check against that destination and shows "Health check triggered". It only appears for callbacks the gateway says can be tested. Check the destination itself to confirm the test event arrived. |
| Edit | Opens Edit Callback Settings. |
| Delete | Opens the Delete Callback confirmation. |
A row marked Read only is a callback that is active on the gateway but was not added from the dashboard, for example one set in the config file. Hover it to see "Active callback that was not added through the dashboard. Edit it where it was configured." It has no actions.
Add Callback opens the Add Logging Callback dialog.
Add Logging Callback dialog
| Control | Type | What it does |
|---|---|---|
| Docs link | Link | Reads "Setup guide for this callback" when the selected callback has its own guide, and "Spanway Docs: Logging" otherwise. Opens in a new tab. |
| Callback | Searchable dropdown | Picks the destination. The placeholder is "Choose a logging callback...". Typing filters the list. Required, with the message "Please select a callback". |
| Destination fields | Text, password, number, dropdown or switch | Appear after you pick a callback and come from the gateway's description of that callback, so the set of fields and their labels differ per destination. A field the gateway marks required shows "Please enter the" followed by the field name when left empty. Number fields accept values from 0 to 1 in steps of 0.1. |
| Cancel | Button | Closes the dialog and clears the form. |
| Add Callback | Button | Saves. It reads "Adding..." while the request runs. |
Saving stores the field values on the gateway as environment variables, encrypted in the database, and registers the callback as a success callback. No restart or config file change is needed. On success you see "Callback" followed by its name and "added successfully", and the table refreshes.
Edit Callback Settings dialog
The Callback dropdown is shown but locked, so you cannot change which destination a row points at. The destination fields are filled with the stored values. Secret values arrive masked from the gateway, and a masked value you leave untouched keeps the stored secret. If you change a host or URL field, enter the callback's key or secret again in the same save, because the gateway refuses to send a stored secret to a new host. Save Changes saves (it reads "Saving..." while running) and shows "Callback updated successfully". Cancel closes without saving.
Delete Callback dialog
The dialog is titled Delete Callback and shows the callback name and mode under Callback Information, with the message "Are you sure you want to delete this callback? This action cannot be undone." Delete removes the callback from the gateway's list of success callbacks, so it stops receiving events. Its credentials stay stored, encrypted, in the gateway's environment variables setting, so clear the callback's fields first if you want them gone. Cancel closes the dialog. Deleting from the dashboard works only when the gateway stores its config in the database (STORE_MODEL_IN_DB=True), and it can only remove callbacks registered as success callbacks.
Set in the config file
Under the table, a section titled Set in the config file lists destinations that the dashboard cannot add, with the note "These destinations cannot be added from this page. They are shown here so you can see whether they are on." Each entry has an On or Off badge that is On when that callback is in the active list, a short reason and a How to set it up link that opens the setup guide in a new tab.
| Entry | Why it is config only |
|---|---|
| Prometheus metrics | Its /metrics route is mounted when the gateway starts. Add prometheus to spanway_settings.callbacks and restart. |
| FOCUS cost files | Its export job is scheduled when the gateway starts. Add focus to spanway_settings.callbacks and restart. |
| Mavvrik cost export | Its export job is scheduled when the gateway starts. Add mavvrik to spanway_settings.callbacks and restart. |
CloudZero Cost Tracking tab
This tab connects the gateway's cost data to CloudZero. While it loads you see "Loading CloudZero settings...". A load failure shows "Error loading CloudZero settings" with the reason.
With nothing configured you see No CloudZero Integration Found and Add CloudZero Integration, which opens Create CloudZero Integration.
| Control | Type | What it does |
|---|---|---|
| CloudZero API Key | Password field with a show and hide button | Required, with the message "Please enter your CloudZero API key". |
| Connection ID | Text | Required, with the message "Please enter your CloudZero connection ID". |
| Timezone | Text | Optional. The placeholder is UTC, and an empty value is saved as UTC. |
| Cancel | Button | Closes without saving. |
| Create | Button | Saves the integration and shows "CloudZero integration created successfully". It reads "Creating..." while running. |
Once configured, the tab shows a CloudZero Configuration card with a status badge (it shows "Active" when the gateway reports no status) and these rows.
| Row | Meaning |
|---|---|
| API Key (Redacted) | The masked key. The full key is never shown. |
| Connection ID | The CloudZero connection the data goes to. |
| Timezone | The timezone used for dates, or "Default (UTC)". |
| Control | What it does |
|---|---|
| Edit | Opens Edit CloudZero Integration with the same fields. The API key field starts empty with the placeholder "Leave empty to keep existing", so leaving it empty keeps the stored key. Update saves and shows "CloudZero integration updated successfully". |
| Delete | Opens Delete CloudZero Integration? with the connection ID and timezone, and the message that all associated settings and configurations will be permanently removed. Delete removes the integration. This cannot be undone, and you have to enter the API key again to reconnect. |
| Run Dry Run Simulation | Builds up to 10 records the way an export would and shows them under Dry Run Results as JSON, without sending anything to CloudZero. |
| Export Data Now | Opens Export Data to CloudZero, which says "This will push the current accumulated cost data to CloudZero. Continue?". Export sends the data, replacing the hourly figures already in CloudZero for the same hours, and shows "Data successfully exported to CloudZero". Cancel closes without sending. |
Vantage Cost Export tab
This tab sends the gateway's daily spend to Vantage, so finance sees AI costs next to the rest of the cloud bill. A proxy admin clicks Connect Vantage and enters the Vantage API key, the cost integration token and, for a private Vantage deployment, its base URL. Once connected, the tab shows the stored settings with the secrets masked, previews the rows the next export would send, sends them now, and removes the export. A proxy admin viewer sees the settings but none of the buttons that change them. The steps and the matching API calls are in connect Vantage.
Alerting Types tab
This tab picks which alert types fire and where each one is sent. The intro explains that alerts go to any Slack compatible incoming webhook URL and links to the Slack guide for creating one.
The table has one row per alert type, with a switch, the alert name with a one line explanation of what it tells you under it, and a Webhook URL (Slack-compatible) field. The field is a password field and starts with the webhook set for that alert type. When the type has none of its own it starts empty, with the placeholder "Uses the default Slack webhook" when the gateway has a general Slack webhook, or "No webhook set" when it does not.
| Alert | Fires on |
|---|---|
| LLM Exceptions | Errors returned by model providers. |
| LLM Responses Too Slow | Responses slower than the alerting threshold. |
| LLM Requests Hanging | Requests that have not finished. |
| Budget Alerts (API Keys, Users) | Keys and users close to or over budget. |
| Budget Tier Shift | A team or organization moving to a cheaper budget tier as its spend crosses a shift percentage, or back up after its budget resets. On by default. |
| User Spend Thresholds (Daily/Monthly) | A user crossing a daily or monthly spend threshold. |
| User Spend Anomaly Detection | A user's spend jumping above their normal level. |
| Database Exceptions (Read/Write) | Database read and write errors. |
| Weekly/Monthly Spend Reports | Scheduled spend reports. |
| Outage Alerts | A model deployment failing repeatedly. |
| Region Outage Alerts | Many deployments in one region failing. This switch is replaced by a button labeled Enterprise Feature on a gateway without a license. |
| Model Deprecation Warnings | Models nearing their deprecation date. |
| Logging Overload | Request logging falling behind, so the gateway samples trace and analytics destinations or drops log records to keep requests fast. On by default, see logging under load. |
| Prompt Promoted | A tested prompt version was promoted, usually into production, with the eval run that allowed it. On by default, see prompt operations. |
| Prompt Deleted | A prompt was deleted from an environment. On by default. |
| Prompt Created | Every new prompt, including ones pulled from a Git repository. Off by default. |
| Prompt Updated | Every new prompt version saved in the Prompt Studio, the API or a Git pull. Off by default, because it is busy while a team edits. |
Save Changes saves the switches as the list of active alert types and saves each filled webhook field as that type's webhook. A type whose field is empty is saved without a webhook of its own, so it uses the general Slack webhook. The gateway also drops a blank or masked webhook value, so a masked webhook is never stored in place of a real one. Saving also adds Slack to the gateway's alerting destinations when it is missing. You then see "Alerts updated successfully". Test Alerts asks the gateway to send a test alert to Slack and shows "Alert test triggered. Test request to slack made - check logs/alerts on slack to verify".
Alerting Settings tab
This tab tunes the Slack alerting engine. Each row shows a setting name, its description from the gateway (what it does in plain words and its default, for example Seconds the same budget alert stays quiet after it is sent. Default 86400, 1 day.), a control, a source badge and a reset button. The rows come from the gateway and include the master switch slack_alerting plus thresholds and intervals such as daily_report_frequency, report_check_interval, budget_alert_ttl, outage_alert_ttl, region_outage_alert_ttl, minor_outage_alert_threshold, major_outage_alert_threshold, max_outage_alert_list_size, daily_spend_per_user_threshold, monthly_spend_per_user_threshold, spend_anomaly_multiplier, spend_anomaly_baseline_days, spend_anomaly_min_spend and user_spend_check_interval.
| Control | What it does |
|---|---|
| Value | A number field for whole number and decimal settings, a switch for on and off settings, and a text field otherwise. A setting the gateway marks as an enterprise setting shows an Enterprise Feature button instead when the gateway has no license. |
| Source badge | In DB when the value is stored in the database, In Config when it is not stored in the database, and Not Set after you press the reset button. |
| Reset button | Puts the setting back to its default in the form. It saves nothing by itself. |
| Update Settings | Saves all the settings and, once the gateway confirms, shows "Wait 10s for proxy to update.". When the slack_alerting switch is on it adds Slack to the gateway's saved alerting destinations, and when it is off it removes Slack. Email, Microsoft Teams and any other destination already on stay on. |
Email Alerts tab
The tab has two cards.
Email Notifications
This card lists the events that can send an email, each with a checkbox and a description. The events are Virtual Key Created (emails the user a new key made with their user ID), New User Invitation (emails a newly created user), Virtual Key Rotated, Soft Budget Crossed, Max Budget Alert, Virtual Key Expiring (emails the owner 30 days and 1 day before a key expires) and Virtual Key Compromised (emails the owner when their key was reported as leaked and blocked), see leaked keys and key expiry.
| Control | What it does |
|---|---|
| Checkbox | Turns the email for that event on or off in the form. |
| Save Changes | Saves the checkboxes and shows "Email event settings updated successfully". |
| Reset to Defaults | Immediately puts every event back to the gateway's default, with no confirmation, and reloads the list. |
Both buttons are disabled while the list loads.
Email Server Settings
This card holds the SMTP settings and links to "Spanway Docs: email alerts". Each field is named after its environment variable and shows the value the gateway would use now, from the database, the environment or the built in default.
| Field | What it holds |
|---|---|
SMTP_HOST | The SMTP server address. Required. |
SMTP_PORT | The SMTP port, 587 by default. Required. |
SMTP_TLS | Whether to use TLS, on by default. |
SMTP_USERNAME | The SMTP user. Required. Shown masked. |
SMTP_PASSWORD | The SMTP password. Required. Shown masked, with a button to show or hide what you type. |
SMTP_SENDER_EMAIL | The from address. Required. |
TEST_EMAIL_ADDRESS | Where Test Email Alerts sends its test. Required. |
EMAIL_LOGO_URL | Optional logo URL for the email template. Needs a license. |
EMAIL_SUPPORT_CONTACT | Optional support contact shown in emails. Needs a license. |
On a gateway without a license, the two licensed fields are disabled and their names turn into a link to an enterprise request form.
Save Changes sends only the fields you changed, so masked or environment supplied values are never copied into the database, and adds email to the gateway's alerting destinations while keeping the destinations already on. It shows "Email settings updated successfully". Test Email Alerts asks the gateway to send a test email and shows "Email test triggered. Check your configured email inbox/logs.".
MS Teams Alerts tab
The Microsoft Teams Alerting Settings card sends alerts to a Teams channel through a webhook, and links to Microsoft's guide for creating one. Create the webhook with the Workflows app in Teams: open the channel's More options menu, choose Workflows, pick the Send webhook alerts to a channel template, finish the steps and copy the URL it shows, as described in create the Teams webhook. The gateway posts each alert as an Adaptive Card, which that template accepts. Microsoft retired the older Office 365 incoming webhook connectors, so a connector URL from before that change no longer works.
| Control | What it does |
|---|---|
MS_TEAMS_WEBHOOK_URL | The channel's Workflows webhook URL. Required. Shown masked, with a button to show or hide it. |
| Save Changes | Sends the webhook only if you changed it, and adds Microsoft Teams to the gateway's alerting destinations while keeping the destinations already on. It shows "MS Teams settings updated successfully". |
| Test MS Teams Alerts | Asks the gateway to send a test alert and shows "MS Teams test alert triggered. Check your Teams channel.". |
Errors
With no callbacks the Logging Callbacks table shows "No callbacks configured" and "Add your first callback to start logging data to external services." While it loads it shows "Loading callbacks…". If the list of callback types fails to load you see "Failed to load callback configs" with the reason, and the Callback dropdown in the add dialog is empty. A failed save, test or delete shows the gateway's error as a toast.
The most common refusals have a clear cause. A proxy admin viewer gets a permission error on every save, test and delete. Deleting a callback without STORE_MODEL_IN_DB=True fails with a message asking you to set it. A setting that is fixed in the config file cannot be changed here, and the gateway answers with an error that names the key. Change it in the config file instead.
The CloudZero tab shows its own loading text and error message. The Create, Update, Export and dry run buttons are disabled while their request runs. The Email Notifications buttons are disabled while the event list loads. The licensed alert controls show an Enterprise Feature button or a disabled field instead of the control on a gateway without a license.
| Status | Where | Meaning | Fix |
|---|---|---|---|
403 Admin-only endpoint. Not allowed to access this., your role=<role> | Delete on a callback | The session is a proxy admin viewer or another non-admin role. | Sign in as a proxy admin. |
403 Only proxy admins can update config | Saving a callback | The same, for saving. | Sign in as a proxy admin. |
404 Callback '<name>' not found in active configuration | Delete on a callback | The callback is not in the success callback list, for example it was set under callbacks or failure_callback in the config file. | Remove it from the config file instead. |
400 DB not connected. This endpoint needs a database; set DATABASE_URL ... | Delete on a callback | The gateway runs without a database. | Set DATABASE_URL. |
| 400 naming a destination field and a secret field | Saving a callback | The host, URL, endpoint or site changed while the stored secret was kept. | Retype the secret with the new destination. |
400 ... set in the config file and cannot be changed here | Saving a callback, alert setting or email switch | The setting is fixed in the config file. | Change it in the config file, or remove it from there first. |
Delete asks for STORE_MODEL_IN_DB | Delete on a callback | The gateway does not store its config in the database. | Set STORE_MODEL_IN_DB=True, or remove the callback from the config file. |
422 "slack" not in proxy config: general_settings. Unable to test this. | Test Alerts | Slack is not yet an alerting destination. | Click Save Changes on the Alerting Types tab first, which adds it. |
500 Database not connected. Set DATABASE_URL to manage email event settings | Email Notifications card | The gateway runs without a database. | Set DATABASE_URL. |
Differences by role and license
Proxy admins can use everything on the page. Proxy admin viewers see the same tabs with secret values redacted, and every write is refused by the gateway. Other roles have no nav entry. The page has no role guard of its own, so for anyone else who opens the URL it relies on the gateway's route checks to refuse the requests.
Without a license, Region Outage Alerts on the Alerting Types tab, enterprise only rows on the Alerting Settings tab, and EMAIL_LOGO_URL and EMAIL_SUPPORT_CONTACT on the Email Alerts tab are locked. Everything else on the page works on any gateway. Logging callbacks that apply to a single team or key are a separate, licensed feature that lives on the team and key settings, not on this page.