From d1dbbe464abbd17c7ccda9f50b4f8ee3d5f3dec2 Mon Sep 17 00:00:00 2001 From: Peter Paul Bakker Date: Thu, 22 Oct 2026 08:56:54 +0000 Subject: [PATCH] fix: elastic-otel jq filter fails on jq 1.6 (cflinuxfs4) `label` is a reserved keyword in jq 1.6, so `.key as $label` is a syntax error there. jq 1.7 (cflinuxfs5) accepts it. On cflinuxfs4 the profile.d script could not resolve OTEL_EXPORTER_OTLP_HEADERS from VCAP_SERVICES. Rename the variable to $service_label. --- src/java/frameworks/elastic_otel_java_agent.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java/frameworks/elastic_otel_java_agent.go b/src/java/frameworks/elastic_otel_java_agent.go index 9a85fbc418..ba2ee91973 100644 --- a/src/java/frameworks/elastic_otel_java_agent.go +++ b/src/java/frameworks/elastic_otel_java_agent.go @@ -134,11 +134,11 @@ if [ -z "${OTEL_EXPORTER_OTLP_HEADERS:-}" ] && [ -n "${VCAP_SERVICES:-}" ]; then %s as $identifiers | [ to_entries[] - | .key as $label + | .key as $service_label | .value[] | ((.tags // []) | map(ascii_downcase)) as $tags | ((.name // "") | ascii_downcase) as $name - | ($identifiers | index(($label | ascii_downcase))) as $label_priority + | ($identifiers | index(($service_label | ascii_downcase))) as $label_priority | if $label_priority != null then {priority: $label_priority, service: .} elif (any($tags[]; . as $tag | $identifiers | index($tag) != null)) or