Skip to content

Commit

Permalink
Add Jaeger receivers to the Application Observability feature (#954)
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall authored Nov 27, 2024
1 parent 48e1810 commit 1641db1
Show file tree
Hide file tree
Showing 50 changed files with 397 additions and 200 deletions.
34 changes: 25 additions & 9 deletions charts/feature-application-observability/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,31 @@ Actual integration testing in a live environment should be done in the main [k8s
| processors.memoryLimiter.enabled | bool | `false` | Use a memory limiter. |
| processors.memoryLimiter.limit | string | `"0MiB"` | Maximum amount of memory targeted to be allocated by the process heap. |

### Receivers: Jaeger

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| receivers.jaeger.grpc | object | `{"enabled":false,"port":14250}` | Configuration for the Jaeger receiver using the gRPC protocol. |
| receivers.jaeger.include_debug_metrics | bool | `false` | Whether to include high-cardinality debug metrics. |
| receivers.jaeger.thriftBinary | object | `{"enabled":false,"port":6832}` | Configuration for the Jaeger receiver using the Thrift binary protocol. |
| receivers.jaeger.thriftCompact | object | `{"enabled":false,"port":6831}` | Configuration for the Jaeger receiver using the Thrift compact protocol. |
| receivers.jaeger.thriftHttp | object | `{"enabled":false,"port":14268}` | Configuration for the Jaeger receiver using the Thrift HTTP protocol. |

### Receivers: OTLP

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| receivers.otlp.grpc | object | `{"enabled":false,"port":4317}` | The OTLP gRPC receiver configuration. |
| receivers.otlp.http | object | `{"enabled":false,"port":4318}` | The OTLP HTTP receiver configuration. |
| receivers.otlp.include_debug_metrics | bool | `false` | Whether to include high-cardinality debug metrics. |

### Receivers: Zipkin

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| receivers.zipkin | object | `{"enabled":false,"include_debug_metrics":false,"port":9411}` | The Zipkin receiver configuration. |
| receivers.zipkin.include_debug_metrics | bool | `false` | Whether to include high-cardinality debug metrics. |

### Other Values

| Key | Type | Default | Description |
Expand All @@ -87,15 +112,6 @@ Actual integration testing in a live environment should be done in the main [k8s
| metrics.enabled | bool | `true` | |
| metrics.filters | object | `{"datapoint":[],"metric":[]}` | Apply a filter to metrics received via the OTLP or OTLP HTTP receivers. ([docs](https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.processor.filter/)) |
| metrics.transforms | object | `{"datapoint":[],"metric":[],"resource":[]}` | Apply a transformation to metrics received via the OTLP or OTLP HTTP receivers. ([docs](https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.processor.transform/)) |
| receivers.grpc.enabled | bool | `false` | |
| receivers.grpc.include_debug_metrics | bool | `false` | |
| receivers.grpc.port | int | `4317` | |
| receivers.http.enabled | bool | `false` | |
| receivers.http.include_debug_metrics | bool | `false` | |
| receivers.http.port | int | `4318` | |
| receivers.zipkin.enabled | bool | `false` | |
| receivers.zipkin.include_debug_metrics | bool | `false` | |
| receivers.zipkin.port | int | `9411` | |
| traces.enabled | bool | `true` | |
| traces.filters | object | `{"span":[],"spanevent":[]}` | Apply a filter to traces received via the OTLP or OTLP HTTP receivers. ([docs](https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.processor.filter/)) |
| traces.transforms | object | `{"resource":[],"span":[],"spanevent":[]}` | Apply a transformation to traces received via the OTLP or OTLP HTTP receivers. ([docs](https://grafana.com/docs/alloy/latest/reference/components/otelcol/otelcol.processor.transform/)) |
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ declare "application_observability" {
// Receivers --> Resource Detection Processor
{{- $next := printf "[%s]" $resourceDetection }}
{{- include "feature.applicationObservability.receiver.otlp.alloy" (dict "Values" $.Values "metricsOutput" $next "logsOutput" $next "tracesOutput" $next ) | indent 2 }}
{{- include "feature.applicationObservability.receiver.jaeger.alloy" (dict "Values" $.Values "tracesOutput" $next ) | indent 2 }}
{{- include "feature.applicationObservability.receiver.zipkin.alloy" (dict "Values" $.Values "tracesOutput" $next ) | indent 2 }}

// Resource Detection Processor --> K8s Attribute Processor
Expand Down
36 changes: 28 additions & 8 deletions charts/feature-application-observability/templates/_notes.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,50 @@

{{- define "feature.applicationObservability.notes.task" }}
{{- $receivers := list }}
{{- if .Values.receivers.grpc.enabled }}{{- $receivers = append $receivers "OTLP gRPC" }}{{ end }}
{{- if .Values.receivers.http.enabled }}{{- $receivers = append $receivers "OTLP HTTP" }}{{ end }}
{{- if .Values.receivers.otlp.grpc.enabled }}{{- $receivers = append $receivers "OTLP gRPC" }}{{ end }}
{{- if .Values.receivers.otlp.http.enabled }}{{- $receivers = append $receivers "OTLP HTTP" }}{{ end }}
{{- if .Values.receivers.jaeger.grpc.enabled }}{{- $receivers = append $receivers "Jaeger gRPC" }}{{ end }}
{{- if .Values.receivers.jaeger.thriftBinary.enabled }}{{- $receivers = append $receivers "Jaeger Thrift Binary" }}{{ end }}
{{- if .Values.receivers.jaeger.thriftCompact.enabled }}{{- $receivers = append $receivers "Jaeger Thrift Compact" }}{{ end }}
{{- if .Values.receivers.jaeger.thriftHttp.enabled }}{{- $receivers = append $receivers "Jaeger Thrift HTTP" }}{{ end }}
{{- if .Values.receivers.zipkin.enabled }}{{- $receivers = append $receivers "Zipkin" }}{{ end }}
{{- $receiverWord := len $receivers | plural "receiver" "receivers" }}
Gather application data via {{ include "english_list" $receivers }} {{ $receiverWord }}
{{- end }}

{{- define "feature.applicationObservability.notes.actions" }}
Configure your applications to send telemetry data to:
{{- if .Values.receivers.grpc.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.grpc.port }} (OTLP gRPC)
{{- if .Values.receivers.otlp.grpc.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.otlp.grpc.port }} (OTLP gRPC)
{{ end }}
{{- if .Values.receivers.http.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.http.port }} (OTLP HTTP)
{{- if .Values.receivers.otlp.http.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.otlp.http.port }} (OTLP HTTP)
{{ end }}
{{- if .Values.receivers.jaeger.grpc.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.jaeger.grpc.port }} (Jaeger gRPC)
{{- end }}
{{- if .Values.receivers.jaeger.thriftBinary.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.jaeger.thriftBinary.port }} (Jaeger Thrift Binary)
{{- end }}
{{- if .Values.receivers.jaeger.thriftCompact.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.jaeger.thriftCompact.port }} (Jaeger Thrift Compact)
{{- end }}
{{- if .Values.receivers.jaeger.thriftHttp.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.jaeger.thriftHttp.port }} (Jaeger Thrift HTTP)
{{- end }}
{{- if .Values.receivers.zipkin.enabled }}
* http://{{ .Collector.ServiceName }}.{{ .Collector.Namespace }}.svc.cluster.local:{{ .Values.receivers.zipkin.port }} (Zipkin)
{{ end }}
{{- end }}

{{- define "feature.applicationObservability.summary" -}}
{{- $receivers := list }}
{{- if .Values.receivers.grpc.enabled }}{{- $receivers = append $receivers "otlpgrpc" }}{{ end }}
{{- if .Values.receivers.http.enabled }}{{- $receivers = append $receivers "otlphttp" }}{{ end }}
{{- if .Values.receivers.otlp.grpc.enabled }}{{- $receivers = append $receivers "otlpgrpc" }}{{ end }}
{{- if .Values.receivers.otlp.http.enabled }}{{- $receivers = append $receivers "otlphttp" }}{{ end }}
{{- if .Values.receivers.jaeger.grpc.enabled }}{{- $receivers = append $receivers "jaegergrpc" }}{{ end }}
{{- if .Values.receivers.jaeger.thriftBinary.enabled }}{{- $receivers = append $receivers "jaegerthriftbinary" }}{{ end }}
{{- if .Values.receivers.jaeger.thriftCompact.enabled }}{{- $receivers = append $receivers "jaegerthriftcompact" }}{{ end }}
{{- if .Values.receivers.jaeger.thriftHttp.enabled }}{{- $receivers = append $receivers "jaegerthrifthttp" }}{{ end }}
{{- if .Values.receivers.zipkin.enabled }}{{- $receivers = append $receivers "zipkin" }}{{ end }}
version: {{ .Chart.Version }}
protocols: {{ $receivers | join "," }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{{/* 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 }}
otelcol.receiver.jaeger "receiver" {
protocols {
{{- if .Values.receivers.jaeger.grpc.enabled -}}
grpc {
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.grpc | int }}"
}
{{- end }}
{{- if .Values.receivers.jaeger.thriftBinary.enabled }}
thrift_binary {
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftBinary | int }}"
}
{{- end }}
{{- if .Values.receivers.jaeger.thriftCompact.enabled }}
thrift_compact {
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftCompact | int }}"
}
{{- end }}
{{- if .Values.receivers.jaeger.thriftHttp.enabled }}
thrift_http {
endpoint = "0.0.0.0:{{ .Values.receivers.jaeger.thriftHttp | int }}"
}
{{- end }}
}

debug_metrics {
disable_high_cardinality_metrics = {{ not .Values.receivers.jaeger.include_debug_metrics }}
}
output {
{{- if and .tracesOutput .Values.traces.enabled }}
traces = {{ .tracesOutput }}
{{- end }}
}
}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{{/* Inputs: Values (values) metricsOutput, logsOutput, tracesOutput */}}
{{- define "feature.applicationObservability.receiver.otlp.alloy" }}
{{- if or .Values.receivers.grpc.enabled .Values.receivers.http.enabled }}
{{- if or .Values.receivers.otlp.grpc.enabled .Values.receivers.otlp.http.enabled }}
otelcol.receiver.otlp "receiver" {
{{- if .Values.receivers.grpc.enabled }}
{{- if .Values.receivers.otlp.grpc.enabled }}
grpc {
endpoint = "0.0.0.0:{{ .Values.receivers.grpc.port | int }}"
endpoint = "0.0.0.0:{{ .Values.receivers.otlp.grpc.port | int }}"
}
{{- end }}
{{- if .Values.receivers.http.enabled }}
{{- if .Values.receivers.otlp.http.enabled }}
http {
endpoint = "0.0.0.0:{{ .Values.receivers.http.port | int }}"
endpoint = "0.0.0.0:{{ .Values.receivers.otlp.http.port | int }}"
}
{{- end }}
debug_metrics {
disable_high_cardinality_metrics = {{ not (or .Values.receivers.grpc.include_debug_metrics .Values.receivers.http.include_debug_metrics) }}
disable_high_cardinality_metrics = {{ not .Values.receivers.otlp.include_debug_metrics }}
}
output {
{{- if and .metricsOutput .Values.metrics.enabled }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{- define "feature.applicationObservability.validate" }}
{{- $aRecevierIsEnabled := or .Values.receivers.grpc.enabled .Values.receivers.http.enabled .Values.receivers.zipkin.enabled }}
{{- $aRecevierIsEnabled := or .Values.receivers.otlp.grpc.enabled .Values.receivers.otlp.http.enabled }}
{{- $aRecevierIsEnabled = or $aRecevierIsEnabled .Values.receivers.zipkin.enabled }}
{{- $aRecevierIsEnabled = or $aRecevierIsEnabled .Values.receivers.jaeger.grpc.enabled .Values.receivers.jaeger.thriftBinary.enabled .Values.receivers.jaeger.thriftCompact.enabled .Values.receivers.jaeger.thriftHttp.enabled }}
{{- if not $aRecevierIsEnabled }}
{{- $msg := list "" "At least one receiver must be enabled to use Application Observability." }}
{{- $msg = append $msg "Please enable one. For example:" }}
{{- $msg = append $msg "applicationObservability:" }}
{{- $msg = append $msg " receivers:" }}
{{- $msg = append $msg " grpc:" }}
{{- $msg = append $msg " enabled: true" }}
{{- $msg = append $msg " otlp:" }}
{{- $msg = append $msg " grpc:" }}
{{- $msg = append $msg " enabled: true" }}
{{- $msg = append $msg "See https://github.com/grafana/k8s-monitoring-helm/tree/main/charts/feature-application-observability for more details." }}
{{- fail (join "\n" $msg) }}
{{- end }}
Expand Down
40 changes: 36 additions & 4 deletions charts/feature-application-observability/tests/default_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,20 @@ tests:
set:
deployAsConfigMap: true
receivers:
grpc:
enabled: true
http:
enabled: true
otlp:
grpc:
enabled: true
http:
enabled: true
jaeger:
grpc:
enabled: true
thriftBinary:
enabled: true
thriftCompact:
enabled: true
thriftHttp:
enabled: true
zipkin:
enabled: true
asserts:
Expand Down Expand Up @@ -49,6 +59,28 @@ tests:
traces = [otelcol.processor.resourcedetection.default.input]
}
}
otelcol.receiver.jaeger "receiver" {
protocols {grpc {
endpoint = "0.0.0.0:0"
}
thrift_binary {
endpoint = "0.0.0.0:0"
}
thrift_compact {
endpoint = "0.0.0.0:0"
}
thrift_http {
endpoint = "0.0.0.0:0"
}
}
debug_metrics {
disable_high_cardinality_metrics = true
}
output {
traces = [otelcol.processor.resourcedetection.default.input]
}
}
otelcol.receiver.zipkin "receiver" {
endpoint = "0.0.0.0:9411"
debug_metrics {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tests:
Please enable one. For example:
applicationObservability:
receivers:
grpc:
enabled: true
otlp:
grpc:
enabled: true
See https://github.com/grafana/k8s-monitoring-helm/tree/main/charts/feature-application-observability for more details.
76 changes: 65 additions & 11 deletions charts/feature-application-observability/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,31 +138,85 @@
"receivers": {
"type": "object",
"properties": {
"grpc": {
"jaeger": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
"grpc": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"port": {
"type": "integer"
}
}
},
"include_debug_metrics": {
"type": "boolean"
},
"port": {
"type": "integer"
"thriftBinary": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"port": {
"type": "integer"
}
}
},
"thriftCompact": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"port": {
"type": "integer"
}
}
},
"thriftHttp": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"port": {
"type": "integer"
}
}
}
}
},
"http": {
"otlp": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
"grpc": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"port": {
"type": "integer"
}
}
},
"http": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"port": {
"type": "integer"
}
}
},
"include_debug_metrics": {
"type": "boolean"
},
"port": {
"type": "integer"
}
}
},
Expand Down
Loading

0 comments on commit 1641db1

Please sign in to comment.