diff --git a/modules/workloads/infra/README.md b/modules/workloads/infra/README.md index f1e36f3..09e5fa5 100644 --- a/modules/workloads/infra/README.md +++ b/modules/workloads/infra/README.md @@ -77,6 +77,7 @@ This module is inspired from the open source [kube-prometheus-stack](https://git | [ne\_config](#input\_ne\_config) | Node exporter configuration |
object({
create_namespace = bool
k8s_namespace = string
helm_chart_name = string
helm_chart_version = string
helm_release_name = string
helm_repo_url = string
helm_settings = map(string)
helm_values = map(any)
scrape_interval = string
scrape_timeout = string
}) | {
"create_namespace": true,
"helm_chart_name": "prometheus-node-exporter",
"helm_chart_version": "2.0.3",
"helm_release_name": "prometheus-node-exporter",
"helm_repo_url": "https://prometheus-community.github.io/helm-charts",
"helm_settings": {},
"helm_values": {},
"k8s_namespace": "prometheus-node-exporter",
"scrape_interval": "60s",
"scrape_timeout": "60s"
} | no |
| [prometheus\_config](#input\_prometheus\_config) | Controls default values such as scrape interval, timeouts and ports globally | object({
global_scrape_interval = string
global_scrape_timeout = string
}) | {
"global_scrape_interval": "60s",
"global_scrape_timeout": "15s"
} | no |
| [tags](#input\_tags) | Additional tags (e.g. `map('BusinessUnit`,`XYZ`) | `map(string)` | `{}` | no |
+| [tracing\_config](#input\_tracing\_config) | Configuration object for traces collection to AWS X-Ray | object({
otlp_grpc_endpoint = string
otlp_http_endpoint = string
send_batch_size = number
timeout = string
}) | {
"otlp_grpc_endpoint": "0.0.0.0:4317",
"otlp_http_endpoint": "0.0.0.0:4318",
"send_batch_size": 50,
"timeout": "30s"
} | no |
## Outputs
diff --git a/modules/workloads/infra/main.tf b/modules/workloads/infra/main.tf
index 6b6dd30..ff7c3eb 100644
--- a/modules/workloads/infra/main.tf
+++ b/modules/workloads/infra/main.tf
@@ -41,7 +41,7 @@ module "helm_addon" {
{
name = local.name
chart = "${path.module}/otel-config"
- version = "0.3.1"
+ version = "0.4.0"
namespace = local.namespace
description = "ADOT helm Chart deployment configuration"
},
@@ -79,11 +79,19 @@ module "helm_addon" {
},
{
name = "otlpHttpEndpoint"
- value = "0.0.0.0:4318"
+ value = var.tracing_config.otlp_http_endpoint
},
{
name = "otlpGrpcEndpoint"
- value = "0.0.0.0:4317"
+ value = var.tracing_config.otlp_grpc_endpoint
+ },
+ {
+ name = "tracingTimeout"
+ value = var.tracing_config.timeout
+ },
+ {
+ name = "tracingSendBatchSize"
+ value = var.tracing_config.send_batch_size
},
{
name = "enableCustomMetrics"
diff --git a/modules/workloads/infra/otel-config/templates/opentelemetrycollector.yaml b/modules/workloads/infra/otel-config/templates/opentelemetrycollector.yaml
index ed42cfa..cd4b3bc 100644
--- a/modules/workloads/infra/otel-config/templates/opentelemetrycollector.yaml
+++ b/modules/workloads/infra/otel-config/templates/opentelemetrycollector.yaml
@@ -3,15 +3,9 @@ kind: OpenTelemetryCollector
metadata:
name: adot
spec:
- image: public.ecr.aws/aws-observability/aws-otel-collector:v0.22.1
{{ if .Values.enableTracing }}
mode: daemonset
hostNetwork: true
- ports:
- - port: 4317
- name: "otlpgrpc"
- - port: 4318
- name: "oltphttp"
{{ else }}
mode: deployment
{{ end }}
@@ -1735,8 +1729,8 @@ spec:
send_batch_size: 500
{{ if .Values.enableTracing }}
batch/traces:
- timeout: 10s
- send_batch_size: 50
+ timeout: {{ .Values.tracingTimeout }}
+ send_batch_size: {{ .Values.tracingBatchSize }}
{{ end }}
service:
extensions: [pprof, zpages, health_check, sigv4auth]
diff --git a/modules/workloads/infra/otel-config/values.yaml b/modules/workloads/infra/otel-config/values.yaml
index db82a5c..29157c7 100644
--- a/modules/workloads/infra/otel-config/values.yaml
+++ b/modules/workloads/infra/otel-config/values.yaml
@@ -8,6 +8,8 @@ globalScrapeSampleLimit: ${global_scrape_sample_limit}
enableTracing: ${enable_tracing}
otlpGrpcEndpoint: ${otlp_grpc_endpoint}
otlpHttpEndpoint: ${otlp_http_endpoint}
+tracingTimeout: ${tracing_timeout}
+tracingSendBatchSize: ${tracing_send_batch_size}
enableCustomMetrics: ${enable_custom_metrics}
customMetricsPorts: ${custom_metrics_ports}
diff --git a/modules/workloads/infra/variables.tf b/modules/workloads/infra/variables.tf
index c6679f3..659180b 100644
--- a/modules/workloads/infra/variables.tf
+++ b/modules/workloads/infra/variables.tf
@@ -164,6 +164,23 @@ variable "enable_tracing" {
default = false
}
+variable "tracing_config" {
+ description = "Configuration object for traces collection to AWS X-Ray"
+ type = object({
+ otlp_grpc_endpoint = string
+ otlp_http_endpoint = string
+ send_batch_size = number
+ timeout = string
+ })
+
+ default = {
+ otlp_grpc_endpoint = "0.0.0.0:4317"
+ otlp_http_endpoint = "0.0.0.0:4318"
+ send_batch_size = 50
+ timeout = "30s"
+ }
+}
+
variable "enable_custom_metrics" {
description = "Allows additional metrics collection for config elements in the `custom_metrics_config` config object. Automatic dashboards are not included"
type = bool