aboutsummaryrefslogtreecommitdiff
path: root/terraform/hash-loki
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2024-12-23 17:35:29 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2024-12-23 17:35:29 +0100
commite768b1675922e746f09828920b05d836a1cd365b (patch)
tree505560f6c972b802e94a4bff1ec2e3e641a37fda /terraform/hash-loki
parent979ec08d3d35118f106559dc59c1961cd3534ba7 (diff)
downloadinfra-e768b1675922e746f09828920b05d836a1cd365b.tar.gz
infra-e768b1675922e746f09828920b05d836a1cd365b.tar.bz2
infra-e768b1675922e746f09828920b05d836a1cd365b.tar.xz
infra-e768b1675922e746f09828920b05d836a1cd365b.zip
otelcolHEADmaster
Diffstat (limited to 'terraform/hash-loki')
-rw-r--r--terraform/hash-loki/loki-config.yaml21
-rw-r--r--terraform/hash-loki/loki.tf13
-rw-r--r--terraform/hash-loki/main.tf4
3 files changed, 36 insertions, 2 deletions
diff --git a/terraform/hash-loki/loki-config.yaml b/terraform/hash-loki/loki-config.yaml
index d21d405..72e68b0 100644
--- a/terraform/hash-loki/loki-config.yaml
+++ b/terraform/hash-loki/loki-config.yaml
@@ -50,3 +50,24 @@ ruler:
# If you would like to disable reporting, uncomment the following lines:
analytics:
reporting_enabled: false
+
+distributor:
+ otlp_config:
+ default_resource_attributes_as_index_labels:
+ - cloud.availability_zone
+ - cloud.region
+ - container.name
+ - deployment.environment
+ - k8s.cluster.name
+ - k8s.container.name
+ - k8s.cronjob.name
+ - k8s.daemonset.name
+ - k8s.deployment.name
+ - k8s.job.name
+ - k8s.namespace.name
+ - k8s.pod.name
+ - k8s.replicaset.name
+ - k8s.statefulset.name
+ - service.instance.id
+ - service.name
+ - service.namespace
diff --git a/terraform/hash-loki/loki.tf b/terraform/hash-loki/loki.tf
index b7bb60b..1e09037 100644
--- a/terraform/hash-loki/loki.tf
+++ b/terraform/hash-loki/loki.tf
@@ -1,5 +1,5 @@
resource "docker_image" "loki" {
- name = "grafana/loki:3.2.1"
+ name = "grafana/loki:3.3.0"
}
resource "docker_volume" "loki" {
@@ -12,6 +12,10 @@ resource "docker_container" "loki" {
privileged = false
must_run = true
+ command = [
+ "-config.file=${local.container_config_dir}/loki-config.yaml"
+ ]
+
network_mode = "bridge"
networks_advanced {
@@ -39,6 +43,13 @@ resource "docker_container" "loki" {
env = [
]
+ mounts {
+ source = local.host_config_dir
+ target = local.container_config_dir
+ type = "bind"
+ read_only = false
+ }
+
volumes {
volume_name = docker_volume.loki.name
container_path = "/loki"
diff --git a/terraform/hash-loki/main.tf b/terraform/hash-loki/main.tf
index a393467..7f00e45 100644
--- a/terraform/hash-loki/main.tf
+++ b/terraform/hash-loki/main.tf
@@ -20,7 +20,9 @@ terraform {
}
locals {
- host = "hash.trygvis.io"
+ host = "hash.trygvis.io"
+ host_config_dir = "/etc/docker-service/loki"
+ container_config_dir = "/config"
}
provider "docker" {