IMPALA-14455: Cleanup OpenTelemetry Tracing Startup Flags

Fixes several issues with the OpenTelemetry tracing startup flags:

1. otel_trace_beeswax -- Removes this hidden flag which enabled
   tracing of queries submitted over Beeswax. Since this protocol is
   deprecated and no tests assert the traces generated by Beeswax
   queries, this flag was removed to eliminate an extra check when
   determining if OpenTelemetry tracing should be enabled.

2. otel_trace_tls_minimum_version -- Fixes parsing of this flag's
   value. This flag is in the format "tlsv1.2" or "tlsv1.3", but the
   OpenTelemetry C++ SDK expects the minimum TLS version to be in the
   format "1.2" or "1.3". The code now removes the "tlsv" prefix before
   passing the value to the OpenTelemetry C++ SDK.

3. otel_trace_tls_insecure_skip_verify -- Fixes the guidance to only
   set this flag to true in dev/testing.

Adds ctest tests for the functions that configure the TraceProvider
singleton to ensure startup flags are correctly parsed and applied.

Modifies the http_exporter_config and init_otel_tracer function
signatures in otel.cc to return the actual object they create instead
of a Status since these functions only ever returned OK.

Updates the OpenTelemetry collector docker-compose file to support
the collector receiving traces over both HTTP and HTTPS. This setup
is used to manually smoke test the integration from Impala to an
OpenTelemetry collector.

Change-Id: Ie321fa37c0fd260f783dc6cf47924d53a06d82ea
Reviewed-on: http://gerrit.cloudera.org:8080/23440
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
This commit is contained in:
jasonmfehr
2025-09-18 15:40:38 -07:00
committed by Jason Fehr
parent 3d22c7fe05
commit 2ac5a24dc0
11 changed files with 497 additions and 85 deletions

View File

@@ -6,7 +6,8 @@ This directory contains configuration to run an [OpenTelemetry Collector](https:
## Contents
- [`otel-config.yml`](./otel-config.yml): OpenTelemetry Collector configuration file.
- [`otel-config-http.yml`](./otel-config-http.yml): OpenTelemetry Collector configuration file with the OTLP receiver supporting http.
- [`otel-config-https.yml`](./otel-config-https.yml): OpenTelemetry Collector configuration file with the OTLP receiver supporting https.
- [`docker-compose.yml`](./docker-compose.yml): Alternative Docker Compose setup for both services.
---
@@ -16,7 +17,11 @@ This directory contains configuration to run an [OpenTelemetry Collector](https:
### Option 1: Run Interactively
```bash
# HTTP (default)
docker-compose -f testdata/bin/otel-collector/docker-compose.yml up
# HTTPS
PROTOCOL=https docker-compose -f testdata/bin/otel-collector/docker-compose.yml up
```
- This command:
@@ -28,7 +33,11 @@ This directory contains configuration to run an [OpenTelemetry Collector](https:
### Option 2: Run Detached
```bash
# HTTP (default)
docker-compose -f testdata/bin/otel-collector/docker-compose.yml up -d
# HTTP (default)
PROTOCOL=https docker-compose -f testdata/bin/otel-collector/docker-compose.yml up -d
```
- This command:
@@ -61,7 +70,8 @@ The collector forwards all received traces to Jaeger using OTLP/gRPC.
To send traces from an Impala cluster to this collector, start Impala with the following arguments:
```bash
./bin/start-impala-cluster.py \
# HTTP (default)
start-impala-cluster.py \
--cluster_size=2 \
--num_coordinators=1 \
--use_exclusive_coordinators \
@@ -69,6 +79,17 @@ To send traces from an Impala cluster to this collector, start Impala with the f
--otel_trace_collector_url=http://localhost:55888/v1/traces
--otel_trace_span_processor=simple \
--cluster_id=local_cluster"
# HTTPS
start-impala-cluster.py \
--cluster_size=2 \
--num_coordinators=1 \
--use_exclusive_coordinators \
--impalad_args="-v=2 --otel_trace_enabled=true \
--otel_trace_collector_url=https://localhost:55888/v1/traces \
--otel_trace_ca_cert_path=${IMPALA_HOME}/be/src/testutil/wildcardCA.pem \
--otel_trace_span_processor=simple \
--cluster_id=local_cluster"
```
- Ensure the collector is running before starting Impala.

View File

@@ -37,7 +37,9 @@ services:
depends_on:
- jaeger
volumes:
- ./otel-config.yml:/etc/otel/config.yml
- ./otel-config-${PROTOCOL:-http}.yml:/etc/otel/config.yml:ro
- ../../../be/src/testutil/localhost.pem:/etc/otel/localhost.pem:ro
- ../../../be/src/testutil/localhost.key:/etc/otel/localhost.key:ro
command: ["--config", "/etc/otel/config.yml"]
ports:
- "55888:55888" # Expose OTLP HTTP externally

View File

@@ -0,0 +1,39 @@
##############################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
##############################################################################
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:55888
tls:
cert_file: /etc/otel/localhost.pem
key_file: /etc/otel/localhost.key
exporters:
otlp:
endpoint: jaeger:4317
tls:
insecure: true
service:
pipelines:
traces:
receivers: [otlp]
exporters: [otlp]