> ## Documentation Index
> Fetch the complete documentation index at: https://docs.germainux.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Apex Code Monitoring for Salesforce Cloud (Configure)

> GermainUX monitors Salesforce Apex classes, triggers, source code, and test-coverage statistics.

Components
[`Engine`](https://docs.germainux.com/main/germain-ux-engine)

Availability
2017.1 or later

> [card] [Prerequisites](#prerequisites)
>
> Setup before enabling Apex

> [card] [Disable Apex Code Monitoring](#disable-apex-code-monitoring)
>
> Stop Apex collection only

> [card] [View the Salesforce Code Dashboard](#view-the-salesforce-code-dashboard)
>
> Explore Apex metrics and records

> [card] [Data Is Out of Date](#data-is-out-of-date)
>
> Fix stale Apex information

## Overview

GermainUX monitors Salesforce Apex classes, triggers, source code, and test-coverage statistics.

This helps development and operations teams:

* Maintain an inventory of Apex classes and triggers
* Review Apex source code from GermainUX
* Track test coverage
* Identify untested or insufficiently tested code
* Detect code and coverage changes over time
* Correlate Apex code information with related Salesforce issues
* Review supporting evidence during root-cause analysis

Apex Code Monitoring is performed by the **GermainUX Engine** and is enabled automatically when Salesforce monitoring is deployed through the Salesforce Application wizard.

> [!NOTE]
>
> This feature collects Apex code metadata and test-coverage information on a schedule. For runtime exceptions, debug logs, or transaction-level performance, also configure the corresponding Salesforce monitoring features.

## Prerequisites

Before configuring Apex Code Monitoring, confirm that:

* A GermainUX Engine is deployed and running.
* Salesforce monitoring has been deployed through the GermainUX Salesforce Application wizard.
* The Salesforce OAuth connection is active.
* The integration user can access the required Apex metadata and test-coverage information.
* The selected GermainUX Engine can reach the Salesforce APIs.
* The Salesforce organization has sufficient API capacity for the configured collection frequency.

For the initial integration, see [Deploy GermainUX for Salesforce](https://docs.germainux.com/main/salesforce-monitoring-deployment.md).

## Enable Apex Code Monitoring

Apex Code Monitoring is enabled automatically during the initial Salesforce Application wizard deployment.

To deploy it:

1. Open **GermainUX Workspace**.
2. Open the left navigation menu.
3. Select **Wizards**.
4. Select **Salesforce Application**.
5. Choose the GermainUX Engine that will monitor Salesforce.
6. Enter the Salesforce connection and authentication settings.
7. Expand **Show Advanced** if you need to customize the collection interval.
8. Set **Code Monitoring Interval**.

   ![Code Monitoring Interval settings](https://mintcdn.com/germain-ux/BTxCucYnGj_ffpsA/images/main/salesforce-code-monitoring/image-20230330-102847.png?fit=max\&auto=format\&n=BTxCucYnGj_ffpsA\&q=85\&s=f5d8a0301a7022c1b8380a3f2fa04a50)

   Code Monitoring Interval settings- GermainUX
9. Complete the wizard.

The wizard creates a component with this type:

```text theme={null}
Salesforce Code Monitor
```

## Default Collection Frequency

By default, Apex Code Monitoring runs once per day.

Daily collection is appropriate for most environments because Apex source and test-coverage information usually changes only when code is deployed or tests run.

Use a more frequent schedule only when the additional freshness justifies the increased Salesforce API usage and GermainUX processing.

## Configure the Frequency During Initial Deployment

When running the Salesforce Application wizard:

**1. Select Show Advanced**

**2. Locate Code Monitoring Interval**

**3. Enter the required execution frequency**

**4. Complete the wizard**

The configured interval determines how often GermainUX refreshes Apex class, trigger, and test-coverage information.

## Change the Frequency After Deployment

To modify the schedule of an existing monitor:

1. Open **GermainUX Workspace**.
2. Open the left navigation menu.
3. Select **Germain**.
4. Open the **State** tab.
5. Search for: `Type Name = Salesforce Code Monitor `
6. Select the applicable monitor.
7. Update **Execution Schedule**.

   ![Execution Schedule configuration for SFDC Instance Status component](https://mintcdn.com/germain-ux/BTxCucYnGj_ffpsA/images/main/salesforce-code-monitoring/image-20230329-120617.png?fit=max\&auto=format\&n=BTxCucYnGj_ffpsA\&q=85\&s=3ff6c858f269e45a3016f4f5772abe36)
8. Save the change.

Confirm that the schedule is appropriate for the Salesforce organization’s deployment cadence and API limits.

## Disable Apex Code Monitoring

To stop ongoing Apex code collection without removing the entire Salesforce integration:

1. Open **GermainUX Workspace**.
2. Open the left navigation menu.
3. Select **Germain**.
4. Open the **State** tab.
5. Search for: `Type Name = Salesforce Code Monitor `

   ![Salesforce Code Monitor](https://mintcdn.com/germain-ux/BTxCucYnGj_ffpsA/images/main/salesforce-code-monitoring/image-20230330-102655.png?fit=max\&auto=format\&n=BTxCucYnGj_ffpsA\&q=85\&s=a6a3fc69372251c9c9f8531661e70b77)

   Salesforce Code Monitor - GermainUX
6. Locate the monitor associated with the intended Salesforce organization.
7. Turn off the toggle in the **Enabled** column.
8. Save the change if prompted.

Disabling the monitor stops future collection. Previously collected Apex information remains available according to the configured GermainUX retention policy.

## Re-enable Monitoring

To resume collection:

**1. Return to Germain → State**

**2. Search for `Salesforce Code Monitor`**

**3. Turn on the Enabled toggle**

**4. Confirm the execution schedule**

**5. Save the configuration**

**6. Allow the next scheduled execution to run**

## Information Collected

Depending on Salesforce permissions and available APIs, Apex Code Monitoring can collect information about:

* Apex class names
* Apex trigger names
* Source content
* Code size and related metadata
* Test-coverage statistics
* Covered and uncovered code
* Changes detected during subsequent collections
* Organization and environment context

This information can be segmented and analyzed by available dimensions such as:

* Salesforce organization
* Class
* Trigger
* Namespace
* Collection time
* Coverage level
* Code version or deployment period

## Apex Code KPIs

The resulting KPIs help analyze Apex code inventory and test coverage.

See Apex Code KPIs for Salesforce.

Use these KPIs to identify:

* Apex classes with low test coverage
* Triggers with insufficient coverage
* Coverage regressions
* Newly introduced or modified code
* Code that requires additional review or testing
* Differences between Salesforce environments

## View the Salesforce Code Dashboard

Open:

Dashboards
IT
Application
Salesforce
Salesforce Code

The dashboard can provide:

* Apex class and trigger inventory
* Test-coverage measures
* Trends over time
* Breakdown by class or trigger
* Access to individual records
* Drill-through to supporting Apex details

Select any relevant metric or record to open its detailed analysis.

## Analyze Apex Source During Root-Cause Analysis

Apex class content collected by the monitor can be made available during analysis.

This helps teams:

**1. Detect an affected Salesforce KPI or issue**

**2. Identify the related Apex class or trigger**

**3. Open the corresponding instance or analysis view**

**4. Review available code and coverage information**

**5. Correlate it with exceptions, debug logs, user interactions, SOQL activity, or integration delays**

**6. Determine whether additional testing, code changes, or deployment validation is required**

Apex Code Monitoring provides code inventory and coverage context. Runtime execution evidence requires the applicable exception, debug-log, or transaction-monitoring configuration.

## Validate Apex Code Monitoring

After the first scheduled execution, verify that:

* The `Salesforce Code Monitor` component is enabled.
* Its most recent execution completed successfully.
* The next execution time matches the configured schedule.
* Apex classes appear in the Salesforce Code dashboard.
* Apex triggers appear.
* Test-coverage statistics are populated.

> [accordion] Show all 9
>
> * The expected Salesforce organization is identified.
> * The integration user can access all intended Apex metadata.
> * No authentication, authorization, API-limit, or network errors appear in the Engine logs.

## No Apex Data Appears

If the monitor runs but no Apex information is available:

**1. Confirm that the correct Salesforce organization is configured**

**2. Verify the OAuth connection**

**3. Confirm that the integration user can access Apex metadata and test-coverage data**

**4. Check that `Salesforce Code Monitor` is enabled**

**5. Review its execution schedule and last-run status**

**6. Confirm that the selected GermainUX Engine is running**

**7. Check connectivity from the Engine to Salesforce**

**8. Review Engine logs for Salesforce API errors**

**9. Check the Salesforce organization’s API usage and limits**

**10. Confirm that Apex classes, triggers, and coverage records exist in the organization**

## Data Is Out of Date

If Apex information is present but not current:

**1. Check the monitor’s last successful execution**

**2. Confirm the configured Execution Schedule**

**3. Verify that recent executions did not fail**

**4. Review OAuth-token and Salesforce API errors**

**5. Confirm that Salesforce test coverage was recalculated after the latest code or test changes**

**6. Increase the monitoring frequency only if required and operationally acceptable**

## Related Documentation

> [card] [Dashboard & Reports](https://docs.germainux.com/main/dashboard-and-report.md)
>
> Dashboard & Reports

> [card] [AI](https://docs.germainux.com/main/ai-driven-insights.md)
>
> Insights & Recommendations

> [card] [Analytics](https://docs.germainux.com/main/analytics.md)
>
> More Analytics Features

> [card] [Automation](https://docs.germainux.com/main/automation.md)
>
> More Automation Features

## Get Help

> [card] [Contact GermainUX Support](https://docs.germainux.com/main/support.md)
>
> 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.

> [card] 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.