Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions docs/examples/collectionagent/docker/compose/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Docker Compose (Collection Agent)

| Field | Value |
| --- | --- |
| **Kind** | `CollectionAgent` |
| **Mode** | `docker` |
| **Flavor** | `compose` |
| **Platform** | `-` |

## Overview

Runs an OpenTelemetry collector as a Docker Compose service that ships host metrics, container metrics, and container logs to a remote SigNoz endpoint.

## Prerequisites

- Docker Engine 20.10+
- Docker Compose v2
- A reachable SigNoz endpoint (SigNoz Cloud, or a self-hosted ingester)

## Configuration

```yaml
apiVersion: v1alpha1
kind: CollectionAgent
metadata:
name: signoz
spec:
deployment:
flavor: compose
mode: docker
collector:
kind: agent
spec:
env:
SIGNOZ_INGESTION_ENDPOINT: https://ingest.<region>.signoz.cloud:443
SIGNOZ_INGESTION_KEY: <your-ingestion-key>
```

Replace `<region>` and `<your-ingestion-key>` with your SigNoz Cloud values. For a self-hosted ingester, point `SIGNOZ_INGESTION_ENDPOINT` at it and omit `SIGNOZ_INGESTION_KEY` — the rendered exporter skips the ingestion header when the key is unset.

## Deploy

```bash
foundryctl cast -f casting.yaml
```

Or step by step:

```bash
# Validate prerequisites
foundryctl gauge -f casting.yaml

# Generate compose files
foundryctl forge -f casting.yaml

# Start the agent
cd pours/collectionagent && docker compose up -d
```

## Generated output

```text
pours/collectionagent/
compose.yaml
collector/
agent/
agent.yaml
```

## After deployment

```bash
# Check the collector container
docker ps --filter name=signoz-collectionagent-collector

# Tail collector logs
docker compose -f pours/collectionagent/compose.yaml logs -f

# Stop the agent
cd pours/collectionagent && docker compose down
```

## Customization

Override the collector image, replicas, or env vars in `spec.collector.spec`. For platform-level changes to the generated `compose.yaml` or `agent.yaml` (memory limits, batch tuning, extra receivers, etc.), use [patches](../../../../concepts/patches.md).
14 changes: 14 additions & 0 deletions docs/examples/collectionagent/docker/compose/casting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1alpha1
kind: CollectionAgent
metadata:
name: signoz
spec:
deployment:
flavor: compose
mode: docker
collector:
kind: agent
spec:
env:
SIGNOZ_INGESTION_ENDPOINT: https://ingest.<region>.signoz.cloud:443
SIGNOZ_INGESTION_KEY: <your-ingestion-key>
257 changes: 257 additions & 0 deletions docs/examples/collectionagent/docker/compose/casting.yaml.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
apiVersion: v1alpha1
kind: CollectionAgent
metadata:
name: signoz
spec:
collector:
kind: agent
spec:
cluster:
replicas: 1
config:
data:
collector/agent/agent.yaml: |
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
docker_stats:
collection_interval: 10s
endpoint: unix:///var/run/docker.sock
timeout: 20s
filelog:
include:
- /var/lib/docker/containers/*/*-json.log
include_file_name: false
include_file_path: true
operators:
- add_metadata_from_filepath: false
format: docker
id: container-parser
type: container
start_at: end
hostmetrics:
collection_interval: 60s
root_path: /hostfs
scrapers:
cpu: {}
disk: {}
filesystem: {}
load: {}
memory: {}
network: {}
paging: {}
process:
mute_process_exe_error: true
mute_process_io_error: true
mute_process_name_error: true
mute_process_user_error: true
processes: {}

processors:
memory_limiter:
check_interval: 5s
limit_mib: 4000
spike_limit_mib: 800
resourcedetection:
detectors:
- env
- system
- docker
timeout: 5s
batch: {}

exporters:
otlphttp:
endpoint: ${env:SIGNOZ_INGESTION_ENDPOINT}
headers:
signoz-ingestion-key: ${env:SIGNOZ_INGESTION_KEY}

service:
pipelines:
traces:
receivers:
- otlp
processors:
- memory_limiter
- resourcedetection
- batch
exporters:
- otlphttp
metrics:
receivers:
- otlp
- docker_stats
- hostmetrics
processors:
- memory_limiter
- resourcedetection
- batch
exporters:
- otlphttp
logs:
receivers:
- otlp
- filelog
processors:
- memory_limiter
- resourcedetection
- batch
exporters:
- otlphttp
enabled: true
env:
OTEL_COLLECTOR_ROLE: agent
SIGNOZ_INGESTION_ENDPOINT: https://ingest.<region>.signoz.cloud:443
SIGNOZ_INGESTION_KEY: <your-ingestion-key>
image: otel/opentelemetry-collector-contrib:v0.139.0
version: v0.139.0
status:
config:
data:
collector/agent/agent.yaml: |
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
docker_stats:
collection_interval: 10s
endpoint: unix:///var/run/docker.sock
timeout: 20s
filelog:
include:
- /var/lib/docker/containers/*/*-json.log
include_file_name: false
include_file_path: true
operators:
- add_metadata_from_filepath: false
format: docker
id: container-parser
type: container
start_at: end
hostmetrics:
collection_interval: 60s
root_path: /hostfs
scrapers:
cpu: {}
disk: {}
filesystem: {}
load: {}
memory: {}
network: {}
paging: {}
process:
mute_process_exe_error: true
mute_process_io_error: true
mute_process_name_error: true
mute_process_user_error: true
processes: {}

processors:
memory_limiter:
check_interval: 5s
limit_mib: 4000
spike_limit_mib: 800
resourcedetection:
detectors:
- env
- system
- docker
timeout: 5s
batch: {}

exporters:
otlphttp:
endpoint: ${env:SIGNOZ_INGESTION_ENDPOINT}
headers:
signoz-ingestion-key: ${env:SIGNOZ_INGESTION_KEY}

service:
pipelines:
traces:
receivers:
- otlp
processors:
- memory_limiter
- resourcedetection
- batch
exporters:
- otlphttp
metrics:
receivers:
- otlp
- docker_stats
- hostmetrics
processors:
- memory_limiter
- resourcedetection
- batch
exporters:
- otlphttp
logs:
receivers:
- otlp
- filelog
processors:
- memory_limiter
- resourcedetection
- batch
exporters:
- otlphttp
env:
OTEL_COLLECTOR_ROLE: agent
SIGNOZ_INGESTION_ENDPOINT: https://ingest.<region>.signoz.cloud:443
SIGNOZ_INGESTION_KEY: <your-ingestion-key>
receivers:
docker_stats:
body:
collection_interval: 10s
endpoint: unix:///var/run/docker.sock
timeout: 20s
pipelines:
- metrics
filelog:
body:
include:
- /var/lib/docker/containers/*/*-json.log
include_file_name: false
include_file_path: true
operators:
- add_metadata_from_filepath: false
format: docker
id: container-parser
type: container
start_at: end
pipelines:
- logs
hostmetrics:
body:
collection_interval: 60s
root_path: /hostfs
scrapers:
cpu: {}
disk: {}
filesystem: {}
load: {}
memory: {}
network: {}
paging: {}
process:
mute_process_exe_error: true
mute_process_io_error: true
mute_process_name_error: true
mute_process_user_error: true
processes: {}
pipelines:
- metrics
resourceDetectors:
- docker
deployment:
flavor: compose
mode: docker
Loading