diff --git a/configs/2-1-k8s-eks.json b/configs/2-1-k8s-eks.json index 13a66844a..35e03384e 100644 --- a/configs/2-1-k8s-eks.json +++ b/configs/2-1-k8s-eks.json @@ -70,14 +70,6 @@ "description": "", "hint": "Check this box if you want Logz.io Telemetry Collector to collect only the relevant system metrics to populate Kubernetes 360 and prebuilt dashboards. In addition, we will also collect application metrics that are exposed by your pods.", "value": true - }, - { - "type": "boolean", - "name": "isServiceGraph", - "label": "Collect Service Graph metrics", - "description": "", - "hint": "Check this box if you want Logz.io Telemetry Collector to collect Service Graph metrics to populate the Services Overview.", - "value": true } ], "dashboards": [ @@ -96,7 +88,15 @@ "type": "TRACING", "description": "", "hint": "Switch the toggle on if you want Logz.io Telemetry Collector to collect traces from your instrumented applications in the Kubernetes environment", - "params": [] + "params": [ + { + "type": "boolean", + "name": "isServiceGraph", + "label": "Collect Service Graph metrics", + "description": "", + "hint": "Check this box if you want Logz.io Telemetry Collector to collect Service Graph metrics to populate the Services Overview.", + "value": true + }] } ] }, diff --git a/configs/2-2-k8s-aks.json b/configs/2-2-k8s-aks.json index 18fbfbe8e..3500ef658 100644 --- a/configs/2-2-k8s-aks.json +++ b/configs/2-2-k8s-aks.json @@ -58,14 +58,6 @@ "hint": "Check this box if you want Logz.io Telemetry Collector to collect only the relevant system metrics to populate Kubernetes 360 and prebuilt dashboards. In addition, we will also collect application metrics that are exposed by your pods.", "value": true }, - { - "type": "boolean", - "name": "isServiceGraph", - "label": "Collect Service Graph metrics", - "description": "", - "hint": "Check this box if you want Logz.io Telemetry Collector to collect Service Graph metrics to populate the Services Overview.", - "value": true - }, { "type": "boolean", "name": "isWindows", @@ -90,7 +82,15 @@ { "type": "TRACING", "hint": "Switch the toggle on if you want Logz.io Telemetry Collector to collect traces from your instrumented applications in the Kubernetes environment", - "params": [] + "params": [ + { + "type": "boolean", + "name": "isServiceGraph", + "label": "Collect Service Graph metrics", + "description": "", + "hint": "Check this box if you want Logz.io Telemetry Collector to collect Service Graph metrics to populate the Services Overview.", + "value": true + }] } ] }, diff --git a/configs/2-3-k8s-gke.json b/configs/2-3-k8s-gke.json index cce77508a..8193f9e86 100644 --- a/configs/2-3-k8s-gke.json +++ b/configs/2-3-k8s-gke.json @@ -62,14 +62,6 @@ "description": "", "hint": "Check this box if you want Logz.io Telemetry Collector to collect only the relevant system metrics to populate Kubernetes 360 and prebuilt dashboards. In addition, we will also collect application metrics that are exposed by your pods.", "value": true - }, - { - "type": "boolean", - "name": "isServiceGraph", - "label": "Collect Service Graph metrics", - "description": "", - "hint": "Check this box if you want Logz.io Telemetry Collector to collect Service Graph metrics to populate the Services Overview.", - "value": true } ], "dashboards": [ @@ -88,7 +80,15 @@ "type": "TRACING", "description": "", "hint": "Switch the toggle on if you want Logz.io Telemetry Collector to collect traces from your instrumented applications in the Kubernetes environment", - "params": [] + "params": [ + { + "type": "boolean", + "name": "isServiceGraph", + "label": "Collect Service Graph metrics", + "description": "", + "hint": "Check this box if you want Logz.io Telemetry Collector to collect Service Graph metrics to populate the Services Overview.", + "value": true + }] } ] }, diff --git a/configs/2-4-k8s-digitalocean.json b/configs/2-4-k8s-digitalocean.json index 8d1fffb94..d77f76a4e 100644 --- a/configs/2-4-k8s-digitalocean.json +++ b/configs/2-4-k8s-digitalocean.json @@ -62,14 +62,6 @@ "description": "", "hint": "Check this box if you want Logz.io Telemetry Collector to collect only the relevant system metrics to populate Kubernetes 360 and prebuilt dashboards. In addition, we will also collect application metrics that are exposed by your pods.", "value": true - }, - { - "type": "boolean", - "name": "isServiceGraph", - "label": "Collect Service Graph metrics", - "description": "", - "hint": "Check this box if you want Logz.io Telemetry Collector to collect Service Graph metrics to populate the Services Overview.", - "value": true } ], "dashboards": [ @@ -88,7 +80,15 @@ "type": "TRACING", "description": "", "hint": "Switch the toggle on if you want Logz.io Telemetry Collector to collect traces from your instrumented applications in the Kubernetes environment", - "params": [] + "params": [ + { + "type": "boolean", + "name": "isServiceGraph", + "label": "Collect Service Graph metrics", + "description": "", + "hint": "Check this box if you want Logz.io Telemetry Collector to collect Service Graph metrics to populate the Services Overview.", + "value": true + }] } ] }, diff --git a/datasources/linux/kubernetes/aks/kubernetes/telemetry/metrics/metrics.bash b/datasources/linux/kubernetes/aks/kubernetes/telemetry/metrics/metrics.bash index b11fa83f7..f634bb919 100755 --- a/datasources/linux/kubernetes/aks/kubernetes/telemetry/metrics/metrics.bash +++ b/datasources/linux/kubernetes/aks/kubernetes/telemetry/metrics/metrics.bash @@ -35,7 +35,4 @@ if $IS_FILTER; then # Build enable metrics filter Helm set CLOUD_PROVIDER='aks' execute_task 'build_enable_metrics_filter_helm_set' 'Building enable metrics filter Helm set' -fi -if $IS_SERVICE_GRAPH; then - execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/datasources/linux/kubernetes/aks/kubernetes/telemetry/traces/traces.bash b/datasources/linux/kubernetes/aks/kubernetes/telemetry/traces/traces.bash index c4ad76615..7c1283112 100755 --- a/datasources/linux/kubernetes/aks/kubernetes/telemetry/traces/traces.bash +++ b/datasources/linux/kubernetes/aks/kubernetes/telemetry/traces/traces.bash @@ -29,3 +29,8 @@ execute_task 'get_logzio_metrics_token' 'Getting Logz.io SPM token' execute_task 'build_enable_spm_helm_set' 'Building enable SPM Helm set' # Build Logz.io SPM token Helm set execute_task 'build_logzio_spm_token_helm_set' 'Building Logz.io SPM token Helm set' +# Get if service graph option was selected +execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' +if $IS_SERVICE_GRAPH; then + execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' +fi \ No newline at end of file diff --git a/datasources/linux/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.bash b/datasources/linux/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.bash index eb5a2e7d5..56313afb4 100755 --- a/datasources/linux/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.bash +++ b/datasources/linux/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.bash @@ -29,9 +29,4 @@ if $IS_FILTER; then # Build enable metrics filter Helm set CLOUD_PROVIDER='aks' execute_task 'build_enable_metrics_filter_helm_set' 'Building enable metrics filter Helm set' -fi -# Get if service graph option was selected -execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' -if $IS_SERVICE_GRAPH; then - execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/datasources/linux/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.bash b/datasources/linux/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.bash index c4ad76615..7c1283112 100755 --- a/datasources/linux/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.bash +++ b/datasources/linux/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.bash @@ -29,3 +29,8 @@ execute_task 'get_logzio_metrics_token' 'Getting Logz.io SPM token' execute_task 'build_enable_spm_helm_set' 'Building enable SPM Helm set' # Build Logz.io SPM token Helm set execute_task 'build_logzio_spm_token_helm_set' 'Building Logz.io SPM token Helm set' +# Get if service graph option was selected +execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' +if $IS_SERVICE_GRAPH; then + execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' +fi \ No newline at end of file diff --git a/datasources/linux/kubernetes/eks/kubernetes/telemetry/metrics/metrics.bash b/datasources/linux/kubernetes/eks/kubernetes/telemetry/metrics/metrics.bash index 05e9d2fff..75a810582 100755 --- a/datasources/linux/kubernetes/eks/kubernetes/telemetry/metrics/metrics.bash +++ b/datasources/linux/kubernetes/eks/kubernetes/telemetry/metrics/metrics.bash @@ -33,9 +33,4 @@ fi if $IS_FARGATE; then # Build Fargate collector mode standalone Helm set execute_task 'build_fargate_collector_mode_standalone_helm_set' 'Building Fargate collector mode standalone Helm set' -fi -# Get if service graph option was selected -execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' -if $IS_SERVICE_GRAPH; then - execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/datasources/linux/kubernetes/eks/kubernetes/telemetry/traces/traces.bash b/datasources/linux/kubernetes/eks/kubernetes/telemetry/traces/traces.bash index c4ad76615..7c1283112 100755 --- a/datasources/linux/kubernetes/eks/kubernetes/telemetry/traces/traces.bash +++ b/datasources/linux/kubernetes/eks/kubernetes/telemetry/traces/traces.bash @@ -29,3 +29,8 @@ execute_task 'get_logzio_metrics_token' 'Getting Logz.io SPM token' execute_task 'build_enable_spm_helm_set' 'Building enable SPM Helm set' # Build Logz.io SPM token Helm set execute_task 'build_logzio_spm_token_helm_set' 'Building Logz.io SPM token Helm set' +# Get if service graph option was selected +execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' +if $IS_SERVICE_GRAPH; then + execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' +fi \ No newline at end of file diff --git a/datasources/linux/kubernetes/gke/kubernetes/telemetry/metrics/metrics.bash b/datasources/linux/kubernetes/gke/kubernetes/telemetry/metrics/metrics.bash index 7f320b025..7fef696ef 100755 --- a/datasources/linux/kubernetes/gke/kubernetes/telemetry/metrics/metrics.bash +++ b/datasources/linux/kubernetes/gke/kubernetes/telemetry/metrics/metrics.bash @@ -29,9 +29,4 @@ if $IS_FILTER; then # Build enable metrics filter Helm set CLOUD_PROVIDER='gke' execute_task 'build_enable_metrics_filter_helm_set' 'Building enable metrics filter Helm set' -fi -# Get if service graph option was selected -execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' -if $IS_SERVICE_GRAPH; then - execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/datasources/linux/kubernetes/gke/kubernetes/telemetry/traces/traces.bash b/datasources/linux/kubernetes/gke/kubernetes/telemetry/traces/traces.bash index c4ad76615..7c1283112 100755 --- a/datasources/linux/kubernetes/gke/kubernetes/telemetry/traces/traces.bash +++ b/datasources/linux/kubernetes/gke/kubernetes/telemetry/traces/traces.bash @@ -29,3 +29,8 @@ execute_task 'get_logzio_metrics_token' 'Getting Logz.io SPM token' execute_task 'build_enable_spm_helm_set' 'Building enable SPM Helm set' # Build Logz.io SPM token Helm set execute_task 'build_logzio_spm_token_helm_set' 'Building Logz.io SPM token Helm set' +# Get if service graph option was selected +execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' +if $IS_SERVICE_GRAPH; then + execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' +fi \ No newline at end of file diff --git a/datasources/mac/kubernetes/aks/kubernetes/telemetry/metrics/metrics.bash b/datasources/mac/kubernetes/aks/kubernetes/telemetry/metrics/metrics.bash index 8396c3a68..ada7a1da6 100755 --- a/datasources/mac/kubernetes/aks/kubernetes/telemetry/metrics/metrics.bash +++ b/datasources/mac/kubernetes/aks/kubernetes/telemetry/metrics/metrics.bash @@ -35,9 +35,4 @@ if $IS_FILTER; then # Build enable metrics filter Helm set CLOUD_PROVIDER='aks' execute_task 'build_enable_metrics_filter_helm_set' 'Building enable metrics filter Helm set' -fi -# Get if service graph option was selected -execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' -if $IS_SERVICE_GRAPH; then - execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/datasources/mac/kubernetes/aks/kubernetes/telemetry/traces/traces.bash b/datasources/mac/kubernetes/aks/kubernetes/telemetry/traces/traces.bash index dcd85ddcf..52f2b4ed6 100755 --- a/datasources/mac/kubernetes/aks/kubernetes/telemetry/traces/traces.bash +++ b/datasources/mac/kubernetes/aks/kubernetes/telemetry/traces/traces.bash @@ -29,3 +29,8 @@ execute_task 'get_logzio_metrics_token' 'Getting Logz.io SPM token' execute_task 'build_enable_spm_helm_set' 'Building enable SPM Helm set' # Build Logz.io SPM token Helm set execute_task 'build_logzio_spm_token_helm_set' 'Building Logz.io SPM token Helm set' +# Get if service graph option was selected +execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' +if $IS_SERVICE_GRAPH; then + execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' +fi \ No newline at end of file diff --git a/datasources/mac/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.bash b/datasources/mac/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.bash index b53d94d5e..0a47e0e38 100755 --- a/datasources/mac/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.bash +++ b/datasources/mac/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.bash @@ -29,9 +29,4 @@ if $IS_FILTER; then # Build enable metrics filter Helm set CLOUD_PROVIDER='aks' execute_task 'build_enable_metrics_filter_helm_set' 'Building enable metrics filter Helm set' -fi -# Get if service graph option was selected -execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' -if $IS_SERVICE_GRAPH; then - execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/datasources/mac/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.bash b/datasources/mac/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.bash index dcd85ddcf..52f2b4ed6 100755 --- a/datasources/mac/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.bash +++ b/datasources/mac/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.bash @@ -29,3 +29,8 @@ execute_task 'get_logzio_metrics_token' 'Getting Logz.io SPM token' execute_task 'build_enable_spm_helm_set' 'Building enable SPM Helm set' # Build Logz.io SPM token Helm set execute_task 'build_logzio_spm_token_helm_set' 'Building Logz.io SPM token Helm set' +# Get if service graph option was selected +execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' +if $IS_SERVICE_GRAPH; then + execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' +fi \ No newline at end of file diff --git a/datasources/mac/kubernetes/eks/kubernetes/telemetry/metrics/metrics.bash b/datasources/mac/kubernetes/eks/kubernetes/telemetry/metrics/metrics.bash index 7088a74d5..3d2b07a11 100755 --- a/datasources/mac/kubernetes/eks/kubernetes/telemetry/metrics/metrics.bash +++ b/datasources/mac/kubernetes/eks/kubernetes/telemetry/metrics/metrics.bash @@ -33,9 +33,4 @@ fi if $IS_FARGATE; then # Build Fargate collector mode standalone Helm set execute_task 'build_fargate_collector_mode_standalone_helm_set' 'Building Fargate collector mode standalone Helm set' -fi -# Get if service graph option was selected -execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' -if $IS_SERVICE_GRAPH; then - execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/datasources/mac/kubernetes/eks/kubernetes/telemetry/traces/traces.bash b/datasources/mac/kubernetes/eks/kubernetes/telemetry/traces/traces.bash index dcd85ddcf..52f2b4ed6 100755 --- a/datasources/mac/kubernetes/eks/kubernetes/telemetry/traces/traces.bash +++ b/datasources/mac/kubernetes/eks/kubernetes/telemetry/traces/traces.bash @@ -29,3 +29,8 @@ execute_task 'get_logzio_metrics_token' 'Getting Logz.io SPM token' execute_task 'build_enable_spm_helm_set' 'Building enable SPM Helm set' # Build Logz.io SPM token Helm set execute_task 'build_logzio_spm_token_helm_set' 'Building Logz.io SPM token Helm set' +# Get if service graph option was selected +execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' +if $IS_SERVICE_GRAPH; then + execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' +fi \ No newline at end of file diff --git a/datasources/mac/kubernetes/gke/kubernetes/telemetry/metrics/metrics.bash b/datasources/mac/kubernetes/gke/kubernetes/telemetry/metrics/metrics.bash index 96bd7dcd6..78fd7d584 100755 --- a/datasources/mac/kubernetes/gke/kubernetes/telemetry/metrics/metrics.bash +++ b/datasources/mac/kubernetes/gke/kubernetes/telemetry/metrics/metrics.bash @@ -29,9 +29,4 @@ if $IS_FILTER; then # Build enable metrics filter Helm set CLOUD_PROVIDER='gke' execute_task 'build_enable_metrics_filter_helm_set' 'Building enable metrics filter Helm set' -fi -# Get if service graph option was selected -execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' -if $IS_SERVICE_GRAPH; then - execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' -fi \ No newline at end of file +fi \ No newline at end of file diff --git a/datasources/mac/kubernetes/gke/kubernetes/telemetry/traces/traces.bash b/datasources/mac/kubernetes/gke/kubernetes/telemetry/traces/traces.bash index dcd85ddcf..52f2b4ed6 100755 --- a/datasources/mac/kubernetes/gke/kubernetes/telemetry/traces/traces.bash +++ b/datasources/mac/kubernetes/gke/kubernetes/telemetry/traces/traces.bash @@ -29,3 +29,8 @@ execute_task 'get_logzio_metrics_token' 'Getting Logz.io SPM token' execute_task 'build_enable_spm_helm_set' 'Building enable SPM Helm set' # Build Logz.io SPM token Helm set execute_task 'build_logzio_spm_token_helm_set' 'Building Logz.io SPM token Helm set' +# Get if service graph option was selected +execute_task 'get_is_service_graph_was_selected' 'Getting is service graph option was selected' +if $IS_SERVICE_GRAPH; then + execute_task 'build_enable_service_graph_helm_set' 'Building service graph Helm set' +fi \ No newline at end of file diff --git a/datasources/windows/kubernetes/aks/kubernetes/telemetry/metrics/functions.ps1 b/datasources/windows/kubernetes/aks/kubernetes/telemetry/metrics/functions.ps1 index a643259f8..f55752474 100755 --- a/datasources/windows/kubernetes/aks/kubernetes/telemetry/metrics/functions.ps1 +++ b/datasources/windows/kubernetes/aks/kubernetes/telemetry/metrics/functions.ps1 @@ -258,78 +258,4 @@ function Build-EnableMetricsFilterHelmSet { Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" -} - -# Gets is service graph was selected -# Input: -# FuncArgs - Hashtable {MetricsParams = $script:MetricsParams} -# Output: -# IsServiceGraph - Tells if service graph was selected (true/false) -function Get-IsServiceGraphWasSelected { - param ( - [hashtable]$FuncArgs - ) - - $local:ExitCode = 4 - $local:FuncName = $MyInvocation.MyCommand.Name - - $local:Message = 'Getting if service graph option was selected ...' - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - $local:Err = Test-AreFuncArgsExist $FuncArgs @('MetricsParams') - if ($Err.Count -ne 0) { - $Message = "metrics.ps1 ($ExitCode): $($Err[0])" - Send-LogToLogzio $script:LogLevelError $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-TaskPostRun "Write-Error `"$Message`"" - - return $ExitCode - } - - $local:MetricsParams = $FuncArgs.MetricsParams - - $Err = Get-ParamValue $MetricsParams 'isServiceGraph' - if ($Err.Count -ne 0) { - $Message = "metrics.ps1 ($ExitCode): $($Err[0])" - Send-LogToLogzio $script:LogLevelError $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-TaskPostRun "Write-Error `"$Message`"" - - return $ExitCode - } - - $local:IsServiceGraph = $script:ParamValue - - if ($IsServiceGraph) { - $Message = 'Service Graph option was selected' - } - else { - $Message = 'Service Graph option was not selected' - } - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - Write-TaskPostRun "`$script:IsServiceGraph = `$$IsServiceGraph" -} - -# Builds enable service graph Helm set -# Input: -# --- -# Output: -# LogHelmSets - Containt all the Helm sets for logging -# HelmSets - Contains all the Helm sets -function Build-EnableServiceGraphHelmSet { - $local:FuncName = $MyInvocation.MyCommand.Name - - $local:Message = 'Building service graph Helm set ...' - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - $local:HelmSet = " --set logzio-k8s-telemetry.serviceGraph.enabled=true" - - $local:Message = "Enable service graph Helm set is '$HelmSet'" - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" - Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" -} +} \ No newline at end of file diff --git a/datasources/windows/kubernetes/aks/kubernetes/telemetry/metrics/metrics.ps1 b/datasources/windows/kubernetes/aks/kubernetes/telemetry/metrics/metrics.ps1 index 4fa24689f..49f780849 100755 --- a/datasources/windows/kubernetes/aks/kubernetes/telemetry/metrics/metrics.ps1 +++ b/datasources/windows/kubernetes/aks/kubernetes/telemetry/metrics/metrics.ps1 @@ -60,11 +60,5 @@ if ($script:IsFilter) { # Build enable metrics filter Helm set Invoke-Task 'Build-EnableMetricsFilterHelmSet' @{} 'Building enable metrics filter Helm set' @($MetricsFunctionsScript) } -# Get if service graph option was selected -Invoke-Task 'Get-IsServiceGraphWasSelected' @{MetricsParams = $script:MetricsParams} 'Getting if service graph was selected' @($MetricsFunctionsScript) -if ($script:IsServiceGraph) { - # Build enable metrics filter Helm set - Invoke-Task 'Build-EnableServiceGraphHelmSet' @{} 'Building enable service graph Helm set' @($MetricsFunctionsScript) -} # Finished successfully Exit 0 diff --git a/datasources/windows/kubernetes/aks/kubernetes/telemetry/traces/functions.ps1 b/datasources/windows/kubernetes/aks/kubernetes/telemetry/traces/functions.ps1 index a8fdeb64b..b627ac529 100755 --- a/datasources/windows/kubernetes/aks/kubernetes/telemetry/traces/functions.ps1 +++ b/datasources/windows/kubernetes/aks/kubernetes/telemetry/traces/functions.ps1 @@ -231,3 +231,77 @@ function Build-LogzioSpmTokenHelmSet { Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" } + +# Gets is service graph was selected +# Input: +# FuncArgs - Hashtable {TracesParams = $script:TracesParams} +# Output: +# IsServiceGraph - Tells if service graph was selected (true/false) +function Get-IsServiceGraphWasSelected { + param ( + [hashtable]$FuncArgs + ) + + $local:ExitCode = 4 + $local:FuncName = $MyInvocation.MyCommand.Name + + $local:Message = 'Getting if service graph option was selected ...' + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + $local:Err = Test-AreFuncArgsExist $FuncArgs @('TracesParams') + if ($Err.Count -ne 0) { + $Message = "traces.ps1 ($ExitCode): $($Err[0])" + Send-LogToLogzio $script:LogLevelError $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-TaskPostRun "Write-Error `"$Message`"" + + return $ExitCode + } + + $local:TracesParams = $FuncArgs.TracesParams + + $Err = Get-ParamValue $TracesParams 'isServiceGraph' + if ($Err.Count -ne 0) { + $Message = "traces.ps1 ($ExitCode): $($Err[0])" + Send-LogToLogzio $script:LogLevelError $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-TaskPostRun "Write-Error `"$Message`"" + + return $ExitCode + } + + $local:IsServiceGraph = $script:ParamValue + + if ($IsServiceGraph) { + $Message = 'Service Graph option was selected' + } + else { + $Message = 'Service Graph option was not selected' + } + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + Write-TaskPostRun "`$script:IsServiceGraph = `$$IsServiceGraph" +} + +# Builds enable service graph Helm set +# Input: +# --- +# Output: +# LogHelmSets - Containt all the Helm sets for logging +# HelmSets - Contains all the Helm sets +function Build-EnableServiceGraphHelmSet { + $local:FuncName = $MyInvocation.MyCommand.Name + + $local:Message = 'Building service graph Helm set ...' + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + $local:HelmSet = " --set logzio-k8s-telemetry.serviceGraph.enabled=true" + + $local:Message = "Enable service graph Helm set is '$HelmSet'" + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" + Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" +} diff --git a/datasources/windows/kubernetes/aks/kubernetes/telemetry/traces/traces.ps1 b/datasources/windows/kubernetes/aks/kubernetes/telemetry/traces/traces.ps1 index 366108b3e..4b3f2c3d7 100755 --- a/datasources/windows/kubernetes/aks/kubernetes/telemetry/traces/traces.ps1 +++ b/datasources/windows/kubernetes/aks/kubernetes/telemetry/traces/traces.ps1 @@ -26,6 +26,11 @@ Invoke-Task 'Get-LogzioSpmToken' @{} 'Getting Logz.io SPM token' @($TracesFuncti Invoke-Task 'Build-EnableSpmHelmSet' @{} 'Building enable SPM Helm set' @($TracesFunctionsScript) # Build Logz.io SPM token Helm set Invoke-Task 'Build-LogzioSpmTokenHelmSet' @{SpmToken = $script:SpmToken} 'Building Logz.io SPM token Helm set' @($TracesFunctionsScript) - +# Get if service graph option was selected +Invoke-Task 'Get-IsServiceGraphWasSelected' @{MetricsParams = $script:MetricsParams} 'Getting if service graph was selected' @($MetricsFunctionsScript) +if ($script:IsServiceGraph) { + # Build enable metrics filter Helm set + Invoke-Task 'Build-EnableServiceGraphHelmSet' @{} 'Building enable service graph Helm set' @($MetricsFunctionsScript) +} # Finished successfully Exit 0 diff --git a/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/metrics/functions.ps1 b/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/metrics/functions.ps1 index 87d8084a3..51612b043 100755 --- a/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/metrics/functions.ps1 +++ b/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/metrics/functions.ps1 @@ -208,77 +208,3 @@ function Build-EnableMetricsFilterHelmSet { Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" } - -# Gets is service graph was selected -# Input: -# FuncArgs - Hashtable {MetricsParams = $script:MetricsParams} -# Output: -# IsServiceGraph - Tells if service graph was selected (true/false) -function Get-IsServiceGraphWasSelected { - param ( - [hashtable]$FuncArgs - ) - - $local:ExitCode = 4 - $local:FuncName = $MyInvocation.MyCommand.Name - - $local:Message = 'Getting if service graph option was selected ...' - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - $local:Err = Test-AreFuncArgsExist $FuncArgs @('MetricsParams') - if ($Err.Count -ne 0) { - $Message = "metrics.ps1 ($ExitCode): $($Err[0])" - Send-LogToLogzio $script:LogLevelError $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-TaskPostRun "Write-Error `"$Message`"" - - return $ExitCode - } - - $local:MetricsParams = $FuncArgs.MetricsParams - - $Err = Get-ParamValue $MetricsParams 'isServiceGraph' - if ($Err.Count -ne 0) { - $Message = "metrics.ps1 ($ExitCode): $($Err[0])" - Send-LogToLogzio $script:LogLevelError $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-TaskPostRun "Write-Error `"$Message`"" - - return $ExitCode - } - - $local:IsServiceGraph = $script:ParamValue - - if ($IsServiceGraph) { - $Message = 'Service Graph option was selected' - } - else { - $Message = 'Service Graph option was not selected' - } - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - Write-TaskPostRun "`$script:IsServiceGraph = `$$IsServiceGraph" -} - -# Builds enable service graph Helm set -# Input: -# --- -# Output: -# LogHelmSets - Containt all the Helm sets for logging -# HelmSets - Contains all the Helm sets -function Build-EnableServiceGraphHelmSet { - $local:FuncName = $MyInvocation.MyCommand.Name - - $local:Message = 'Building service graph Helm set ...' - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - $local:HelmSet = " --set logzio-k8s-telemetry.serviceGraph.enabled=true" - - $local:Message = "Enable service graph Helm set is '$HelmSet'" - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" - Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" -} diff --git a/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.ps1 b/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.ps1 index 1a64f27c7..7070260cf 100755 --- a/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.ps1 +++ b/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/metrics/metrics.ps1 @@ -26,11 +26,5 @@ if ($script:IsFilter) { # Build enable metrics filter Helm set Invoke-Task 'Build-EnableMetricsFilterHelmSet' @{} 'Building enable metrics filter Helm set' @($MetricsFunctionsScript) } -# Get if service graph option was selected -Invoke-Task 'Get-IsServiceGraphWasSelected' @{MetricsParams = $script:MetricsParams} 'Getting if service graph was selected' @($MetricsFunctionsScript) -if ($script:IsServiceGraph) { - # Build enable metrics filter Helm set - Invoke-Task 'Build-EnableServiceGraphHelmSet' @{} 'Building enable service graph Helm set' @($MetricsFunctionsScript) -} # Finished successfully Exit 0 diff --git a/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/traces/functions.ps1 b/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/traces/functions.ps1 index a8fdeb64b..ff37ccb20 100755 --- a/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/traces/functions.ps1 +++ b/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/traces/functions.ps1 @@ -231,3 +231,78 @@ function Build-LogzioSpmTokenHelmSet { Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" } + + +# Gets is service graph was selected +# Input: +# FuncArgs - Hashtable {TracesParams = $script:TracesParams} +# Output: +# IsServiceGraph - Tells if service graph was selected (true/false) +function Get-IsServiceGraphWasSelected { + param ( + [hashtable]$FuncArgs + ) + + $local:ExitCode = 4 + $local:FuncName = $MyInvocation.MyCommand.Name + + $local:Message = 'Getting if service graph option was selected ...' + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + $local:Err = Test-AreFuncArgsExist $FuncArgs @('TracesParams') + if ($Err.Count -ne 0) { + $Message = "traces.ps1 ($ExitCode): $($Err[0])" + Send-LogToLogzio $script:LogLevelError $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-TaskPostRun "Write-Error `"$Message`"" + + return $ExitCode + } + + $local:TracesParams = $FuncArgs.TracesParams + + $Err = Get-ParamValue $TracesParams 'isServiceGraph' + if ($Err.Count -ne 0) { + $Message = "traces.ps1 ($ExitCode): $($Err[0])" + Send-LogToLogzio $script:LogLevelError $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-TaskPostRun "Write-Error `"$Message`"" + + return $ExitCode + } + + $local:IsServiceGraph = $script:ParamValue + + if ($IsServiceGraph) { + $Message = 'Service Graph option was selected' + } + else { + $Message = 'Service Graph option was not selected' + } + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + Write-TaskPostRun "`$script:IsServiceGraph = `$$IsServiceGraph" +} + +# Builds enable service graph Helm set +# Input: +# --- +# Output: +# LogHelmSets - Containt all the Helm sets for logging +# HelmSets - Contains all the Helm sets +function Build-EnableServiceGraphHelmSet { + $local:FuncName = $MyInvocation.MyCommand.Name + + $local:Message = 'Building service graph Helm set ...' + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + $local:HelmSet = " --set logzio-k8s-telemetry.serviceGraph.enabled=true" + + $local:Message = "Enable service graph Helm set is '$HelmSet'" + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" + Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" +} diff --git a/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.ps1 b/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.ps1 index 366108b3e..4b3f2c3d7 100755 --- a/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.ps1 +++ b/datasources/windows/kubernetes/digitalocean/kubernetes/telemetry/traces/traces.ps1 @@ -26,6 +26,11 @@ Invoke-Task 'Get-LogzioSpmToken' @{} 'Getting Logz.io SPM token' @($TracesFuncti Invoke-Task 'Build-EnableSpmHelmSet' @{} 'Building enable SPM Helm set' @($TracesFunctionsScript) # Build Logz.io SPM token Helm set Invoke-Task 'Build-LogzioSpmTokenHelmSet' @{SpmToken = $script:SpmToken} 'Building Logz.io SPM token Helm set' @($TracesFunctionsScript) - +# Get if service graph option was selected +Invoke-Task 'Get-IsServiceGraphWasSelected' @{MetricsParams = $script:MetricsParams} 'Getting if service graph was selected' @($MetricsFunctionsScript) +if ($script:IsServiceGraph) { + # Build enable metrics filter Helm set + Invoke-Task 'Build-EnableServiceGraphHelmSet' @{} 'Building enable service graph Helm set' @($MetricsFunctionsScript) +} # Finished successfully Exit 0 diff --git a/datasources/windows/kubernetes/eks/kubernetes/telemetry/metrics/functions.ps1 b/datasources/windows/kubernetes/eks/kubernetes/telemetry/metrics/functions.ps1 index a0ed95cba..c631e4c07 100755 --- a/datasources/windows/kubernetes/eks/kubernetes/telemetry/metrics/functions.ps1 +++ b/datasources/windows/kubernetes/eks/kubernetes/telemetry/metrics/functions.ps1 @@ -230,78 +230,4 @@ function Build-FargateCollectorModeStandaloneHelmSet { Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" -} - -# Gets is service graph was selected -# Input: -# FuncArgs - Hashtable {MetricsParams = $script:MetricsParams} -# Output: -# IsServiceGraph - Tells if service graph was selected (true/false) -function Get-IsServiceGraphWasSelected { - param ( - [hashtable]$FuncArgs - ) - - $local:ExitCode = 4 - $local:FuncName = $MyInvocation.MyCommand.Name - - $local:Message = 'Getting if service graph option was selected ...' - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - $local:Err = Test-AreFuncArgsExist $FuncArgs @('MetricsParams') - if ($Err.Count -ne 0) { - $Message = "metrics.ps1 ($ExitCode): $($Err[0])" - Send-LogToLogzio $script:LogLevelError $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-TaskPostRun "Write-Error `"$Message`"" - - return $ExitCode - } - - $local:MetricsParams = $FuncArgs.MetricsParams - - $Err = Get-ParamValue $MetricsParams 'isServiceGraph' - if ($Err.Count -ne 0) { - $Message = "metrics.ps1 ($ExitCode): $($Err[0])" - Send-LogToLogzio $script:LogLevelError $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-TaskPostRun "Write-Error `"$Message`"" - - return $ExitCode - } - - $local:IsServiceGraph = $script:ParamValue - - if ($IsServiceGraph) { - $Message = 'Service Graph option was selected' - } - else { - $Message = 'Service Graph option was not selected' - } - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - Write-TaskPostRun "`$script:IsServiceGraph = `$$IsServiceGraph" -} - -# Builds enable service graph Helm set -# Input: -# --- -# Output: -# LogHelmSets - Containt all the Helm sets for logging -# HelmSets - Contains all the Helm sets -function Build-EnableServiceGraphHelmSet { - $local:FuncName = $MyInvocation.MyCommand.Name - - $local:Message = 'Building service graph Helm set ...' - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - $local:HelmSet = " --set logzio-k8s-telemetry.serviceGraph.enabled=true" - - $local:Message = "Enable service graph Helm set is '$HelmSet'" - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" - Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" -} +} \ No newline at end of file diff --git a/datasources/windows/kubernetes/eks/kubernetes/telemetry/metrics/metrics.ps1 b/datasources/windows/kubernetes/eks/kubernetes/telemetry/metrics/metrics.ps1 index c326a44c3..eb137b921 100755 --- a/datasources/windows/kubernetes/eks/kubernetes/telemetry/metrics/metrics.ps1 +++ b/datasources/windows/kubernetes/eks/kubernetes/telemetry/metrics/metrics.ps1 @@ -30,11 +30,5 @@ if ($script:IsFargate) { # Build Fargate collector mode standalone Helm set Invoke-Task 'Build-FargateCollectorModeStandaloneHelmSet' @{} 'Building Fargate collector mode standalone Helm set' @($MetricsFunctionsScript) } -# Get if service graph option was selected -Invoke-Task 'Get-IsServiceGraphWasSelected' @{MetricsParams = $script:MetricsParams} 'Getting if service graph was selected' @($MetricsFunctionsScript) -if ($script:IsServiceGraph) { - # Build enable metrics filter Helm set - Invoke-Task 'Build-EnableServiceGraphHelmSet' @{} 'Building enable service graph Helm set' @($MetricsFunctionsScript) -} # Finished successfully Exit 0 diff --git a/datasources/windows/kubernetes/eks/kubernetes/telemetry/traces/functions.ps1 b/datasources/windows/kubernetes/eks/kubernetes/telemetry/traces/functions.ps1 index a8fdeb64b..ff37ccb20 100755 --- a/datasources/windows/kubernetes/eks/kubernetes/telemetry/traces/functions.ps1 +++ b/datasources/windows/kubernetes/eks/kubernetes/telemetry/traces/functions.ps1 @@ -231,3 +231,78 @@ function Build-LogzioSpmTokenHelmSet { Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" } + + +# Gets is service graph was selected +# Input: +# FuncArgs - Hashtable {TracesParams = $script:TracesParams} +# Output: +# IsServiceGraph - Tells if service graph was selected (true/false) +function Get-IsServiceGraphWasSelected { + param ( + [hashtable]$FuncArgs + ) + + $local:ExitCode = 4 + $local:FuncName = $MyInvocation.MyCommand.Name + + $local:Message = 'Getting if service graph option was selected ...' + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + $local:Err = Test-AreFuncArgsExist $FuncArgs @('TracesParams') + if ($Err.Count -ne 0) { + $Message = "traces.ps1 ($ExitCode): $($Err[0])" + Send-LogToLogzio $script:LogLevelError $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-TaskPostRun "Write-Error `"$Message`"" + + return $ExitCode + } + + $local:TracesParams = $FuncArgs.TracesParams + + $Err = Get-ParamValue $TracesParams 'isServiceGraph' + if ($Err.Count -ne 0) { + $Message = "traces.ps1 ($ExitCode): $($Err[0])" + Send-LogToLogzio $script:LogLevelError $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-TaskPostRun "Write-Error `"$Message`"" + + return $ExitCode + } + + $local:IsServiceGraph = $script:ParamValue + + if ($IsServiceGraph) { + $Message = 'Service Graph option was selected' + } + else { + $Message = 'Service Graph option was not selected' + } + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + Write-TaskPostRun "`$script:IsServiceGraph = `$$IsServiceGraph" +} + +# Builds enable service graph Helm set +# Input: +# --- +# Output: +# LogHelmSets - Containt all the Helm sets for logging +# HelmSets - Contains all the Helm sets +function Build-EnableServiceGraphHelmSet { + $local:FuncName = $MyInvocation.MyCommand.Name + + $local:Message = 'Building service graph Helm set ...' + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + $local:HelmSet = " --set logzio-k8s-telemetry.serviceGraph.enabled=true" + + $local:Message = "Enable service graph Helm set is '$HelmSet'" + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" + Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" +} diff --git a/datasources/windows/kubernetes/eks/kubernetes/telemetry/traces/traces.ps1 b/datasources/windows/kubernetes/eks/kubernetes/telemetry/traces/traces.ps1 index 366108b3e..4b3f2c3d7 100755 --- a/datasources/windows/kubernetes/eks/kubernetes/telemetry/traces/traces.ps1 +++ b/datasources/windows/kubernetes/eks/kubernetes/telemetry/traces/traces.ps1 @@ -26,6 +26,11 @@ Invoke-Task 'Get-LogzioSpmToken' @{} 'Getting Logz.io SPM token' @($TracesFuncti Invoke-Task 'Build-EnableSpmHelmSet' @{} 'Building enable SPM Helm set' @($TracesFunctionsScript) # Build Logz.io SPM token Helm set Invoke-Task 'Build-LogzioSpmTokenHelmSet' @{SpmToken = $script:SpmToken} 'Building Logz.io SPM token Helm set' @($TracesFunctionsScript) - +# Get if service graph option was selected +Invoke-Task 'Get-IsServiceGraphWasSelected' @{MetricsParams = $script:MetricsParams} 'Getting if service graph was selected' @($MetricsFunctionsScript) +if ($script:IsServiceGraph) { + # Build enable metrics filter Helm set + Invoke-Task 'Build-EnableServiceGraphHelmSet' @{} 'Building enable service graph Helm set' @($MetricsFunctionsScript) +} # Finished successfully Exit 0 diff --git a/datasources/windows/kubernetes/gke/kubernetes/telemetry/metrics/functions.ps1 b/datasources/windows/kubernetes/gke/kubernetes/telemetry/metrics/functions.ps1 index 87d8084a3..51612b043 100755 --- a/datasources/windows/kubernetes/gke/kubernetes/telemetry/metrics/functions.ps1 +++ b/datasources/windows/kubernetes/gke/kubernetes/telemetry/metrics/functions.ps1 @@ -208,77 +208,3 @@ function Build-EnableMetricsFilterHelmSet { Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" } - -# Gets is service graph was selected -# Input: -# FuncArgs - Hashtable {MetricsParams = $script:MetricsParams} -# Output: -# IsServiceGraph - Tells if service graph was selected (true/false) -function Get-IsServiceGraphWasSelected { - param ( - [hashtable]$FuncArgs - ) - - $local:ExitCode = 4 - $local:FuncName = $MyInvocation.MyCommand.Name - - $local:Message = 'Getting if service graph option was selected ...' - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - $local:Err = Test-AreFuncArgsExist $FuncArgs @('MetricsParams') - if ($Err.Count -ne 0) { - $Message = "metrics.ps1 ($ExitCode): $($Err[0])" - Send-LogToLogzio $script:LogLevelError $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-TaskPostRun "Write-Error `"$Message`"" - - return $ExitCode - } - - $local:MetricsParams = $FuncArgs.MetricsParams - - $Err = Get-ParamValue $MetricsParams 'isServiceGraph' - if ($Err.Count -ne 0) { - $Message = "metrics.ps1 ($ExitCode): $($Err[0])" - Send-LogToLogzio $script:LogLevelError $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-TaskPostRun "Write-Error `"$Message`"" - - return $ExitCode - } - - $local:IsServiceGraph = $script:ParamValue - - if ($IsServiceGraph) { - $Message = 'Service Graph option was selected' - } - else { - $Message = 'Service Graph option was not selected' - } - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - Write-TaskPostRun "`$script:IsServiceGraph = `$$IsServiceGraph" -} - -# Builds enable service graph Helm set -# Input: -# --- -# Output: -# LogHelmSets - Containt all the Helm sets for logging -# HelmSets - Contains all the Helm sets -function Build-EnableServiceGraphHelmSet { - $local:FuncName = $MyInvocation.MyCommand.Name - - $local:Message = 'Building service graph Helm set ...' - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - $local:HelmSet = " --set logzio-k8s-telemetry.serviceGraph.enabled=true" - - $local:Message = "Enable service graph Helm set is '$HelmSet'" - Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepMetrics $script:LogScriptMetrics $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource - Write-Log $script:LogLevelDebug $Message - - Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" - Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" -} diff --git a/datasources/windows/kubernetes/gke/kubernetes/telemetry/metrics/metrics.ps1 b/datasources/windows/kubernetes/gke/kubernetes/telemetry/metrics/metrics.ps1 index 1a64f27c7..7070260cf 100755 --- a/datasources/windows/kubernetes/gke/kubernetes/telemetry/metrics/metrics.ps1 +++ b/datasources/windows/kubernetes/gke/kubernetes/telemetry/metrics/metrics.ps1 @@ -26,11 +26,5 @@ if ($script:IsFilter) { # Build enable metrics filter Helm set Invoke-Task 'Build-EnableMetricsFilterHelmSet' @{} 'Building enable metrics filter Helm set' @($MetricsFunctionsScript) } -# Get if service graph option was selected -Invoke-Task 'Get-IsServiceGraphWasSelected' @{MetricsParams = $script:MetricsParams} 'Getting if service graph was selected' @($MetricsFunctionsScript) -if ($script:IsServiceGraph) { - # Build enable metrics filter Helm set - Invoke-Task 'Build-EnableServiceGraphHelmSet' @{} 'Building enable service graph Helm set' @($MetricsFunctionsScript) -} # Finished successfully Exit 0 diff --git a/datasources/windows/kubernetes/gke/kubernetes/telemetry/traces/functions.ps1 b/datasources/windows/kubernetes/gke/kubernetes/telemetry/traces/functions.ps1 index a8fdeb64b..b627ac529 100755 --- a/datasources/windows/kubernetes/gke/kubernetes/telemetry/traces/functions.ps1 +++ b/datasources/windows/kubernetes/gke/kubernetes/telemetry/traces/functions.ps1 @@ -231,3 +231,77 @@ function Build-LogzioSpmTokenHelmSet { Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" } + +# Gets is service graph was selected +# Input: +# FuncArgs - Hashtable {TracesParams = $script:TracesParams} +# Output: +# IsServiceGraph - Tells if service graph was selected (true/false) +function Get-IsServiceGraphWasSelected { + param ( + [hashtable]$FuncArgs + ) + + $local:ExitCode = 4 + $local:FuncName = $MyInvocation.MyCommand.Name + + $local:Message = 'Getting if service graph option was selected ...' + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + $local:Err = Test-AreFuncArgsExist $FuncArgs @('TracesParams') + if ($Err.Count -ne 0) { + $Message = "traces.ps1 ($ExitCode): $($Err[0])" + Send-LogToLogzio $script:LogLevelError $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-TaskPostRun "Write-Error `"$Message`"" + + return $ExitCode + } + + $local:TracesParams = $FuncArgs.TracesParams + + $Err = Get-ParamValue $TracesParams 'isServiceGraph' + if ($Err.Count -ne 0) { + $Message = "traces.ps1 ($ExitCode): $($Err[0])" + Send-LogToLogzio $script:LogLevelError $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-TaskPostRun "Write-Error `"$Message`"" + + return $ExitCode + } + + $local:IsServiceGraph = $script:ParamValue + + if ($IsServiceGraph) { + $Message = 'Service Graph option was selected' + } + else { + $Message = 'Service Graph option was not selected' + } + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + Write-TaskPostRun "`$script:IsServiceGraph = `$$IsServiceGraph" +} + +# Builds enable service graph Helm set +# Input: +# --- +# Output: +# LogHelmSets - Containt all the Helm sets for logging +# HelmSets - Contains all the Helm sets +function Build-EnableServiceGraphHelmSet { + $local:FuncName = $MyInvocation.MyCommand.Name + + $local:Message = 'Building service graph Helm set ...' + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + $local:HelmSet = " --set logzio-k8s-telemetry.serviceGraph.enabled=true" + + $local:Message = "Enable service graph Helm set is '$HelmSet'" + Send-LogToLogzio $script:LogLevelDebug $Message $script:LogStepTraces $script:LogScriptTraces $FuncName $script:AgentId $script:Platform $script:Subtype $script:CurrentDataSource + Write-Log $script:LogLevelDebug $Message + + Write-TaskPostRun "`$script:LogHelmSets += '$HelmSet'" + Write-TaskPostRun "`$script:HelmSets += '$HelmSet'" +} diff --git a/datasources/windows/kubernetes/gke/kubernetes/telemetry/traces/traces.ps1 b/datasources/windows/kubernetes/gke/kubernetes/telemetry/traces/traces.ps1 index 366108b3e..4b3f2c3d7 100755 --- a/datasources/windows/kubernetes/gke/kubernetes/telemetry/traces/traces.ps1 +++ b/datasources/windows/kubernetes/gke/kubernetes/telemetry/traces/traces.ps1 @@ -26,6 +26,11 @@ Invoke-Task 'Get-LogzioSpmToken' @{} 'Getting Logz.io SPM token' @($TracesFuncti Invoke-Task 'Build-EnableSpmHelmSet' @{} 'Building enable SPM Helm set' @($TracesFunctionsScript) # Build Logz.io SPM token Helm set Invoke-Task 'Build-LogzioSpmTokenHelmSet' @{SpmToken = $script:SpmToken} 'Building Logz.io SPM token Helm set' @($TracesFunctionsScript) - +# Get if service graph option was selected +Invoke-Task 'Get-IsServiceGraphWasSelected' @{MetricsParams = $script:MetricsParams} 'Getting if service graph was selected' @($MetricsFunctionsScript) +if ($script:IsServiceGraph) { + # Build enable metrics filter Helm set + Invoke-Task 'Build-EnableServiceGraphHelmSet' @{} 'Building enable service graph Helm set' @($MetricsFunctionsScript) +} # Finished successfully Exit 0 diff --git a/resources-linux/k8s/datasource_metrics_utils.bash b/resources-linux/k8s/datasource_metrics_utils.bash index f437ac1b2..69cd48cbc 100755 --- a/resources-linux/k8s/datasource_metrics_utils.bash +++ b/resources-linux/k8s/datasource_metrics_utils.bash @@ -130,61 +130,4 @@ function build_enable_metrics_filter_helm_set { write_task_post_run "LOG_HELM_SETS+='$helm_set'" write_task_post_run "HELM_SETS+='$helm_set'" -} - -# Gets is service graph was selected -# Input: -# --- -# Output: -# IS_SERVICE_GRAPH - Tells if service graph was selected (true/false) -function get_is_service_graph_was_selected { - local func_name="${FUNCNAME[0]}" - - local message='Getting is Service Graph metrics option was selected ...' - send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_log "$LOG_LEVEL_DEBUG" "$message" - - PARAMS=("${METRICS_PARAMS[@]}") - get_param_value 'isServiceGraph' - if [[ $? -ne 0 ]]; then - message="metrics.bash ($EXIT_CODE): $(get_task_error_message)" - send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_task_post_run "write_error \"$message\"" - - return $EXIT_CODE - fi - - local is_servicegraph=$PARAM_VALUE - - if $is_servicegraph; then - message='Service Graph metrics option was selected' - else - message='Service Graph metrics option was not selected' - fi - send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_log "$LOG_LEVEL_DEBUG" "$message" - - write_task_post_run "IS_SERVICE_GRAPH=$is_servicegraph" -} -# Builds enable service graph Helm set -# Input: -# --- -# Output: -# LOG_HELM_SETS - Contains all the Helm sets for logging -# HELM_SETS - Contains all the Helm sets -function build_enable_service_graph_helm_set { - local func_name="${FUNCNAME[0]}" - - local message='Building enable service graph Helm set ...' - send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_log "$LOG_LEVEL_DEBUG" "$message" - - local helm_set=" --set logzio-k8s-telemetry.serviceGraph.enabled=$IS_SERVICE_GRAPH" - - message="Enable service graph Helm set is '$helm_set'" - send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_log "$LOG_LEVEL_DEBUG" "$message" - - write_task_post_run "LOG_HELM_SETS+='$helm_set'" - write_task_post_run "HELM_SETS+='$helm_set'" -} +} \ No newline at end of file diff --git a/resources-linux/k8s/datasource_traces_utils.bash b/resources-linux/k8s/datasource_traces_utils.bash index 2547869ba..442133276 100755 --- a/resources-linux/k8s/datasource_traces_utils.bash +++ b/resources-linux/k8s/datasource_traces_utils.bash @@ -124,3 +124,60 @@ function build_logzio_spm_token_helm_set { write_task_post_run "LOG_HELM_SETS+='$helm_set'" write_task_post_run "HELM_SETS+='$helm_set'" } + +# Gets is service graph was selected +# Input: +# --- +# Output: +# IS_SERVICE_GRAPH - Tells if service graph was selected (true/false) +function get_is_service_graph_was_selected { + local func_name="${FUNCNAME[0]}" + + local message='Getting is Service Graph option was selected ...' + send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_log "$LOG_LEVEL_DEBUG" "$message" + + PARAMS=("${METRICS_PARAMS[@]}") + get_param_value 'isServiceGraph' + if [[ $? -ne 0 ]]; then + message="traces.bash ($EXIT_CODE): $(get_task_error_message)" + send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_task_post_run "write_error \"$message\"" + + return $EXIT_CODE + fi + + local is_servicegraph=$PARAM_VALUE + + if $is_servicegraph; then + message='Service Graph option was selected' + else + message='Service Graph option was not selected' + fi + send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_log "$LOG_LEVEL_DEBUG" "$message" + + write_task_post_run "IS_SERVICE_GRAPH=$is_servicegraph" +} +# Builds enable service graph Helm set +# Input: +# --- +# Output: +# LOG_HELM_SETS - Contains all the Helm sets for logging +# HELM_SETS - Contains all the Helm sets +function build_enable_service_graph_helm_set { + local func_name="${FUNCNAME[0]}" + + local message='Building enable service graph Helm set ...' + send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_log "$LOG_LEVEL_DEBUG" "$message" + + local helm_set=" --set logzio-k8s-telemetry.serviceGraph.enabled=$IS_SERVICE_GRAPH" + + message="Enable service graph Helm set is '$helm_set'" + send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_log "$LOG_LEVEL_DEBUG" "$message" + + write_task_post_run "LOG_HELM_SETS+='$helm_set'" + write_task_post_run "HELM_SETS+='$helm_set'" +} diff --git a/resources-mac/k8s/datasource_metrics_utils.bash b/resources-mac/k8s/datasource_metrics_utils.bash index 83280566c..6398da413 100755 --- a/resources-mac/k8s/datasource_metrics_utils.bash +++ b/resources-mac/k8s/datasource_metrics_utils.bash @@ -131,60 +131,3 @@ function build_enable_metrics_filter_helm_set { write_task_post_run "LOG_HELM_SETS+='$helm_set'" write_task_post_run "HELM_SETS+='$helm_set'" } - -# Gets is service graph was selected -# Input: -# --- -# Output: -# IS_SERVICE_GRAPH - Tells if service graph was selected (true/false) -function get_is_service_graph_was_selected { - local func_name="${FUNCNAME[0]}" - - local message='Getting is Service Graph metrics option was selected ...' - send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_log "$LOG_LEVEL_DEBUG" "$message" - - PARAMS=("${METRICS_PARAMS[@]}") - get_param_value 'isServiceGraph' - if [[ $? -ne 0 ]]; then - message="metrics.bash ($EXIT_CODE): $(get_task_error_message)" - send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_task_post_run "write_error \"$message\"" - - return $EXIT_CODE - fi - - local is_servicegraph=$PARAM_VALUE - - if $is_servicegraph; then - message='Service Graph metrics option was selected' - else - message='Service Graph metrics option was not selected' - fi - send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_log "$LOG_LEVEL_DEBUG" "$message" - - write_task_post_run "IS_SERVICE_GRAPH=$is_servicegraph" -} -# Builds enable service graph Helm set -# Input: -# --- -# Output: -# LOG_HELM_SETS - Contains all the Helm sets for logging -# HELM_SETS - Contains all the Helm sets -function build_enable_service_graph_helm_set { - local func_name="${FUNCNAME[0]}" - - local message='Building enable service graph Helm set ...' - send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_log "$LOG_LEVEL_DEBUG" "$message" - - local helm_set=" --set logzio-k8s-telemetry.serviceGraph.enabled=$IS_SERVICE_GRAPH" - - message="Enable service graph Helm set is '$helm_set'" - send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_METRICS" "$LOG_SCRIPT_METRICS" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" - write_log "$LOG_LEVEL_DEBUG" "$message" - - write_task_post_run "LOG_HELM_SETS+='$helm_set'" - write_task_post_run "HELM_SETS+='$helm_set'" -} \ No newline at end of file diff --git a/resources-mac/k8s/datasource_traces_utils.bash b/resources-mac/k8s/datasource_traces_utils.bash index adead58f6..a9aeb3e6e 100755 --- a/resources-mac/k8s/datasource_traces_utils.bash +++ b/resources-mac/k8s/datasource_traces_utils.bash @@ -124,3 +124,60 @@ function build_logzio_spm_token_helm_set { write_task_post_run "LOG_HELM_SETS+='$helm_set'" write_task_post_run "HELM_SETS+='$helm_set'" } + +# Gets is service graph was selected +# Input: +# --- +# Output: +# IS_SERVICE_GRAPH - Tells if service graph was selected (true/false) +function get_is_service_graph_was_selected { + local func_name="${FUNCNAME[0]}" + + local message='Getting is Service Graph option was selected ...' + send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_log "$LOG_LEVEL_DEBUG" "$message" + + PARAMS=("${METRICS_PARAMS[@]}") + get_param_value 'isServiceGraph' + if [[ $? -ne 0 ]]; then + message="traces.bash ($EXIT_CODE): $(get_task_error_message)" + send_log_to_logzio "$LOG_LEVEL_ERROR" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_task_post_run "write_error \"$message\"" + + return $EXIT_CODE + fi + + local is_servicegraph=$PARAM_VALUE + + if $is_servicegraph; then + message='Service Graph option was selected' + else + message='Service Graph option was not selected' + fi + send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_log "$LOG_LEVEL_DEBUG" "$message" + + write_task_post_run "IS_SERVICE_GRAPH=$is_servicegraph" +} +# Builds enable service graph Helm set +# Input: +# --- +# Output: +# LOG_HELM_SETS - Contains all the Helm sets for logging +# HELM_SETS - Contains all the Helm sets +function build_enable_service_graph_helm_set { + local func_name="${FUNCNAME[0]}" + + local message='Building enable service graph Helm set ...' + send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_log "$LOG_LEVEL_DEBUG" "$message" + + local helm_set=" --set logzio-k8s-telemetry.serviceGraph.enabled=$IS_SERVICE_GRAPH" + + message="Enable service graph Helm set is '$helm_set'" + send_log_to_logzio "$LOG_LEVEL_DEBUG" "$message" "$LOG_STEP_TRACES" "$LOG_SCRIPT_TRACES" "$func_name" "$AGENT_ID" "$PLATFORM" "$SUB_TYPE" "$CURRENT_DATA_SOURCE" + write_log "$LOG_LEVEL_DEBUG" "$message" + + write_task_post_run "LOG_HELM_SETS+='$helm_set'" + write_task_post_run "HELM_SETS+='$helm_set'" +}