Skip to main content
ComponentsEngine

What GermainUX Watches

Apex, errors, debug logs and deployments

Find the Cause

From slow saves to the line of code

Alert and Act

Catch the next one sooner

Set It Up

Salesforce, MCP Server and your IDE

Overview

A release goes out in the morning. An hour later, sales reps say that saving an Opportunity takes ages, and some of them get an error on the pricing panel. The developer has the code open in their IDE, but not what production did: which saves slowed down, which exception was thrown, and on which line. That evidence is spread across Salesforce. Event Monitoring log files, debug logs, the Setup Audit Trail and deployment history each sit on their own screen, and the developer has to download, open and compare them by hand. Meanwhile, the assistant in their IDE can read the code but has never seen production. GermainUX collects all of it, from Apex executions and exceptions to debug logs and deployments. With the GermainUX MCP Server, the developer’s coding assistant reads that data in the same conversation as the code. It finds the deployment that started the slowdown, reads the exception and its stack trace, confirms the cause in the debug logs and opens the line in the repo. It then proposes the fix and, after the hotfix, checks that production is back to normal.
Slow SavesThe DeploymentThe ExceptionThe Debug LogThe Code FixFix Confirmed
This page uses Salesforce Sales Cloud, Claude Code and an SFDX project as the example. The same approach works for any application GermainUX monitors down to the code, and any coding assistant that connects to the MCP Server, such as Cursor or GitHub Copilot in VS Code. When the question starts from one customer’s complaint rather than a release, see Complaint Investigation with MCP.

Questions It Answers

  • Did this morning’s deployment slow down Opportunity saves, and by how much?
  • What did the deployment change, and who deployed it?
  • Which exception do users hit, and which line of Apex throws it?
  • Is it our code, or Salesforce, the network or the pricing API?
  • What’s the fix, based on what production actually did?
  • Is it fixed?

What GermainUX Watches

The assistant answers from the same KPIs the Workspace shows. The Salesforce Engine monitors collect them through the Salesforce APIs, with nothing to install in the org. See Salesforce Monitoring KPIs for the full list.

Find the Cause

The investigation runs in one conversation, in the IDE where the code is:
  1. Ask what changed in production after the deployment. The assistant compares the slow saves with the same hours on the previous days and lines them up with the deployments and Setup changes.
  2. Read the exception users hit and its stack trace, down to the class and line.
  3. Confirm the cause in a debug log: what the execution did, query by query.
  4. Rule out what stayed normal: other objects, external APIs and Salesforce itself.
  5. Open the line in the repo and fix it, then ask again after the hotfix to confirm it worked.
See Example Prompts for how the assistant uses the MCP tools, and Available Tools for the full list. The example below comes from simulated data, and its numbers belong to the example. All times are in UTC.

Example: A Release Puts a SOQL Query in a Loop

At 08:40 on Friday, Nov 13, a deployment changes OpportunityPricingService, its test class and OpportunityTrigger. Since that release, the service reads the pricebook entry of each line item with its own query. An Opportunity with many products now runs dozens of queries on every save, and the biggest ones hit Salesforce’s limit of 100 queries per transaction. The developer reproduces it with a trace flag on their own user, then opens the SFDX project in VS Code and asks Claude Code.
1

Ask what changed after the deployment

Ask: “Opportunity saves have been slow since this morning’s release. Compare Apex executions on Nov 13 from 06:00 to 12:00 UTC with the same hours on the previous days, by entry point, and tell me which deployment or Setup change lines up with it. Stay within that window.”The assistant queries Salesforce Log Apex Execution by entry point for both periods (query_kpi), then Deployment Run and Salesforce Setup Audit for the same morning. In this example, the slowdown comes from one entry point, OpportunityPricingController.recalculate. It takes 5.96 seconds on average and runs 54 SOQL queries per call, against 0.72 seconds and 4 queries on the previous days. The other entry points keep their usual times. Hour by hour, the slowdown starts at 09:00.The match is the Salesforce deployment at 08:40, and the Setup Audit Trail records a changed Apex class and trigger at 08:44. The other releases that morning belong to other applications. Because the repo is open in the IDE, the assistant also names the commit that most likely went out with the deployment, 1b46bb0, which replaced one bulk PricebookEntry query with one query per product.
Claude Code answer: on Nov 13 from 06:00 to 12:00 UTC, OpportunityPricingController.recalculate went from 0.72 to 5.96 seconds and from 4 to 54 SOQL queries per call, about 8 times slower from 09:00, while RecordSaveController.save and CaseAssignmentHandler.assign didn't change. It lines up with the Salesforce deploy at 08:40 UTC and the Apex class and trigger changes at 08:44, the other releases are unrelated, and commit 1b46bb0 is the likely cause

