Monitor and Debug a Service
Find slow or failing runs, see how a query moved through the pipeline, and check whether the service has enough CPU and memory.
Prerequisites
- You must have read permissions to services. For details, see User Roles and Permissions.
- You must have a service with a published pipeline. For details, see Publish a Pipeline to a Service.
Trace and Debug Queries
A trace is the record of one query's run. It shows each component that ran, its inputs and outputs, its duration, and any errors, so you can find where a run slowed down or failed.
- In Haystack Enterprise Platform, click Gateway in the navigation and open the service.
- Click Traces.
- Open a trace to inspect its steps.
Tracing works the same as for pipelines. For details on reading and filtering traces, see Trace with Built-In Traces.
If queries are slow or fail right after a start or a revision switch, see Troubleshoot Services.
Check Service Metrics
To see how a service performs under load, open its Metrics tab. Use it when a serverless service runs slowly or fails, or before you change its replicas or instance size. The tab is in beta and is available only for serverless services.
- In Haystack Enterprise Platform, click Gateway in the navigation.
- Click the name of the service you want to check.
- Click Metrics.
- Review the CPU usage, memory usage, and replica count charts, grouped by pod.
If the service needs more resources, raise Min replicas or Max replicas, or change its instance size. For steps, see Scale the Service and Control Cost.
Check Live Metrics
To check whether a service's live traffic meets the Evaluation goals of its pipeline, catch goals drifting toward their target, and see which goal causes a failing status, use the Live metrics tab. Before you start, make sure the pipeline has at least one Evaluation goal. To turn live metrics on, you need write access to Services.
- In Haystack Enterprise Platform, click Gateway in the navigation and open the service.
- Click Live metrics.
- If live metrics is off, click Turn on live metrics. Only traffic from this moment on is evaluated, so results appear once enough Sessions have finished and been judged.
- If results haven't appeared yet, read the status line under the tab title. It says what live metrics is waiting on before the next batch, such as new traffic or more Sessions. For what each status means, see Next Batch Status in Live Metrics.
- Select a time range: last 24 hours, 7, 30, or 90 days.
- In the category cards, click the category you want to look at.
- Review the goal cards of the category. Goals marked Causing this status set the status of the category. Hover over a batch on a goal's chart to see its value and how many Sessions it is based on. Click the batch to open its Sessions. To look into a goal that causes a failing status, open the service's traces as described in Trace and Debug Queries.
- To see what judging the range cost and which batches it covers, check Evaluation cost in the panel header. Then, under the goals, expand the batch list to see each batch's window, Sessions, and cost. If the list has more than ten batches, page through it.
If the tab says there are no batches in the time range, pick a longer range or wait until more Sessions have been judged. If it says the service has no Evaluation goals to judge, add a goal to the pipeline, then turn live metrics on. If the tab can't load, click Try again.
When live metrics is off, the tab keeps showing earlier results. Use the time range selector to look further back, or turn live metrics on if the range has no results.
A goal tagged No longer evaluated was removed after the batches shown, because the newest batch didn't judge it. It doesn't count toward the status of its category or the service, so ignore it when you look for the cause of a failing status.
A dash instead of a cost means that the batch, or for the header every batch in the range, could not be priced. It doesn't mean the cost was zero.
For what the statuses, charts, outliers, cost, and batches mean, see Live Metrics.
Change Live Metrics Settings
To change how often live traffic is judged, or to stop live metrics, open the settings dialog. You need write access to Services. The Settings button is next to the time range selector when live metrics is on. When it is off, it is next to Turn on live metrics, so you can set the batch timing before you start.
In the dialog, you can:
- Turn Evaluate live traffic on or off. Turning it off is the way to stop live metrics from the UI. Traffic from while it is off is never evaluated.
- Set the shortest and longest time between batches, in minutes. The longest time must be at least the shortest.
- Set how many new Turns start a batch, and the fewest Sessions a batch needs. The fewest Sessions must be more than zero.
- Set how long to wait after a Session's last activity, in minutes. Zero is allowed.
Click Save. Save stays unavailable until you change a value, and only the values you changed are sent. For what each setting does, see Batch Settings.
If a number is cleared or out of range, enter a valid value and save again. If the platform refuses a change, the dialog stays open and shows the reason in a notification. Correct the value and save again.
Find a Cheaper Configuration with the AI Operator
To find out whether the service can cost less without answering worse, set up an AI Operator for it. The Operator measures the service's cost and answer quality and suggests cheaper configurations that are expected to keep that quality. Suggestions are advisory only: the Operator never applies a change to your service for you.
On the Service page, next to the actions menu, click Set up AI Operator if the service has no Operator yet, or AI Operator to open its existing one. For steps, see Set Up an AI Operator for a Service and Start an Optimization Run.
What To Do Next
- Scale the Service and Control Cost if the metrics show that the service needs more resources.
- Trace with Built-In Traces for more on reading and filtering traces.
Related Information
Was this page helpful?