# BDOT Collector Architecture

Both Fargate and EC2 deployment options include:

* **VPC with Public Subnets** - Network isolation with internet access
* **Security Groups** - Controlled access to collector ports (`4317` and `4318`)
* **CloudWatch Logging** - Centralized logging and monitoring
* **Auto Scaling** - Automatic scaling based on demand

### Key Features

#### Container Configuration

* **BDOT Collector Image**: `ghcr.io/observiq/bindplane-agent`
* **OpAMP Protocol**: Connects to Bindplane Server via OpAMP
* **Automatic Configuration**: Receives configurations from Bindplane Server
* **Persistent Storage**: Maintains manager.yaml configuration

#### Ports and Services

* `4317`: OTLP gRPC receiver
* `4318`: OTLP HTTP receiver

#### Environment Variables

* `OPAMP_ENDPOINT`: Bindplane Server OpAMP endpoint
* `OPAMP_SECRET_KEY`: Collector authentication key
* `OPAMP_LABELS`: Collector labels for identification

### Prerequisites

Before deploying, ensure you have:

1. **AWS CLI v2.x** installed and configured
2. **Valid AWS account** with appropriate permissions
3. **Bindplane Server** running (self-hosted or cloud)
4. **Collector secret key** from your Bindplane Server

### Getting Your Secret Key

1. Navigate to your Bindplane Server UI
2. Go to **Agents** → **Install Agent**
3. Choose **Linux** platform
4. Copy the `secret-key` from the installation instructions

### Configuration

#### OpAMP Endpoint URLs

* **Bindplane Cloud**: `wss://app.bindplane.com/v1/opamp`
* **Self-hosted (HTTP)**: `ws://your-server:3001/v1/opamp`
* **Self-hosted (HTTPS)**: `wss://your-server:443/v1/opamp`

### Monitoring and Troubleshooting

#### CloudWatch Logs

```bash
# View collector logs
aws logs tail /ecs/collector --follow
```

#### Common Issues

1. **Collector not appearing**: Check OpAMP endpoint and secret key
2. **Connection failures**: Verify network connectivity and security groups
3. **High resource usage**: Scale up resources or add more instances

### Scaling

#### Manual Scaling

```bash
# Update desired count
aws ecs update-service \
  --cluster your-cluster \
  --service collector-service \
  --desired-count 3
```

#### Auto Scaling

Both deployment options support Application Auto Scaling for automatic scaling based on CPU/memory utilization.


---

# Agent Instructions: 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:

```
GET https://docs.bindplane.com/deployment/aws/bindplane-otel-collector/bdot-collector-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