Slow Saves Since the Deployment - Claude Code

In the Workspace, deployments and Apex exceptions show as markers on the Apex executions. In this example, Opportunity saves average 6.0 seconds from 06:00 to 18:00, against 0.72 seconds at the same hours on the previous days. Execution times jump after the 08:40 deployment marker, exception markers bunch up between it and the hotfix marker in the afternoon, and execution times drop back after the hotfix.
Analysis of Salesforce Log Apex Execution for the Opportunity pricing controller from 06:00 to 18:00 UTC on Nov 13: 6.011 seconds on average against 0.724 seconds on the previous days, and a Relationships chart from Nov 11 to Nov 15 with execution times and Apex exception markers high between the Nov 13 deployment markers

Opportunity Saves Between the Deployment and the Hotfix - GermainUX

Hover the 08:40 marker to see the deployment’s details: who ran it, its status, and the components it changed.
Apex Execution analysis with the 08:40 UTC Deployment Run marker on Nov 13 hovered: a 312-second deploy of 3 components, status Succeeded, with the details listing OpportunityPricingService among the components

Deployment Marker Details - GermainUX

2

Read the exception

Ask: “Which exceptions did users hit on Opportunities in that window? Show the stack trace and how many users were affected.”The assistant queries Salesforce Log Apex Unexpected Exception and Salesforce Log Lightning Error for the same window (query_kpi). In this example, System.LimitException: Too many SOQL queries: 101 is thrown 6 times, for 4 users. Its stack trace runs from OpportunityTrigger line 12, through OpportunityPricingService.recalculate line 88, to OpportunityPricingService.loadPrices line 214. The assistant finds the users by matching each exception with the Lightning error a user saw at the same moment. When an Opportunity has enough line items to go past 100 queries, the whole save fails.
Claude Code answer: System.LimitException Too many SOQL queries: 101, 6 times for 4 users on Nov 13 between 06:00 and 12:00 UTC, with the stack trace OpportunityPricingService.loadPrices line 214, recalculate line 88 and OpportunityTrigger line 12, a table of the users and times matched through Lightning errors, and two pricing callout timeouts in the same window

The Exception and Its Stack Trace - Claude Code

3

Confirm it in the debug log

Ask: “The trace flag was on my user, sam.okafor@acme.example, from 10:05 to 11:50 UTC on Nov 13. What do my debug logs show for the Opportunity saves?”The assistant queries the debug log KPIs, such as Salesforce Code Execution, Salesforce Code SOQL Execution and Salesforce Code Exception, for that user (query_kpi, search_kpi_facts). In this example, each of the 12 traced saves takes about 5 seconds, almost all of it in OpportunityTrigger on the before-update event. Each one runs 101 PricebookEntry queries, about 40 milliseconds apart, and ends in System.LimitException. Each query is fast. The save is slow, and then fails, because of how many there are. See SOQL Execution for what a debug log records.
Claude Code answer: 12 debug logs between 10:05 and 11:40 UTC, each taking 4.5 to 5.1 seconds, almost all in OpportunityTrigger on the before-update event, each running 101 SELECT queries on PricebookEntry about 40 milliseconds apart and ending in System.LimitException, matching the per-product query in loadPrices from commit 1b46bb0

101 Queries per Save in the Debug Log - Claude Code

4

Rule out the rest

Ask: “Before I change the code, is anything else behind it? Check the pricing API callouts, Salesforce’s instance status and other deployments on Nov 13 up to 12:00 UTC.”In this example, nothing else lines up with the slowdown. Calls to the pricing API average 0.34 seconds against 0.25 on the previous days, a small rise that started before the slowdown, and none fail (query_kpi on Salesforce Log Apex Callout). Each save makes at most one call, so the API accounts for well under a second of the 5 to 6 seconds. Salesforce Instance Status is OK at every check. The 08:40 deployment is the only Salesforce code change that morning. The cause is in the code it changed.
Claude Code answer for Nov 13 up to 12:00 UTC: pricing API callouts at 0.34 seconds against 0.25 on earlier days with none failed, Salesforce instance status OK at every check, and the 08:40 Salesforce deploy as the only Salesforce code change, with the portal and Help Center releases on other systems

Nothing Else Lines Up - Claude Code

5

Fix the code

