# getsentry/symbolicator architecture

> Architecture diagram of the GitHub repository getsentry/symbolicator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/getsentry/symbolicator
- Repository: https://github.com/getsentry/symbolicator

## Overview

##### Main Components

a. Core Services Layer:
- Symbolication Services (Native, JS, ProGuard)
- Process Event Service
- Source Context Service
- Cache Management System

b. External Interfaces:
- HTTP API Endpoints
- Symbol Server Integration
- File System Interface
- Cloud Storage (GCS, S3)

c. Caching Infrastructure:
- Shared Cache System
- Memory Cache
- File System Cache
- Source Files Cache

##### Component Relationships

**[Client Requests] → [API Endpoints Layer]**
- ↓
**[Service Layer] → [Symbolication Engines]**
- ↓
**[Cache Layer] ←→ [Storage Systems]**
- ↓
**[External Sources] (Symbol Servers, Cloud Storage)**

##### Specific Implementation Details

a. API Endpoints (show as entry points):
- /minidump
- /symbolicate
- /applecrashreport
- /proxy
- /symbolicate-js
- /symbolicate-jvm

b. Symbolication Engines (show as processing units):
- Native Symbolication
- JavaScript Symbolication
- ProGuard Symbolication
- Source Context Processing

c. Caching System (show as a layered structure):
- Memory Cache
- File System Cache
- Shared Cache
- Source Files Cache

##### Integration Points

Connections with:
- Symbol Servers
- Cloud Storage (GCS/S3)
- Sentry Integration
- File System Access

##### Key Features to Emphasize

- Parallel Processing Capabilities
- Caching Mechanisms
- Source Bundle Support
- Multiple Format Support (minidumps, native stacktraces)

##### Additional Notes

- Version/cache management flows
- Error handling paths
- Async processing flows
- Critical paths for performance

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef api fill:#FFA07A,stroke:#FF6347
    classDef core fill:#4682B4,stroke:#4169E1
    classDef cache fill:#98FB98,stroke:#32CD32
    classDef storage fill:#DDA0DD,stroke:#9370DB
    classDef external fill:#D3D3D3,stroke:#A9A9A9

    %% Client and Entry Points
    Client(("Client"))
    subgraph API["API Endpoints Layer"]
        Minidump["/minidump"]:::api
        Symbolicate["/symbolicate"]:::api
        AppleCrash["/applecrashreport"]:::api
        Proxy["/proxy"]:::api
        SymbolicateJS["/symbolicate-js"]:::api
        SymbolicateJVM["/symbolicate-jvm"]:::api
    end

    %% Core Services
    subgraph Services["Core Services Layer"]
        NativeSymb["Native Symbolication"]:::core
        JSSymb["JavaScript Symbolication"]:::core
        ProGuardSymb["ProGuard Symbolication"]:::core
        ProcessEvent["Process Event Service"]:::core
        SourceContext["Source Context Service"]:::core
    end

    %% Caching Layer
    subgraph Caching["Caching Infrastructure"]
        SharedCache["Shared Cache"]:::cache
        MemCache["Memory Cache"]:::cache
        FSCache["File System Cache"]:::cache
        SourceCache["Source Files Cache"]:::cache
    end

    %% External Storage
    subgraph Storage["Storage Systems"]
        GCS["Google Cloud Storage"]:::storage
        S3["Amazon S3"]:::storage
        FileSystem["File System"]:::storage
    end

    %% External Services
    subgraph External["External Services"]
        SymbolServers["Symbol Servers"]:::external
        SentryIntegration["Sentry Integration"]:::external
    end

    %% Connections
    Client --> API
    Minidump & Symbolicate & AppleCrash --> ProcessEvent
    SymbolicateJS --> JSSymb
    SymbolicateJVM --> ProGuardSymb
    ProcessEvent --> NativeSymb
    NativeSymb & JSSymb & ProGuardSymb --> SourceContext
    SourceContext --> Caching
    Caching <--> Storage
    Caching <--> External

    %% Click events for component mapping
    click NativeSymb "https://github.com/getsentry/symbolicator/tree/master/crates/symbolicator-native/"
    click JSSymb "https://github.com/getsentry/symbolicator/tree/master/crates/symbolicator-js/"
    click ProGuardSymb "https://github.com/getsentry/symbolicator/tree/master/crates/symbolicator-proguard/"
    click ProcessEvent "https://github.com/getsentry/symbolicator/tree/master/crates/process-event/"
    click SourceContext "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator-service/src/source_context.rs"
    click SharedCache "https://github.com/getsentry/symbolicator/tree/master/crates/symbolicator-service/src/caching/shared_cache/"
    click MemCache "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator-service/src/caching/memory.rs"
    click FSCache "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator-service/src/caching/fs.rs"
    click Minidump "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator/src/endpoints/minidump.rs"
    click Symbolicate "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator/src/endpoints/symbolicate.rs"
    click AppleCrash "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator/src/endpoints/applecrashreport.rs"
    click Proxy "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator/src/endpoints/proxy.rs"
    click SymbolicateJS "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator/src/endpoints/symbolicate_js.rs"
    click SymbolicateJVM "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator/src/endpoints/symbolicate_jvm.rs"
    click GCS "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator-service/src/download/gcs.rs"
    click S3 "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator-service/src/download/s3.rs"
    click FileSystem "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator-service/src/download/filesystem.rs"
    click SentryIntegration "https://github.com/getsentry/symbolicator/blob/master/crates/symbolicator-sources/src/sources/sentry.rs"

    %% Legend
    subgraph Legend
        API_L["API Endpoints"]:::api
        Core_L["Core Services"]:::core
        Cache_L["Cache Components"]:::cache
        Storage_L["Storage Systems"]:::storage
        External_L["External Services"]:::external
    end
```
