Skip to content

Commit be23092

Browse files
authored
fix: alloy-receiver jaeger bugs (#1169)
* Added otlp validation for grafana cloud endpoint * Set Port Names * Removed Trailing Spaces * Fixed jaeger bug - Setting: receivers.jaeger.thriftHttp.enabled would not config the receiver as it didn't satisfy the condition - The jaeger ports were rendering 0, as the dictionary was passed to | int, not the port * Added jaeger tests * Regenerated Output * Updated Meta-Monitoring Example * Rebuilt
1 parent 0a73718 commit be23092

File tree

15 files changed

+1141
-48
lines changed

15 files changed

+1141
-48
lines changed

charts/k8s-monitoring/charts/feature-application-observability/templates/_receiver_jaeger.tpl

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{{/* Inputs: Values (values) tracesOutput */}}
22
{{- define "feature.applicationObservability.receiver.jaeger.alloy" }}
3-
{{- if or .Values.receivers.jaeger.grpc.enabled .Values.receivers.jaeger.thriftBinary.enabled .Values.receivers.jaeger.thriftCompact.enabled .Values.receivers.jaeger.thriftBinary.enabled }}
3+
{{- if or .Values.receivers.jaeger.grpc.enabled .Values.receivers.jaeger.thriftBinary.enabled .Values.receivers.jaeger.thriftCompact.enabled .Values.receivers.jaeger.thriftHttp.enabled }}
44
otelcol.receiver.jaeger "receiver" {
55
protocols {
6-
{{- if .Values.receivers.jaeger.grpc.enabled -}}
6+
{{- if .Values.receivers.jaeger.grpc.enabled }}
77
grpc {
8-
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.grpc | int }}"
8+
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.grpc.port | int }}"
99
}
1010
{{- end }}
1111
{{- if .Values.receivers.jaeger.thriftBinary.enabled }}
1212
thrift_binary {
13-
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftBinary | int }}"
13+
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftBinary.port | int }}"
1414
}
1515
{{- end }}
1616
{{- if .Values.receivers.jaeger.thriftCompact.enabled }}
1717
thrift_compact {
18-
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftCompact | int }}"
18+
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftCompact.port | int }}"
1919
}
2020
{{- end }}
2121
{{- if .Values.receivers.jaeger.thriftHttp.enabled }}
2222
thrift_http {
23-
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftHttp | int }}"
23+
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftHttp.port | int }}"
2424
}
2525
{{- end }}
2626
}

charts/k8s-monitoring/charts/feature-application-observability/tests/default_test.yaml

