How it works
When a new log line matches a saved log-based metric, AppSignal extracts the metric data before dropping the line. The metric remains available for dashboards and triggers, but the matching log line is not stored. The toggle creates a companion filter directly after the metrics action, using the same query and log sources. When you edit the metric in the AppSignal UI, AppSignal updates the filter as well. Disabling the toggle or deleting the metric removes the companion filter.This setting applies only to logs received after it takes effect. It does not remove logs that AppSignal has already stored.
Before you start
- A log source that receives the lines you want to measure
- A query that matches those lines
- For the MCP route, AppSignal MCP set up in your AI agent, with write access to the logging tools
Turn it on with the toggle
- On the Logs page, filter to the lines you want to measure and open one.
- In the Actions section, select Create a metric.
- Name the metric, choose its type, and check the Data preview. Turn on Drop log line after metric extraction, confirm with Drop log lines, and select Create metric.
Before enabling the drop, use the Data preview to confirm that the query matches only the lines you intend to discard.
- Open the Metrics page from the Logging side menu.
- Open the metric’s three-dot menu and select Edit.
- Turn on Drop log line after metric extraction, confirm with Drop log lines, and select Update metric.
Set it up through AppSignal MCP
The MCP tool does not expose the UI toggle. Your agent creates two independent actions instead: a metrics action followed by a filter with the same query and log sources. Because the actions are not linked, update both if you later change the query or sources. AppSignal processes log line actions in order. A filter prevents a matching line from reaching later actions, so the metrics action must run before the filter.Step 1: Record a metric from the lines
Ask your agent to add a metrics action. For example, to count how often shoppers search your catalog:On MyStore production, add a metrics log line action that counts log lines matchingYour agent can callmessage:"Type your message here"as a counter namedlog.catalog_searches, scoped to the application log source.
manage_log_line_action with:
manage_log_line_action reference.
Step 2: Check the metric before you drop anything
After AppSignal receives matching lines, read the metric back:
Show me the log.catalog_searches counter for MyStore production over the last 15 minutes.
Step 3: Drop the matching lines
Add a filter action with the same query:
On MyStore production, add a filter log line action that drops log lines matching message:"Type your message here".
Step 4: Keep the metrics action before the filter
New actions are added at the end of the order, so the filter already runs after the metrics action. Confirm the order:List the log line actions on MyStore production, and keep the metrics action before the filter.Your agent can use
get_app_resources to read the order, then call manage_log_line_action with action: "reorder" if the filter is ahead of the metrics action. If the filter ran first, it would drop the lines before the metrics action counted them.
Verify it works
After AppSignal applies the actions and receives new matching lines, verify the result:- Read the metric and confirm that it contains data from new matching lines.
- Search your logs with the same query. Lines received after the filter took effect should not appear.
Behavior and limitations
- Actions are not retroactive. Logs stored before you created the action stay as they are.
- UI edits keep companion actions aligned. Editing the metric in the AppSignal UI updates its companion filter. Deleting the filter through MCP keeps the metric and disables dropping.
- Actions created through MCP are independent. To measure and drop the same lines, give both actions the same query and log sources, and update both when their configuration changes.
Related
- Log-based metrics, where the toggle lives
- AppSignal MCP, the MCP tool reference, and the log processing workflow
- Ignore logs, to stop sending lines from your integration in the first place