diff --git a/datasources/windows/localhost/windows/system/telemetry/logs/functions.ps1 b/datasources/windows/localhost/windows/system/telemetry/logs/functions.ps1 index d3ce30772..a91fbc5e1 100755 --- a/datasources/windows/localhost/windows/system/telemetry/logs/functions.ps1 +++ b/datasources/windows/localhost/windows/system/telemetry/logs/functions.ps1 @@ -536,6 +536,11 @@ function Add-LogsProcessorsToOtelConfig { return $ExitCode } + + if ($ProcessorName -eq 'resource/agent') { + $local:AgentVersion = Get-Content "$env:TEMP\Logzio\version" + $Err = Add-YamlFileFieldValue "$script:OtelResourcesDir\$script:OtelConfigName" '.processors.resource/agent.attributes[0].value' $AgentVersion + } } } diff --git a/datasources/windows/localhost/windows/system/telemetry/metrics/functions.ps1 b/datasources/windows/localhost/windows/system/telemetry/metrics/functions.ps1 index 0adf307f1..bac252741 100755 --- a/datasources/windows/localhost/windows/system/telemetry/metrics/functions.ps1 +++ b/datasources/windows/localhost/windows/system/telemetry/metrics/functions.ps1 @@ -334,6 +334,11 @@ function Add-MetricsProcessorsToOtelConfig { return $ExitCode } + + if ($ProcessorName -eq 'resource/agent') { + $local:AgentVersion = Get-Content "$env:TEMP\Logzio\version" + $Err = Add-YamlFileFieldValue "$script:OtelResourcesDir\$script:OtelConfigName" '.processors.resource/agent.attributes[0].value' $AgentVersion + } } } diff --git a/resources-linux/otel/datasource_logs_utils.bash b/resources-linux/otel/datasource_logs_utils.bash index 3ad6c8253..e09f9fa69 100755 --- a/resources-linux/otel/datasource_logs_utils.bash +++ b/resources-linux/otel/datasource_logs_utils.bash @@ -228,6 +228,11 @@ function add_logs_processors_to_otel_config { return $EXIT_CODE fi + + if [[ $processor_name == 'resource/agent' ]] ; then + AGENT_VERSION=$(cat '/tmp/logzio/version') + add_yaml_file_field_value "$OTEL_RESOURCES_DIR/$OTEL_CONFIG_NAME" '.processors.resource/agent.attributes[0].value' "$AGENT_VERSION" + fi done } diff --git a/resources-linux/otel/datasource_metrics_utils.bash b/resources-linux/otel/datasource_metrics_utils.bash index efe5d769f..791dbd0b4 100755 --- a/resources-linux/otel/datasource_metrics_utils.bash +++ b/resources-linux/otel/datasource_metrics_utils.bash @@ -249,6 +249,11 @@ function add_metrics_processors_to_otel_config { return $EXIT_CODE fi + + if [[ $processor_name == 'resource/agent' ]] ; then + AGENT_VERSION=$(cat '/tmp/logzio/version') + add_yaml_file_field_value "$OTEL_RESOURCES_DIR/$OTEL_CONFIG_NAME" '.processors.resource/agent.attributes[0].value' "$AGENT_VERSION" + fi done } diff --git a/resources-mac/otel/datasource_logs_utils.bash b/resources-mac/otel/datasource_logs_utils.bash index ff5cd7d13..de2ea799b 100755 --- a/resources-mac/otel/datasource_logs_utils.bash +++ b/resources-mac/otel/datasource_logs_utils.bash @@ -229,6 +229,11 @@ function add_logs_processors_to_otel_config { return $EXIT_CODE fi + + if [[ $processor_name == 'resource/agent' ]] ; then + AGENT_VERSION=$(cat '/tmp/logzio/version') + add_yaml_file_field_value "$OTEL_RESOURCES_DIR/$OTEL_CONFIG_NAME" '.processors.resource/agent.attributes[0].value' "$AGENT_VERSION" + fi done } diff --git a/resources-mac/otel/datasource_metrics_utils.bash b/resources-mac/otel/datasource_metrics_utils.bash index 0e9d80cce..5c214a0bd 100755 --- a/resources-mac/otel/datasource_metrics_utils.bash +++ b/resources-mac/otel/datasource_metrics_utils.bash @@ -249,6 +249,11 @@ function add_metrics_processors_to_otel_config { return $EXIT_CODE fi + + if [[ $processor_name == 'resource/agent' ]] ; then + AGENT_VERSION=$(cat '/tmp/logzio/version') + add_yaml_file_field_value "$OTEL_RESOURCES_DIR/$OTEL_CONFIG_NAME" '.processors.resource/agent.attributes[0].value' "$AGENT_VERSION" + fi done } diff --git a/resources/otel/processors/resource_agent.yaml b/resources/otel/processors/resource_agent.yaml index 5e660048b..94f022f2c 100644 --- a/resources/otel/processors/resource_agent.yaml +++ b/resources/otel/processors/resource_agent.yaml @@ -1,5 +1,5 @@ resource/agent: attributes: - key: logzio_agent_version - value: v1.1.34 + value: action: upsert \ No newline at end of file