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

Nomad job example #4469

Merged
merged 5 commits into from
Dec 20, 2024
Merged
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
44 changes: 44 additions & 0 deletions example/nomad/tempo-distributed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Microservices mode

This Nomad job will deploy Tempo in
[microservices mode](https://grafana.com/docs/tempo/latest/setup/deployment/#microservices-mode) using S3 backend.

## Usage

### Prerequisites
- S3 compatible storage
- [Nomad memory oversubscription](https://developer.hashicorp.com/nomad/tutorials/advanced-scheduling/memory-oversubscription). If memory oversubscription is not enabled, remove `memory_max` from tempo.hcl

Have a look at the job file and Tempo configuration file and change it to suite your environment. (e.g. in `config.yml` change s3 endpoint to your s3 compatible storge, prometheus endpoint, etc...)

Variables
--------------

| Name | Value | Description |
|---|---|---|
| version | Default = "2.3.1" | Tempo version |
| s3_access_key_id | Default = "any" | S3 Access Key ID |
| s3_secret_access_key | Default = "any" | S3 Secret Access Key |

### Run job

Inside directory with job run:

```shell
nomad job run tempo.hcl
```

To deploy a different version change `variable.version` default value or
specify from command line:

```shell
nomad job run -var="version=2.6.1" tempo.hcl
```

### Scale Tempo

Nomad CLI

```shell
nomad job scale tempo distributor <count>
```
81 changes: 81 additions & 0 deletions example/nomad/tempo-distributed/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
server:
log_level: info
http_listen_port: {{ env "NOMAD_PORT_http" }}
grpc_listen_port: {{ env "NOMAD_PORT_grpc" }}

distributor:
ring:
kvstore:
store: consul
prefix: tempo/
consul:
host: {{ env "attr.unique.network.ip-address" }}:8500

receivers: # this configuration will listen on all ports and protocols that tempo is capable of.
otlp:
protocols:
http:
grpc:

ingester:
max_block_duration: 5m
lifecycler:
ring:
kvstore:
store: consul
prefix: tempo/
consul:
host: {{ env "attr.unique.network.ip-address" }}:8500
replication_factor: 3

compactor:
ring:
kvstore:
store: consul
prefix: tempo/
consul:
host: {{ env "attr.unique.network.ip-address" }}:8500

compaction:
block_retention: 336h #Duration to keep blocks. Default is 14 days (336h).

querier:
frontend_worker:
frontend_address: tempo-query-frontend-grpc.service.consul:9095

metrics_generator:
processor:
service_graphs:
max_items: 10000
ring:
kvstore:
store: consul
prefix: tempo/
consul:
host: {{ env "attr.unique.network.ip-address" }}:8500
storage:
path: {{ env "NOMAD_ALLOC_DIR" }}/tempo/wal
remote_write:
- url: http://prometheus.service.consul/api/v1/write
send_exemplars: true

storage:
trace:
backend: s3
wal:
path: {{ env "NOMAD_ALLOC_DIR" }}/tempo/wal
local:
path: {{ env "NOMAD_ALLOC_DIR" }}/tempo/blocks
s3:
bucket: tempo # how to store data in s3
endpoint: seaweedfs-s3.service.consul
joe-elliott marked this conversation as resolved.
Show resolved Hide resolved
insecure: true
access_key: ${S3_ACCESS_KEY_ID}
secret_key: ${S3_SECRET_ACCESS_KEY}

overrides:
defaults:
metrics_generator:
processors:
- service-graphs
- span-metrics
Loading