Improve tracing (#195)

* Dropping daemonset option

* Update adot loglevel config

* Enable tracing by default

* Init tracing docs

* Add tracing docs

* Update tracing.md

* Update collector endpoint

* Fix tracing instructions
This commit is contained in:
Rodrigue Koffi
2023-08-07 20:59:18 +02:00
committed by GitHub
parent e6083b163f
commit 26371d5210
5 changed files with 218 additions and 92 deletions
+2 -2
View File
@@ -66,7 +66,7 @@ See examples using this Terraform modules in the **Amazon EKS** section of [this
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_adot_loglevel"></a> [adot\_loglevel](#input\_adot\_loglevel) | Verbosity level for ADOT collector logs | `string` | `"warn"` | no |
| <a name="input_adot_loglevel"></a> [adot\_loglevel](#input\_adot\_loglevel) | Verbosity level for ADOT collector logs. This accepts (detailed\|normal\|basic), see https://aws-otel.github.io/docs/components/misc-exporters for mor infos. | `string` | `"normal"` | no |
| <a name="input_custom_metrics_config"></a> [custom\_metrics\_config](#input\_custom\_metrics\_config) | Configuration object to enable custom metrics collection | <pre>map(object({<br> enableBasicAuth = bool<br> path = string<br> basicAuthUsername = string<br> basicAuthPassword = string<br> ports = string<br> droppedSeriesPrefixes = string<br> }))</pre> | `null` | no |
| <a name="input_eks_cluster_id"></a> [eks\_cluster\_id](#input\_eks\_cluster\_id) | EKS Cluster Id | `string` | n/a | yes |
| <a name="input_enable_alerting_rules"></a> [enable\_alerting\_rules](#input\_enable\_alerting\_rules) | Enables or disables Managed Prometheus alerting rules | `bool` | `true` | no |
@@ -84,7 +84,7 @@ See examples using this Terraform modules in the **Amazon EKS** section of [this
| <a name="input_enable_nginx"></a> [enable\_nginx](#input\_enable\_nginx) | Enable NGINX workloads monitoring, alerting and default dashboards | `bool` | `false` | no |
| <a name="input_enable_node_exporter"></a> [enable\_node\_exporter](#input\_enable\_node\_exporter) | Enables or disables Node exporter. Disabling this might affect some data in the dashboards | `bool` | `true` | no |
| <a name="input_enable_recording_rules"></a> [enable\_recording\_rules](#input\_enable\_recording\_rules) | Enables or disables Managed Prometheus recording rules | `bool` | `true` | no |
| <a name="input_enable_tracing"></a> [enable\_tracing](#input\_enable\_tracing) | (Experimental) Enables tracing with AWS X-Ray. This changes the deploy mode of the collector to daemon set. Requirement: adot add-on <= 0.58-build.0 | `bool` | `false` | no |
| <a name="input_enable_tracing"></a> [enable\_tracing](#input\_enable\_tracing) | Enables tracing with OTLP traces receiver to X-Ray | `bool` | `true` | no |
| <a name="input_flux_config"></a> [flux\_config](#input\_flux\_config) | FluxCD configuration | <pre>object({<br> create_namespace = bool<br> k8s_namespace = string<br> helm_chart_name = string<br> helm_chart_version = string<br> helm_release_name = string<br> helm_repo_url = string<br> helm_settings = map(string)<br> helm_values = map(any)<br> })</pre> | <pre>{<br> "create_namespace": true,<br> "helm_chart_name": "flux2",<br> "helm_chart_version": "2.7.0",<br> "helm_release_name": "observability-fluxcd-addon",<br> "helm_repo_url": "https://fluxcd-community.github.io/helm-charts",<br> "helm_settings": {},<br> "helm_values": {},<br> "k8s_namespace": "flux-system"<br>}</pre> | no |
| <a name="input_flux_gitrepository_branch"></a> [flux\_gitrepository\_branch](#input\_flux\_gitrepository\_branch) | Flux GitRepository Branch | `string` | `"main"` | no |
| <a name="input_flux_gitrepository_name"></a> [flux\_gitrepository\_name](#input\_flux\_gitrepository\_name) | Flux GitRepository name | `string` | `"aws-observability-accelerator"` | no |
@@ -3,12 +3,7 @@ kind: OpenTelemetryCollector
metadata:
name: adot
spec:
{{ if .Values.enableTracing }}
mode: daemonset
hostNetwork: true
{{ else }}
mode: deployment
{{ end }}
serviceAccount: adot-collector-kubeprometheus
env:
- name: "K8S_NODE_NAME"
@@ -56,11 +51,6 @@ spec:
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/$${1}/proxy/metrics
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_node_name]
{{ end }}
- job_name: 'kubelet'
scheme: https
tls_config:
@@ -78,11 +68,6 @@ spec:
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/$${1}/proxy/metrics/cadvisor
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_node_name]
{{ end }}
- job_name: 'kube-admin'
scheme: https
tls_config:
@@ -195,11 +180,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -302,11 +282,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -408,11 +383,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -530,11 +500,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -652,11 +617,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -773,11 +733,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -882,11 +837,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -993,11 +943,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -1104,11 +1049,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -1215,11 +1155,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -1326,11 +1261,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -1431,11 +1361,6 @@ spec:
regex: "0"
replacement: $$1
action: keep
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
kubernetes_sd_configs:
- role: endpoints
kubeconfig_file: ""
@@ -1459,11 +1384,6 @@ spec:
- action: replace
source_labels: [__meta_kubernetes_endpoint_node_name]
target_label: nodename
{{ if .Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_endpoint_node_name]
{{ end }}
{{ if .Values.enableCustomMetrics }}
{{- range $k, $v := fromYaml .Values.customMetrics }}
- job_name: "{{ $k }}"
@@ -1494,11 +1414,6 @@ spec:
- action: replace
source_labels: [__meta_kubernetes_pod_controller_kind]
target_label: pod_controller_kind
{{ if $.Values.enableTracing }}
- action: keep
regex: $K8S_NODE_NAME
source_labels: [__meta_kubernetes_pod_node_name]
{{ end }}
metric_relabel_configs:
- source_labels: [ __name__ ]
regex: '{{ $v.droppedSeriesPrefixes }}'
@@ -1644,7 +1559,7 @@ spec:
resource_to_telemetry_conversion:
enabled: true
logging:
loglevel: {{ .Values.adotLoglevel }}
verbosity: {{ .Values.adotLoglevel }}
extensions:
sigv4auth:
region: {{ .Values.region }}
+4 -4
View File
@@ -34,9 +34,9 @@ variable "irsa_iam_permissions_boundary" {
}
variable "adot_loglevel" {
description = "Verbosity level for ADOT collector logs"
description = "Verbosity level for ADOT collector logs. This accepts (detailed|normal|basic), see https://aws-otel.github.io/docs/components/misc-exporters for mor infos."
type = string
default = "warn"
default = "normal"
}
variable "managed_prometheus_workspace_endpoint" {
@@ -202,9 +202,9 @@ variable "prometheus_config" {
}
variable "enable_tracing" {
description = "(Experimental) Enables tracing with AWS X-Ray. This changes the deploy mode of the collector to daemon set. Requirement: adot add-on <= 0.58-build.0"
description = "Enables tracing with OTLP traces receiver to X-Ray"
type = bool
default = false
default = true
}
variable "tracing_config" {