# newrelic/aws-log-ingestion architecture

> Architecture diagram of the GitHub repository newrelic/aws-log-ingestion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/newrelic/aws-log-ingestion
- Repository: https://github.com/newrelic/aws-log-ingestion

## Overview

This is an AWS Lambda application that ingests CloudWatch Logs and forwards data to New Relic. The main workflow decodes the CloudWatch event and processes it for delivery; the README also documents log and infrastructure ingestion, configurable log formats and tags, and payload size/encoding requirements. The sampled source is partial, so links between processing stages and individual exporters are omitted where their calls are not shown.

Main entry points: [`src/function.py`](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py) (Lambda handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Ingestion"]
  node_handler["Lambda handler<br/>[function.py]"]
  node_decode["Event decoding<br/>[function.py]"]
end

subgraph group_processing["Log processing"]
  node_classification["Entry classification<br/>[function.py]"]
  node_log_processing["Log processing<br/>[function.py]"]
  node_tag_enrichment["Tag enrichment<br/>[function.py]"]
  node_payload_format["Payload formatting<br/>[function.py]"]
end

subgraph group_delivery["New Relic delivery"]
  node_dispatch["Delivery dispatch<br/>[function.py]"]
  node_http_transport["HTTP transport<br/>[function.py]"]
end

node_cloudwatch(("CloudWatch Logs"))
node_infra_endpoint{{"New Relic infrastructure"}}
node_logging_endpoint{{"New Relic logging"}}

node_cloudwatch -->|"invokes"| node_handler
node_handler -->|"decodes"| node_decode
node_handler -->|"invokes"| node_dispatch
node_dispatch -->|"classifies"| node_classification
node_http_transport -.->|"posts data"| node_infra_endpoint
node_http_transport -.->|"posts data"| node_logging_endpoint

click node_handler "https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py"
click node_decode "https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py"
click node_classification "https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py"
click node_log_processing "https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py"
click node_tag_enrichment "https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py"
click node_payload_format "https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py"
click node_dispatch "https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py"
click node_http_transport "https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_handler,node_decode toneBlue
class node_classification,node_log_processing,node_tag_enrichment,node_payload_format toneAmber
class node_dispatch,node_http_transport toneMint
class node_cloudwatch,node_infra_endpoint,node_logging_endpoint toneIndigo
```

## Components

### Ingestion

- [Lambda handler](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py): `src/function.py`
- [Event decoding](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py): `src/function.py`

### Log processing

- [Entry classification](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py): `src/function.py`
- [Log processing](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py): `src/function.py`
- [Tag enrichment](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py): `src/function.py`
- [Payload formatting](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py): `src/function.py`

### New Relic delivery

- [Delivery dispatch](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py): `src/function.py`
- [HTTP transport](https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py): `src/function.py`

### Other components

- **CloudWatch Logs**
- **New Relic infrastructure**
- **New Relic logging**

## Connections

- CloudWatch Logs → Lambda handler: invokes (evidence: `src/function.py`)
- Lambda handler → Event decoding: decodes (evidence: `src/function.py`)
- Lambda handler → Delivery dispatch: invokes (evidence: `src/function.py`)
- Delivery dispatch → Entry classification: classifies (evidence: `src/function.py`)
- HTTP transport → New Relic infrastructure: posts data
- HTTP transport → New Relic logging: posts data