Ask: “Open loadPrices in OpportunityPricingService.cls and fix it so a save runs one pricebook query, whatever the number of line items. Show me what the release changed first.”The assistant shows what commit 1b46bb0 changed: it replaced one bulk PricebookEntry query with one query per product, and dropped the IsActive = true filter. The fix reads the prices of every product on the line items, across all the Opportunities in the save, in one query, and restores the filter. recalculate now calls it once, before the loop over the Opportunities. Prices still come from the pricebook at save time, which is what the release wanted:
OpportunityPricingService.cls
The assistant edits the code but doesn’t compile or test it. Run the tests in a sandbox before you deploy the hotfix.
Claude Code answer: what commit 1b46bb0 changed, the bulk PricebookEntry query replaced by one query per product without the IsActive filter, and the fix, loadPrices at OpportunityPricingService.cls line 209 running one query with Pricebook2Id IN and Product2Id IN and IsActive true, called once from recalculate at line 85

The Fix, Based on What Production Did - Claude Code

6

Confirm the fix

After the hotfix is deployed at 14:40, ask: “Are Opportunity saves back to normal since the 14:40 deployment? Any more limit exceptions?”In this example, Apex executions are back to about half a second from the hotfix on, no execution runs more than 7 queries, and no LimitException has been thrown since, up to the latest data on Nov 17. In the Workspace, the execution times drop at the hotfix marker on the chart above.
Claude Code answer: saves back to normal after the 14:40 UTC deploy, with Apex executions at 0.2 to 0.57 seconds and at most 7 SOQL queries from Nov 13 afternoon to Nov 17, against 1.9 to 3.7 seconds and 26 to 34 queries during the incident, and no LimitException since

Saves Before and After the Hotfix - Claude Code

Hover the 14:40 marker to see that the hotfix changed only OpportunityPricingService. To hover a deployment marker that an exception marker covers, click Salesforce Log Apex Unexpected Exception in the chart legend to hide the exceptions.
Apex Execution analysis with the 14:40 UTC Deployment Run marker on Nov 13 hovered and the exception markers hidden: a deploy of OpportunityPricingService only, status Succeeded, with the details listing one component

Hotfix Marker Details - GermainUX

The developer fixed the cause, not the symptom, without downloading a log file or leaving the IDE. To see the same slow save next to a normal one in the Workspace, see Compare a Slow Save with a Normal One.

Alert and Act

Users noticed this release before the team did. To catch the next one sooner:
  • SLAs and outlier detection on the duration of Apex executions, per entry point, so a release that slows one save raises an alert
  • Alerts on new Apex exceptions such as System.LimitException, by email, Microsoft Teams or Slack
  • Alerts on Setup changes for Apex code changed in production, so the team knows a release landed
  • A post-release check in your IDE: right after each deployment, ask the assistant to compare the classes it changed with the same hours on the previous days

Set It Up

Each step adds value on its own. The assistant can answer more questions the more of the org GermainUX monitors.
1

Monitor the Salesforce org

Run the Salesforce wizard to deploy Salesforce Engine monitoring. It collects Event Monitoring logs, deployments, Setup changes, code and instance status. Event Monitoring data arrives about an hour after each hour ends, and deployments with the next Audit Monitor run. See Collection Schedule and API Usage.
2

Collect debug logs

Set a trace flag in Salesforce on the user that reproduces the problem, then let Debug Log Monitoring collect the logs. GermainUX collects only the debug logs Salesforce generates.
3

Show deployments on the timeline

Configure KPI relationships from Salesforce Log Apex Execution and your other Apex KPIs to Deployment Run, shown as markers. Every chart of those KPIs then shows when a deployment landed.
4

Enable the MCP Server for developers

Enable the MCP Server and give the developers a GermainUX account with access to the org’s data. Every tool call runs as the signed-in user, so developers see only what their account allows. See What users can see and do.
5

Connect the coding assistant

Connect the coding assistant the developers use, such as Claude Code, Cursor or GitHub Copilot in VS Code, to the GermainUX MCP Server. Open the SFDX project in the same IDE, so the assistant reads production data and the code side by side.

Additional Resources

MCP Server

Connect AI assistants to GermainUX

Salesforce Engine Monitoring

Deploy monitoring through the Salesforce APIs

Use Cases

More Use Cases

Get Help

Every Salesforce team has its own release process, trace-flag habits and coding tools. The GermainUX team can help you deploy Salesforce Engine monitoring, bring your deployments onto the timeline, and set up the MCP Server for your developers.

Contact GermainUX Support

The GermainUX team helps you get up and running faster, empower your team, turn data into actionable insights, and optimize performance to deliver measurable business outcomes.

Can't Find What You Need?

Search all GermainUX docs with Ctrl + K, or use the feedback buttons at the bottom of this page to tell us what is missing.

The content of this document is proprietary to GERMAIN SOFTWARE.