-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Tempo Nomad job example in Monolithic Mode (#4495)
* Add tempo nomad monolith example * Update README.md
- Loading branch information
Showing
2 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Monolithic mode | ||
|
||
This Nomad job will deploy Tempo in | ||
[monolithic mode](https://grafana.com/docs/tempo/latest/setup/deployment/#monolithic-mode) using S3 backend. | ||
|
||
## Usage | ||
|
||
### Prerequisites | ||
- S3 compatible storage | ||
|
||
Variables | ||
-------------- | ||
|
||
| Name | Value | Description | | ||
|---|---|---| | ||
| version | Default = "2.3.1" | Tempo version | | ||
| s3_url | Default = "s3.dummy.url.com" | S3 storage URL | | ||
| s3_access_key_id | Default = "any" | S3 Access Key ID | | ||
| s3_secret_access_key | Default = "any" | S3 Secret Access Key | | ||
| prometheus_remote_write_url | Default = "http://prometheus.service.consul/api/v1/write" | Prometheus Remote Write URL | | ||
|
||
### 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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
variable "version" { | ||
type = string | ||
description = "Tempo version" | ||
default = "2.3.1" | ||
} | ||
|
||
variable "prometheus_remote_write_url" { | ||
type = string | ||
description = "Prometheus Remote Write URL" | ||
default = "http://prometheus.service.consul/api/v1/write" | ||
} | ||
|
||
variable "s3_url" { | ||
type = string | ||
description = "S3 URL" | ||
default = "s3.dummy.url" | ||
} | ||
|
||
variable "s3_access_key_id" { | ||
type = string | ||
description = "S3 Access Key ID" | ||
default = "any" | ||
} | ||
|
||
variable "s3_secret_access_key" { | ||
type = string | ||
description = "S3 Secret Access Key" | ||
default = "any" | ||
} | ||
|
||
job "tempo" { | ||
datacenters = ["*"] | ||
|
||
group "tempo" { | ||
count = 1 | ||
|
||
network { | ||
port "http" { | ||
to = 3200 | ||
} | ||
port "grpc" {} | ||
} | ||
|
||
service { | ||
name = "tempo-http" | ||
port = "http" | ||
tags = [] | ||
check { | ||
name = "tempo-http" | ||
port = "http" | ||
type = "http" | ||
path = "/ready" | ||
interval = "20s" | ||
timeout = "1s" | ||
} | ||
} | ||
|
||
service { | ||
name = "tempo-grpc" | ||
port = "grpc" | ||
tags = [] | ||
check { | ||
port = "grpc" | ||
type = "grpc" | ||
interval = "20s" | ||
timeout = "1s" | ||
grpc_use_tls = false | ||
tls_skip_verify = true | ||
} | ||
} | ||
|
||
task "tempo" { | ||
driver = "docker" | ||
user = "nobody" | ||
kill_timeout = "90s" | ||
|
||
config { | ||
image = "grafana/tempo:${var.version}" | ||
ports = [ | ||
"http", | ||
"grpc", | ||
] | ||
|
||
args = [ | ||
"-target=all", | ||
"-config.file=/local/config.yml", | ||
"-config.expand-env=true", | ||
] | ||
} | ||
template { | ||
data = <<-EOC | ||
server: | ||
log_level: info | ||
http_listen_port: {{ env "NOMAD_PORT_http" }} | ||
grpc_listen_port: {{ env "NOMAD_PORT_grpc" }} | ||
distributor: | ||
receivers: # this configuration will listen on all ports and protocols that tempo is capable of. | ||
otlp: | ||
protocols: | ||
http: | ||
grpc: | ||
metrics_generator: | ||
processor: | ||
service_graphs: | ||
max_items: 10000 | ||
storage: | ||
path: {{ env "NOMAD_ALLOC_DIR" }}/tempo/wal | ||
remote_write: | ||
- url: ${var.prometheus_remote_write_url} | ||
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: ${var.s3_url} | ||
insecure: true | ||
access_key: ${var.s3_access_key_id} | ||
secret_key: ${var.s3_secret_access_key} | ||
overrides: | ||
defaults: | ||
metrics_generator: | ||
processors: | ||
- service-graphs | ||
- span-metrics | ||
EOC | ||
destination = "local/config.yml" | ||
} | ||
|
||
|
||
resources { | ||
cpu = 300 | ||
memory = 1024 | ||
} | ||
} | ||
} | ||
} |