+18-17
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ tests:
3333
argument "metrics_destinations" {
3434
comment = "Must be a list of metrics destinations where collected metrics should be forwarded to"
3535
}
36-
36+
3737
argument "logs_destinations" {
3838
comment = "Must be a list of log destinations where collected logs should be forwarded to"
3939
}
40-
40+
4141
argument "traces_destinations" {
4242
comment = "Must be a list of trace destinations where collected trace should be forwarded to"
4343
}
44-
44+
4545
// Receivers --> Resource Detection Processor
4646
otelcol.receiver.otlp "receiver" {
4747
grpc {
@@ -60,20 +60,21 @@ tests:
6060
}
6161
}
6262
otelcol.receiver.jaeger "receiver" {
63-
protocols {grpc {
64-
endpoint = "0.0.0.0:0"
63+
protocols {
64+
grpc {
65+
endpoint = "0.0.0.0:14250"
6566
}
6667
thrift_binary {
67-
endpoint = "0.0.0.0:0"
68+
endpoint = "0.0.0.0:6832"
6869
}
6970
thrift_compact {
70-
endpoint = "0.0.0.0:0"
71+
endpoint = "0.0.0.0:6831"
7172
}
7273
thrift_http {
73-
endpoint = "0.0.0.0:0"
74+
endpoint = "0.0.0.0:14268"
7475
}
7576
}
76-
77+
7778
debug_metrics {
7879
disable_high_cardinality_metrics = true
7980
}
@@ -90,21 +91,21 @@ tests:
9091
traces = [otelcol.processor.resourcedetection.default.input]
9192
}
9293
}
93-
94+
9495
// Resource Detection Processor --> K8s Attribute Processor
9596
otelcol.processor.resourcedetection "default" {
9697
detectors = ["env", "system"]
9798
system {
9899
hostname_sources = ["os"]
99100
}
100-
101+
101102
output {
102103
metrics = [otelcol.processor.k8sattributes.default.input]
103104
logs = [otelcol.processor.k8sattributes.default.input]
104105
traces = [otelcol.processor.k8sattributes.default.input]
105106
}
106107
}
107-
108+
108109
// K8s Attribute Processor --> Transform Processor
109110
// Resource Detection Processor Traces --> Host Info Connector
110111
otelcol.processor.k8sattributes "default" {
@@ -116,7 +117,7 @@ tests:
116117
from = "connection"
117118
}
118119
}
119-
120+
120121
output {
121122
metrics = [otelcol.processor.transform.default.input]
122123
logs = [otelcol.processor.transform.default.input]
@@ -126,13 +127,13 @@ tests:
126127
// Host Info Connector --> Batch Processor
127128
otelcol.connector.host_info "default" {
128129
host_identifiers = [ "k8s.node.name" ]
129-
130+
130131
output {
131132
metrics = [otelcol.processor.batch.default.input]
132133
}
133134
}
134-
135-
135+
136+
136137
// Transform Processor --> Batch Processor
137138
otelcol.processor.transform "default" {
138139
error_mode = "ignore"
@@ -144,7 +145,7 @@ tests:
144145
"set(attributes[\"loki.resource.labels\"], \"cluster, namespace, job, pod\")",
145146
]
146147
}
147-
148+
148149
output {
149150
metrics = [otelcol.processor.batch.default.input]
150151
logs = [otelcol.processor.batch.default.input]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
# yamllint disable rule:document-start rule:line-length rule:trailing-spaces rule:empty-lines
3+
suite: Test Loki integration
4+
templates:
5+
- configmap.yaml
6+
tests:
7+
- it: should allow you to enable just the jaeger grpc receiver
8+
set:
9+
deployAsConfigMap: true
10+
receivers:
11+
jaeger:
12+
grpc:
13+
enabled: true
14+
asserts:
15+
- isKind:
16+
of: ConfigMap
17+
- matchRegex:
18+
path: data["module.alloy"]
19+
# The pattern should look like this, but since the regex is escaped, it will be a bit different
20+
# otelcol.receiver.jaeger "receiver" {
21+
# protocols {
22+
# grpc {
23+
# endpoint = "0.0.0.0:14250"
24+
# }
25+
# }
26+
#
27+
# debug_metrics {
28+
# disable_high_cardinality_metrics = true
29+
# }
30+
# output {
31+
# traces = [otelcol.processor.resourcedetection.default.input]
32+
# }
33+
# }
34+
pattern: |-
35+
\s*otelcol\.receiver\.jaeger "receiver"\s*\{
36+
\s* protocols\s*\{
37+
\s* grpc\s*\{
38+
\s* endpoint = "0\.0\.0\.0:14250"
39+
\s* \}
40+
\s* \}
41+
\s*
42+
\s* debug_metrics\s*\{
43+
\s* disable_high_cardinality_metrics = true
44+
\s* \}
45+
\s* output\s*\{
46+
\s* traces = \[otelcol\.processor\.resourcedetection\.default\.input\]
47+
\s* \}
48+
\s*}
49+
50+
- it: should allow you to enable just the jaeger thrift binary receiver
51+
set:
52+
deployAsConfigMap: true
53+
receivers:
54+
jaeger:
55+
thriftBinary:
56+
enabled: true
57+
asserts:
58+
- isKind:
59+
of: ConfigMap
60+
- matchRegex:
61+
path: data["module.alloy"]
62+
# The pattern should look like this, but since the regex is escaped, it will be a bit different
63+
# otelcol.receiver.jaeger "receiver" {
64+
# protocols {
65+
# thrift_binary {
66+
# endpoint = "0.0.0.0:6832"
67+
# }
68+
# }
69+
#
70+
# debug_metrics {
71+
# disable_high_cardinality_metrics = true
72+
# }
73+
# output {
74+
# traces = [otelcol.processor.resourcedetection.default.input]
75+
# }
76+
# }
77+
pattern: |-
78+
\s*otelcol\.receiver\.jaeger "receiver"\s*\{
79+
\s* protocols\s*\{
80+
\s* thrift_binary\s*\{
81+
\s* endpoint = "0\.0\.0\.0:6832"
82+
\s* \}
83+
\s* \}
84+
\s*
85+
\s* debug_metrics\s*\{
86+
\s* disable_high_cardinality_metrics = true
87+
\s* \}
88+
\s* output\s*\{
89+
\s* traces = \[otelcol\.processor\.resourcedetection\.default\.input\]
90+
\s* \}
91+
\s*}
92+
93+
- it: should allow you to enable just the jaeger thrift compact receiver
94+
set:
95+
deployAsConfigMap: true
96+
receivers:
97+
jaeger:
98+
thriftCompact:
99+
enabled: true
100+
asserts:
101+
- isKind:
102+
of: ConfigMap
103+
- matchRegex:
104+
path: data["module.alloy"]
105+
# The pattern should look like this, but since the regex is escaped, it will be a bit different
106+
# otelcol.receiver.jaeger "receiver" {
107+
# protocols {
108+
# thrift_compact {
109+
# endpoint = "0.0.0.0:6831"
110+
# }
111+
# }
112+
#
113+
# debug_metrics {
114+
# disable_high_cardinality_metrics = true
115+
# }
116+
# output {
117+
# traces = [otelcol.processor.resourcedetection.default.input]
118+
# }
119+
# }
120+
pattern: |-
121+
\s*otelcol\.receiver\.jaeger "receiver"\s*\{
122+
\s* protocols\s*\{
123+
\s* thrift_compact\s*\{
124+
\s* endpoint = "0\.0\.0\.0:6831"
125+
\s* \}
126+
\s* \}
127+
\s*
128+
\s* debug_metrics\s*\{
129+
\s* disable_high_cardinality_metrics = true
130+
\s* \}
131+
\s* output\s*\{
132+
\s* traces = \[otelcol\.processor\.resourcedetection\.default\.input\]
133+
\s* \}
134+
\s*}
135+
136+
- it: should allow you to enable just the jaeger thrift http receiver
137+
set:
138+
deployAsConfigMap: true
139+
receivers:
140+
jaeger:
141+
thriftHttp:
142+
enabled: true
143+
asserts:
144+
- isKind:
145+
of: ConfigMap
146+
- matchRegex:
147+
path: data["module.alloy"]
148+
# The pattern should look like this, but since the regex is escaped, it will be a bit different
149+
# otelcol.receiver.jaeger "receiver" {
150+
# protocols {
151+
# thrift_http {
152+
# endpoint = "0.0.0.0:14268"
153+
# }
154+
# }
155+
#
156+
# debug_metrics {
157+
# disable_high_cardinality_metrics = true
158+
# }
159+
# output {
160+
# traces = [otelcol.processor.resourcedetection.default.input]
161+
# }
162+
# }
163+
pattern: |-
164+
\s*otelcol\.receiver\.jaeger "receiver"\s*\{
165+
\s* protocols\s*\{
166+
\s* thrift_http\s*\{
167+
\s* endpoint = "0\.0\.0\.0:14268"
168+
\s* \}
169+
\s* \}
170+
\s*
171+
\s* debug_metrics\s*\{
172+
\s* disable_high_cardinality_metrics = true
173+
\s* \}
174+
\s* output\s*\{
175+
\s* traces = \[otelcol\.processor\.resourcedetection\.default\.input\]
176+
\s* \}
177+
\s*}

charts/k8s-monitoring/docs/examples/auth/bearer-token/alloy-receiver.alloy

+15-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/k8s-monitoring/docs/examples/auth/bearer-token/output.yaml

+15-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/k8s-monitoring/docs/examples/auth/external-secrets/alloy-receiver.alloy

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/k8s-monitoring/docs/examples/auth/external-secrets/output.yaml

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)