> For the complete documentation index, see [llms.txt](https://developer.sahamati.org.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.sahamati.org.in/sahamatinet-agent-sna/how-sna-works.md).

# How SNA Works

SNA is deployed as a microservice within the AA's Kubernetes cluster. It receives API requests and response data from the AA's service, aggregates SLA metrics according to Sahamati's schema, and pushes aggregated JSON payloads to the Sahamati SLA endpoint every 10 minutes.

### High-Level Data Flow

The data flows through the following stages:

1. AA's service sends and receives API calls to/from FIPs and FIUs.
2. The AA service captures key metadata for every request and response at each integration point (A-H)
3. It sends this information to the SNA running in its cluster.
4. SNA aggregates the required metrics (counts, response times, percentiles, statuses) for each 10-minute window.
5. SNA pushes two JSON payloads to the Sahamati SLA endpoint every 10 minutes: one for Request metrics and one for Notification metrics.

### What SNA Aggregates

| Category             | Type             | Description                                                            |
| -------------------- | ---------------- | ---------------------------------------------------------------------- |
| Request Metrics      | Counts           | Total requests sent per API type, response code counts (2xx, 4xx, 5xx) |
| Request Metrics      | Response Times   | Percentiles (p50, p95, p99, p100) per API type in milliseconds         |
| Request Metrics      | Data Size        | Sum of FI/fetch encrypted data packet sizes                            |
| Notification Metrics | Counts           | Total notifications received per type (FI, Account Link, Consent)      |
| Notification Metrics | Status Breakdown | Ready, Delivered, Denied, Timeout, Pending count for FI notifications  |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.sahamati.org.in/sahamatinet-agent-sna/how-sna-works.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
