Skip to content

Commit e906c9e

Browse files
fix: avoid referencing loki when disabled (#61)
1 parent 294ac3b commit e906c9e

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Logs will be scraped from all pods in the Kubernetes cluster.
2222

2323
```bash
2424
helm repo add coder-observability https://helm.coder.com/observability
25-
helm upgrade --install coder-observability coder-observability/coder-observability --version 0.4.1 --namespace coder-observability --create-namespace
25+
helm upgrade --install coder-observability coder-observability/coder-observability --version 0.4.2 --namespace coder-observability --create-namespace
2626
```
2727

2828
## Requirements

coder-observability/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: coder-observability
33
description: Gain insights into your Coder deployment
44
type: application
5-
version: 0.4.1
5+
version: 0.4.2
66
dependencies:
77
- name: pyroscope
88
condition: pyroscope.enabled

coder-observability/templates/_collector-config.tpl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{{ $agent.logging }}
55
{{ $agent.discovery }}
66

7+
{{- if .Values.loki.enabled }}
8+
79
discovery.relabel "pod_logs" {
810
targets = discovery.kubernetes.pods.targets
911
{{ $agent.commonRelabellings | nindent 2 }}
@@ -25,6 +27,7 @@ discovery.relabel "pod_logs" {
2527
{{ $agent.podLogsRelabelRules | trim | nindent 2 }}
2628
{{- end }}
2729
}
30+
{{- end }}
2831

2932
discovery.relabel "pod_metrics" {
3033
targets = discovery.kubernetes.pods.targets
@@ -122,6 +125,7 @@ discovery.relabel "pod_pprof" {
122125
{{ $agent.podMetricsRelabelRules | trim | nindent 2 }}
123126
{{- end }}
124127
}
128+
{{- if .Values.loki.enabled }}
125129

126130
local.file_match "pod_logs" {
127131
path_targets = discovery.relabel.pod_logs.output
@@ -194,6 +198,7 @@ loki.process "pod_logs" {
194198

195199
forward_to = [loki.write.loki.receiver]
196200
}
201+
{{- end }}
197202
{{ if $agent.extraBlocks -}}
198203
{{ $agent.extraBlocks }}
199204
{{- end }}
@@ -379,15 +384,19 @@ otelcol.exporter.prometheus "to_prometheus" {
379384
prometheus.remote_write.default.receiver,
380385
]
381386
}
387+
{{- if .Values.loki.enabled }}
382388
otelcol.exporter.loki "to_loki" {
383389
forward_to = [
384390
loki.write.loki.receiver,
385391
]
386392
}
393+
{{- end }}
387394
otelcol.processor.batch "default" {
388395
output {
389396
metrics = [otelcol.exporter.prometheus.to_prometheus.input]
397+
{{- if .Values.loki.enabled }}
390398
logs = [otelcol.exporter.loki.to_loki.input]
399+
{{- end }}
391400
}
392401
}
393402
{{- end -}}

0 commit comments

Comments
 (0)