Skip to content

Commit

Permalink
fix: alloy-receiver jaeger bugs (#1169)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
bentonam authored Jan 24, 2025
1 parent 0a73718 commit be23092
Show file tree
Hide file tree
Showing 15 changed files with 1,141 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{{/* Inputs: Values (values) tracesOutput */}}
{{- define "feature.applicationObservability.receiver.jaeger.alloy" }}
{{- if or .Values.receivers.jaeger.grpc.enabled .Values.receivers.jaeger.thriftBinary.enabled .Values.receivers.jaeger.thriftCompact.enabled .Values.receivers.jaeger.thriftBinary.enabled }}
{{- if or .Values.receivers.jaeger.grpc.enabled .Values.receivers.jaeger.thriftBinary.enabled .Values.receivers.jaeger.thriftCompact.enabled .Values.receivers.jaeger.thriftHttp.enabled }}
otelcol.receiver.jaeger "receiver" {
protocols {
{{- if .Values.receivers.jaeger.grpc.enabled -}}
{{- if .Values.receivers.jaeger.grpc.enabled }}
grpc {
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.grpc | int }}"
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.grpc.port | int }}"
}
{{- end }}
{{- if .Values.receivers.jaeger.thriftBinary.enabled }}
thrift_binary {
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftBinary | int }}"
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftBinary.port | int }}"
}
{{- end }}
{{- if .Values.receivers.jaeger.thriftCompact.enabled }}
thrift_compact {
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftCompact | int }}"
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftCompact.port | int }}"
}
{{- end }}
{{- if .Values.receivers.jaeger.thriftHttp.enabled }}
thrift_http {
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftHttp | int }}"
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftHttp.port | int }}"
}
{{- end }}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ tests:
argument "metrics_destinations" {
comment = "Must be a list of metrics destinations where collected metrics should be forwarded to"
}
argument "logs_destinations" {
comment = "Must be a list of log destinations where collected logs should be forwarded to"
}
argument "traces_destinations" {
comment = "Must be a list of trace destinations where collected trace should be forwarded to"
}
// Receivers --> Resource Detection Processor
otelcol.receiver.otlp "receiver" {
grpc {
Expand All @@ -60,20 +60,21 @@ tests:
}
}
otelcol.receiver.jaeger "receiver" {
protocols {grpc {
endpoint = "0.0.0.0:0"
protocols {
grpc {
endpoint = "0.0.0.0:14250"
}
thrift_binary {
endpoint = "0.0.0.0:0"
endpoint = "0.0.0.0:6832"
}
thrift_compact {
endpoint = "0.0.0.0:0"
endpoint = "0.0.0.0:6831"
}
thrift_http {
endpoint = "0.0.0.0:0"
endpoint = "0.0.0.0:14268"
}
}
debug_metrics {
disable_high_cardinality_metrics = true
}
Expand All @@ -90,21 +91,21 @@ tests:
traces = [otelcol.processor.resourcedetection.default.input]
}
}
// Resource Detection Processor --> K8s Attribute Processor
otelcol.processor.resourcedetection "default" {
detectors = ["env", "system"]
system {
hostname_sources = ["os"]
}
output {
metrics = [otelcol.processor.k8sattributes.default.input]
logs = [otelcol.processor.k8sattributes.default.input]
traces = [otelcol.processor.k8sattributes.default.input]
}
}
// K8s Attribute Processor --> Transform Processor
// Resource Detection Processor Traces --> Host Info Connector
otelcol.processor.k8sattributes "default" {
Expand All @@ -116,7 +117,7 @@ tests:
from = "connection"
}
}
output {
metrics = [otelcol.processor.transform.default.input]
logs = [otelcol.processor.transform.default.input]
Expand All @@ -126,13 +127,13 @@ tests:
// Host Info Connector --> Batch Processor
otelcol.connector.host_info "default" {
host_identifiers = [ "k8s.node.name" ]
output {
metrics = [otelcol.processor.batch.default.input]
}
}
// Transform Processor --> Batch Processor
otelcol.processor.transform "default" {
error_mode = "ignore"
Expand All @@ -144,7 +145,7 @@ tests:
"set(attributes[\"loki.resource.labels\"], \"cluster, namespace, job, pod\")",
]
}
output {
metrics = [otelcol.processor.batch.default.input]
logs = [otelcol.processor.batch.default.input]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
---
# yamllint disable rule:document-start rule:line-length rule:trailing-spaces rule:empty-lines
suite: Test Loki integration
templates:
- configmap.yaml
tests:
- it: should allow you to enable just the jaeger grpc receiver
set:
deployAsConfigMap: true
receivers:
jaeger:
grpc:
enabled: true
asserts:
- isKind:
of: ConfigMap
- matchRegex:
path: data["module.alloy"]
# The pattern should look like this, but since the regex is escaped, it will be a bit different
# otelcol.receiver.jaeger "receiver" {
# protocols {
# grpc {
# endpoint = "0.0.0.0:14250"
# }
# }
#
# debug_metrics {
# disable_high_cardinality_metrics = true
# }
# output {
# traces = [otelcol.processor.resourcedetection.default.input]
# }
# }
pattern: |-
\s*otelcol\.receiver\.jaeger "receiver"\s*\{
\s* protocols\s*\{
\s* grpc\s*\{
\s* endpoint = "0\.0\.0\.0:14250"
\s* \}
\s* \}
\s*
\s* debug_metrics\s*\{
\s* disable_high_cardinality_metrics = true
\s* \}
\s* output\s*\{
\s* traces = \[otelcol\.processor\.resourcedetection\.default\.input\]
\s* \}
\s*}
- it: should allow you to enable just the jaeger thrift binary receiver
set:
deployAsConfigMap: true
receivers:
jaeger:
thriftBinary:
enabled: true
asserts:
- isKind:
of: ConfigMap
- matchRegex:
path: data["module.alloy"]
# The pattern should look like this, but since the regex is escaped, it will be a bit different
# otelcol.receiver.jaeger "receiver" {
# protocols {
# thrift_binary {
# endpoint = "0.0.0.0:6832"
# }
# }
#
# debug_metrics {
# disable_high_cardinality_metrics = true
# }
# output {
# traces = [otelcol.processor.resourcedetection.default.input]
# }
# }
pattern: |-
\s*otelcol\.receiver\.jaeger "receiver"\s*\{
\s* protocols\s*\{
\s* thrift_binary\s*\{
\s* endpoint = "0\.0\.0\.0:6832"
\s* \}
\s* \}
\s*
\s* debug_metrics\s*\{
\s* disable_high_cardinality_metrics = true
\s* \}
\s* output\s*\{
\s* traces = \[otelcol\.processor\.resourcedetection\.default\.input\]
\s* \}
\s*}
- it: should allow you to enable just the jaeger thrift compact receiver
set:
deployAsConfigMap: true
receivers:
jaeger:
thriftCompact:
enabled: true
asserts:
- isKind:
of: ConfigMap
- matchRegex:
path: data["module.alloy"]
# The pattern should look like this, but since the regex is escaped, it will be a bit different
# otelcol.receiver.jaeger "receiver" {
# protocols {
# thrift_compact {
# endpoint = "0.0.0.0:6831"
# }
# }
#
# debug_metrics {
# disable_high_cardinality_metrics = true
# }
# output {
# traces = [otelcol.processor.resourcedetection.default.input]
# }
# }
pattern: |-
\s*otelcol\.receiver\.jaeger "receiver"\s*\{
\s* protocols\s*\{
\s* thrift_compact\s*\{
\s* endpoint = "0\.0\.0\.0:6831"
\s* \}
\s* \}
\s*
\s* debug_metrics\s*\{
\s* disable_high_cardinality_metrics = true
\s* \}
\s* output\s*\{
\s* traces = \[otelcol\.processor\.resourcedetection\.default\.input\]
\s* \}
\s*}
- it: should allow you to enable just the jaeger thrift http receiver
set:
deployAsConfigMap: true
receivers:
jaeger:
thriftHttp:
enabled: true
asserts:
- isKind:
of: ConfigMap
- matchRegex:
path: data["module.alloy"]
# The pattern should look like this, but since the regex is escaped, it will be a bit different
# otelcol.receiver.jaeger "receiver" {
# protocols {
# thrift_http {
# endpoint = "0.0.0.0:14268"
# }
# }
#
# debug_metrics {
# disable_high_cardinality_metrics = true
# }
# output {
# traces = [otelcol.processor.resourcedetection.default.input]
# }
# }
pattern: |-
\s*otelcol\.receiver\.jaeger "receiver"\s*\{
\s* protocols\s*\{
\s* thrift_http\s*\{
\s* endpoint = "0\.0\.0\.0:14268"
\s* \}
\s* \}
\s*
\s* debug_metrics\s*\{
\s* disable_high_cardinality_metrics = true
\s* \}
\s* output\s*\{
\s* traces = \[otelcol\.processor\.resourcedetection\.default\.input\]
\s* \}
\s*}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit be23092

Please sign in to comment.