From e5128094efd7c7488c1a4858ca4d5b298333a6c1 Mon Sep 17 00:00:00 2001 From: Ugur Ozturk Date: Wed, 29 Nov 2023 11:29:06 +0100 Subject: [PATCH 1/3] [etcd]: add etcd distributed tracing flags Signed-off-by: Ugur Ozturk --- inventory/sample/group_vars/etcd.yml | 9 +++++++++ roles/etcd/defaults/main.yml | 7 +++++++ roles/etcd/templates/etcd.env.j2 | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/inventory/sample/group_vars/etcd.yml b/inventory/sample/group_vars/etcd.yml index f07c7209cd1..b245635d966 100644 --- a/inventory/sample/group_vars/etcd.yml +++ b/inventory/sample/group_vars/etcd.yml @@ -24,3 +24,12 @@ ### ETCD: disable peer client cert authentication. # This affects ETCD_PEER_CLIENT_CERT_AUTH variable # etcd_peer_client_auth: true + +## Enable distributed tracing +## To enable this experimental feature, set the etcd_experimental_enable_distributed_tracing: true, along with the +## etcd_experimental_distributed_tracing_sample_rate to choose how many samples to collect per million spans, +## the default sampling rate is 0 https://etcd.io/docs/v3.5/op-guide/monitoring/#distributed-tracing +# etcd_experimental_enable_distributed_tracing: false +# etcd_experimental_distributed_tracing_sample_rate: 100 +# etcd_experimental_distributed_tracing_address: "localhost:4317" +# etcd_experimental_distributed_tracing_service_name: etcd \ No newline at end of file diff --git a/roles/etcd/defaults/main.yml b/roles/etcd/defaults/main.yml index bf38acee556..900818a9068 100644 --- a/roles/etcd/defaults/main.yml +++ b/roles/etcd/defaults/main.yml @@ -120,3 +120,10 @@ etcd_experimental_initial_corrupt_check: true # may contain some private data, so it is recommended to set it to false # in the production environment. unsafe_show_logs: false + +# Enable distributed tracing +# https://etcd.io/docs/v3.5/op-guide/monitoring/#distributed-tracing +etcd_experimental_enable_distributed_tracing: false +etcd_experimental_distributed_tracing_sample_rate: 100 +etcd_experimental_distributed_tracing_address: "localhost:4317" +etcd_experimental_distributed_tracing_service_name: etcd \ No newline at end of file diff --git a/roles/etcd/templates/etcd.env.j2 b/roles/etcd/templates/etcd.env.j2 index 2abd9cc806e..cfd0c649078 100644 --- a/roles/etcd/templates/etcd.env.j2 +++ b/roles/etcd/templates/etcd.env.j2 @@ -68,3 +68,11 @@ ETCDCTL_CERT={{ etcd_cert_dir }}/admin-{{ inventory_hostname }}.pem # ETCD 3.5.x issue # https://groups.google.com/a/kubernetes.io/g/dev/c/B7gJs88XtQc/m/rSgNOzV2BwAJ?utm_medium=email&utm_source=footer ETCD_EXPERIMENTAL_INITIAL_CORRUPT_CHECK={{ etcd_experimental_initial_corrupt_check }} + +{% if etcd_experimental_enable_distributed_tracing %} +ETCD_EXPERIMENTAL_ENABLE_DISTRIBUTED_TRACING=true +ETCD_EXPERIMENTAL_DISTRIBUTED_TRACING_SAMPLE_RATE={{ etcd_experimental_distributed_tracing_sample_rate }} +ETCD_EXPERIMENTAL_DISTRIBUTED_TRACING_ADDRESS={{ etcd_experimental_distributed_tracing_address }} +ETCD_EXPERIMENTAL_DISTRIBUTED_TRACING_SERVICE_NAME={{ etcd_experimental_distributed_tracing_service_name }} +ETCD_EXPERIMENTAL_DISTRUBUTED_TRACING_INSTANCE_ID={{ etcd_member_name }} +{% endif %} \ No newline at end of file From 688660e51f44946e7dd03b99f55f7c971cb1d8c4 Mon Sep 17 00:00:00 2001 From: Ugur Ozturk Date: Wed, 29 Nov 2023 12:17:30 +0100 Subject: [PATCH 2/3] [etcd]: add etcd distributed tracing flags - fix Signed-off-by: Ugur Ozturk --- inventory/sample/group_vars/etcd.yml | 6 +++--- roles/etcd/defaults/main.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inventory/sample/group_vars/etcd.yml b/inventory/sample/group_vars/etcd.yml index b245635d966..68beeb62b2f 100644 --- a/inventory/sample/group_vars/etcd.yml +++ b/inventory/sample/group_vars/etcd.yml @@ -26,9 +26,9 @@ # etcd_peer_client_auth: true ## Enable distributed tracing -## To enable this experimental feature, set the etcd_experimental_enable_distributed_tracing: true, along with the -## etcd_experimental_distributed_tracing_sample_rate to choose how many samples to collect per million spans, -## the default sampling rate is 0 https://etcd.io/docs/v3.5/op-guide/monitoring/#distributed-tracing +## To enable this experimental feature, set the etcd_experimental_enable_distributed_tracing: true, along with the +## etcd_experimental_distributed_tracing_sample_rate to choose how many samples to collect per million spans, +## the default sampling rate is 0 https://etcd.io/docs/v3.5/op-guide/monitoring/#distributed-tracing # etcd_experimental_enable_distributed_tracing: false # etcd_experimental_distributed_tracing_sample_rate: 100 # etcd_experimental_distributed_tracing_address: "localhost:4317" diff --git a/roles/etcd/defaults/main.yml b/roles/etcd/defaults/main.yml index 900818a9068..5eca0ee9e2b 100644 --- a/roles/etcd/defaults/main.yml +++ b/roles/etcd/defaults/main.yml @@ -122,7 +122,7 @@ etcd_experimental_initial_corrupt_check: true unsafe_show_logs: false # Enable distributed tracing -# https://etcd.io/docs/v3.5/op-guide/monitoring/#distributed-tracing +# https://etcd.io/docs/v3.5/op-guide/monitoring/#distributed-tracing etcd_experimental_enable_distributed_tracing: false etcd_experimental_distributed_tracing_sample_rate: 100 etcd_experimental_distributed_tracing_address: "localhost:4317" From ed21f43af9d90c72537217e94c37529a5c741551 Mon Sep 17 00:00:00 2001 From: Ugur Ozturk Date: Wed, 29 Nov 2023 12:24:47 +0100 Subject: [PATCH 3/3] [etcd]: add etcd distributed tracing flags - fix Signed-off-by: Ugur Ozturk --- roles/etcd/templates/etcd.env.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/etcd/templates/etcd.env.j2 b/roles/etcd/templates/etcd.env.j2 index cfd0c649078..13a2437e181 100644 --- a/roles/etcd/templates/etcd.env.j2 +++ b/roles/etcd/templates/etcd.env.j2 @@ -74,5 +74,5 @@ ETCD_EXPERIMENTAL_ENABLE_DISTRIBUTED_TRACING=true ETCD_EXPERIMENTAL_DISTRIBUTED_TRACING_SAMPLE_RATE={{ etcd_experimental_distributed_tracing_sample_rate }} ETCD_EXPERIMENTAL_DISTRIBUTED_TRACING_ADDRESS={{ etcd_experimental_distributed_tracing_address }} ETCD_EXPERIMENTAL_DISTRIBUTED_TRACING_SERVICE_NAME={{ etcd_experimental_distributed_tracing_service_name }} -ETCD_EXPERIMENTAL_DISTRUBUTED_TRACING_INSTANCE_ID={{ etcd_member_name }} +ETCD_EXPERIMENTAL_DISTRIBUTED_TRACING_INSTANCE_ID={{ etcd_member_name }} {% endif %} \ No newline at end of file