Skip to content

Commit 0c0ac15

Browse files
authored
impr: Tracing to AWS X-Ray config options (#110)
* Remove duplicate exposed ports in ADOT 0.61+ * Sync ADOT collector to ADOT addon version * Bump helm version * Provide configuration options for tracing
1 parent 48f6a0a commit 0c0ac15

File tree

5 files changed

+33
-11
lines changed

5 files changed

+33
-11
lines changed

modules/workloads/infra/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ This module is inspired from the open source [kube-prometheus-stack](https://git
7777
| <a name="input_ne_config"></a> [ne\_config](#input\_ne\_config) | Node exporter 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><br> scrape_interval = string<br> scrape_timeout = string<br> })</pre> | <pre>{<br> "create_namespace": true,<br> "helm_chart_name": "prometheus-node-exporter",<br> "helm_chart_version": "2.0.3",<br> "helm_release_name": "prometheus-node-exporter",<br> "helm_repo_url": "https://prometheus-community.github.io/helm-charts",<br> "helm_settings": {},<br> "helm_values": {},<br> "k8s_namespace": "prometheus-node-exporter",<br> "scrape_interval": "60s",<br> "scrape_timeout": "60s"<br>}</pre> | no |
7878
| <a name="input_prometheus_config"></a> [prometheus\_config](#input\_prometheus\_config) | Controls default values such as scrape interval, timeouts and ports globally | <pre>object({<br> global_scrape_interval = string<br> global_scrape_timeout = string<br> })</pre> | <pre>{<br> "global_scrape_interval": "60s",<br> "global_scrape_timeout": "15s"<br>}</pre> | no |
7979
| <a name="input_tags"></a> [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit`,`XYZ`) | `map(string)` | `{}` | no |
80+
| <a name="input_tracing_config"></a> [tracing\_config](#input\_tracing\_config) | Configuration object for traces collection to AWS X-Ray | <pre>object({<br> otlp_grpc_endpoint = string<br> otlp_http_endpoint = string<br> send_batch_size = number<br> timeout = string<br> })</pre> | <pre>{<br> "otlp_grpc_endpoint": "0.0.0.0:4317",<br> "otlp_http_endpoint": "0.0.0.0:4318",<br> "send_batch_size": 50,<br> "timeout": "30s"<br>}</pre> | no |
8081

8182
## Outputs
8283

modules/workloads/infra/main.tf

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module "helm_addon" {
4141
{
4242
name = local.name
4343
chart = "${path.module}/otel-config"
44-
version = "0.3.1"
44+
version = "0.4.0"
4545
namespace = local.namespace
4646
description = "ADOT helm Chart deployment configuration"
4747
},
@@ -79,11 +79,19 @@ module "helm_addon" {
7979
},
8080
{
8181
name = "otlpHttpEndpoint"
82-
value = "0.0.0.0:4318"
82+
value = var.tracing_config.otlp_http_endpoint
8383
},
8484
{
8585
name = "otlpGrpcEndpoint"
86-
value = "0.0.0.0:4317"
86+
value = var.tracing_config.otlp_grpc_endpoint
87+
},
88+
{
89+
name = "tracingTimeout"
90+
value = var.tracing_config.timeout
91+
},
92+
{
93+
name = "tracingSendBatchSize"
94+
value = var.tracing_config.send_batch_size
8795
},
8896
{
8997
name = "enableCustomMetrics"

modules/workloads/infra/otel-config/templates/opentelemetrycollector.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,9 @@ kind: OpenTelemetryCollector
33
metadata:
44
name: adot
55
spec:
6-
image: public.ecr.aws/aws-observability/aws-otel-collector:v0.22.1
76
{{ if .Values.enableTracing }}
87
mode: daemonset
98
hostNetwork: true
10-
ports:
11-
- port: 4317
12-
name: "otlpgrpc"
13-
- port: 4318
14-
name: "oltphttp"
159
{{ else }}
1610
mode: deployment
1711
{{ end }}
@@ -1735,8 +1729,8 @@ spec:
17351729
send_batch_size: 500
17361730
{{ if .Values.enableTracing }}
17371731
batch/traces:
1738-
timeout: 10s
1739-
send_batch_size: 50
1732+
timeout: {{ .Values.tracingTimeout }}
1733+
send_batch_size: {{ .Values.tracingBatchSize }}
17401734
{{ end }}
17411735
service:
17421736
extensions: [pprof, zpages, health_check, sigv4auth]

modules/workloads/infra/otel-config/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ globalScrapeSampleLimit: ${global_scrape_sample_limit}
88
enableTracing: ${enable_tracing}
99
otlpGrpcEndpoint: ${otlp_grpc_endpoint}
1010
otlpHttpEndpoint: ${otlp_http_endpoint}
11+
tracingTimeout: ${tracing_timeout}
12+
tracingSendBatchSize: ${tracing_send_batch_size}
1113

1214
enableCustomMetrics: ${enable_custom_metrics}
1315
customMetricsPorts: ${custom_metrics_ports}

modules/workloads/infra/variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,23 @@ variable "enable_tracing" {
164164
default = false
165165
}
166166

167+
variable "tracing_config" {
168+
description = "Configuration object for traces collection to AWS X-Ray"
169+
type = object({
170+
otlp_grpc_endpoint = string
171+
otlp_http_endpoint = string
172+
send_batch_size = number
173+
timeout = string
174+
})
175+
176+
default = {
177+
otlp_grpc_endpoint = "0.0.0.0:4317"
178+
otlp_http_endpoint = "0.0.0.0:4318"
179+
send_batch_size = 50
180+
timeout = "30s"
181+
}
182+
}
183+
167184
variable "enable_custom_metrics" {
168185
description = "Allows additional metrics collection for config elements in the `custom_metrics_config` config object. Automatic dashboards are not included"
169186
type = bool

0 commit comments

Comments
 (0)