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

Add Tempo Nomad job example in Monolithic Mode #4495

Merged
merged 2 commits into from
Jan 2, 2025
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
35 changes: 35 additions & 0 deletions example/nomad/tempo-monolith/README.md
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
```
146 changes: 146 additions & 0 deletions example/nomad/tempo-monolith/tempo.hcl
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
}
}
}
}