> For the complete documentation index, see [llms.txt](https://docs.pharos.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pharos.ai/platform-overview/how-pharos-does-it/tracking.md).

# Tracking

Learn about the tracking layer and why it's needed for comprehensive  Salesforce observability.

Tracking is the foundation of observability — without complete data capture, everything else falls apart. The tracking layer ensures that every meaningful event in your Salesforce environment is recorded with sufficient context for investigation — and it covers a broader set of signals than application errors alone: governor-limit and [Event Monitoring](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/monitoring.md) pressure, [metadata changes](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/change-tracking.md), and custom business events, in addition to Apex, Flow, Bulk API, and integration errors.

***

## Why Tracking Matters

Salesforce's native error reporting is fragmented and ephemeral. Pharos replaces that patchwork with persistent, enriched log records stored as native Salesforce objects.

{% tabs %}
{% tab title="❌ The Challenge" %}
**Salesforce's native tracking leaves critical gaps:**

* **Exception emails get deleted** — once they're gone, so is your evidence
* **Debug logs expire after 24 hours** — no long-term visibility into failures
* **Bulk API failures hide in queues** — errors slip through without anyone noticing
* **No unified view of system health** — each error surface tells a different, incomplete story
  {% endtab %}

{% tab title="✅ The Pharos Solution" %}
**Persistent, enriched log records stored as native Salesforce objects:**

* **All errors captured automatically** — zero-config ingestion across all execution contexts
* **Full context preserved** — who was affected, what happened, and why
* **Queryable for analysis and reporting** — standard SOQL, reports, and dashboards
* **Retained based on your compliance requirements** — configurable retention policies by category
  {% endtab %}
  {% endtabs %}

***

## What Gets Tracked

Pharos captures data from three sources: automated collection that works out of the box, custom instrumentation for deeper visibility, and integrations with external systems.

{% tabs %}
{% tab title="⚡ Automated Collection" %}
**Zero configuration required.** Once Pharos is installed, it immediately begins tracking:

* **Apex exceptions** — unhandled errors in triggers, classes, and batch jobs
* **Flow failures** — screen flows, record-triggered flows, and autolaunched flows
* **Bulk API errors** — Data Loader and API batch operation failures
* **Integration errors** — callout failures and timeout errors
* **Scheduled job failures** — batch and scheduled Apex failures
* **Governor-limit and Event Monitoring signals** — pressure and security/usage signals captured via [Monitoring](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/monitoring.md), often before they become failures
* **Metadata changes** — org configuration history captured via [Change Tracking](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/change-tracking.md), so new errors can be correlated with what changed
  {% endtab %}

{% tab title="🛠️ Custom Instrumentation" %}
**For deeper visibility into business processes,** via [Triton](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/logs/log-ingestion-methods/pharos-triton-instrumentation.md), Pharos's open-source instrumentation for Apex, LWC, and Flow:

* **Transaction tracing** — follow execution across LWC → Apex → external systems with one propagated transaction identity
* **Performance monitoring** — track timing and resource consumption
* **Business events** — log custom milestones and state transitions
* **Error handling** — capture handled exceptions with full context
  {% endtab %}

{% tab title="🔗 External Systems" %}
**Integrate errors from middleware and external applications:**

* **Email-to-log** — for Workato, MuleSoft, and custom integrations
* **Platform event publishing** — from external systems into Pharos
* **REST API** — for programmatic log creation from any source
  {% endtab %}
  {% endtabs %}

***

## Enrichment: More Than Just Error Messages

Raw error messages aren't enough to investigate effectively. Pharos automatically enriches every log with the context your team needs to act:

* **User context** — who was running the transaction?
* **Data context** — which records were involved?
* **System state** — governor limits consumed, org configuration at the time
* **Code context** — stack traces with surrounding code lines
* **Temporal context** — when did this start happening, and is it getting worse?

→ [Learn more about log enrichment](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/logs/log-processing/log-enrichment.md)

***

## Storage and Retention

Logs are stored as `Log__c` custom objects in your Salesforce org, which means they inherit the platform's security model and are immediately accessible through standard tools.

* **Benefits** — inherits Salesforce security, queryable via SOQL, API accessible
* **Retention** — configurable based on category, age, and issue linkage
* **Storage impact** — typically less than 1GB per year with automated collection

Tracking data doesn't have to stay native, either. The same signals — Triton application logs and Event Monitoring — can also be exported as [OpenTelemetry](https://docs.pharos.ai/open-telemetry/open-telemetry.md) spans, metrics, and logs to backends like Honeycomb, Splunk, Datadog, or Grafana *(early-access capability)*, so Salesforce telemetry can sit alongside the rest of your enterprise stack.

→ [Learn more about log storage](https://docs.pharos.ai/platform-overview/pharos-platform-architecture/logs/log-storage.md)

***

## The Foundation for Everything Else

Comprehensive tracking is what makes the rest of the Pharos loop possible:

* **Issue grouping** — multiple logs clustered into issues via fingerprinting
* **Impact analysis** — understanding scope and severity across users and objects
* **Trend analysis** — identifying patterns and regressions over time
* **Root cause analysis** — having the data needed for thorough investigation

{% hint style="info" %}
Without solid tracking, you're working blind. With Pharos, you have complete visibility — and that visibility powers every stage that follows.
{% endhint %}

{% hint style="success" %}
**Next Step:** Learn how [Awareness](https://docs.pharos.ai/platform-overview/how-pharos-does-it/awareness.md) transforms tracked errors into actionable alerts.
{% endhint %}
