Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update architecture.md #4642

Merged
merged 3 commits into from
Dec 8, 2023
Merged
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
66 changes: 66 additions & 0 deletions docs/sources/operator/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,69 @@ Two labels are added by default to every metric:

The shard number is not added as a label, as sharding is designed to be
transparent on the receiver end.

## Enable sharding and replication

To enable sharding and replication, you must set the `shards` and `replicas` properties in the Grafana Agent configuration file. For example, the following configuration file would shard the data into three shards and replicate each shard to two other Grafana Agent instances:

```
shards: 3
replicas: 2
```

You can also enable sharding and replication by setting the `shards` and `replicas` arguments when you start the Grafana Agent.

### Examples

The following examples show you how to enable sharding and replication in a Kubernetes environment.

* To shard the data into three shards and replicate each shard to two other Grafana Agent instances, you would use the following deployment manifest:

```
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana-agent
spec:
replicas: 3
selector:
matchLabels:
app: grafana-agent
template:
metadata:
labels:
app: grafana-agent
spec:
containers:
- name: grafana-agent
image: grafana/agent:latest
args:
- "--shards=3"
- "--replicas=2"
```

* To shard the data into 10 shards and replicate each shard to three other Grafana Agent instances, you would use the following deployment manifest:

```
apiVersion: apps/v1
kind: Deployment
metadata:
name: grafana-agent
spec:
replicas: 10
selector:
matchLabels:
app: grafana-agent
template:
metadata:
labels:
app: grafana-agent
spec:
containers:
- name: grafana-agent
image: grafana/agent:latest
args:
- "--shards=10"
- "--replicas=3"
```