Browse Source

definition fix

Grant Limberg 1 month ago
parent
commit
8e733ff0da
2 changed files with 6 additions and 4 deletions
  1. 1 1
      make-linux.mk
  2. 5 3
      service/OneService.cpp

+ 1 - 1
make-linux.mk

@@ -315,7 +315,7 @@ endif
 OTEL_VERSION=1.21.0
 ifeq (${ZT_OTEL},1)
 	OTEL_INSTALL_DIR=ext/opentelemetry-cpp-${OTEL_VERSION}/localinstall
-	DEFS+=-DZT_OTEL
+	DEFS+=-DZT_OPENTELEMETRY_ENABLED=1
 	INCLUDES+=-I${OTEL_INSTALL_DIR}/include
 	LDLIBS+=-L${OTEL_INSTALL_DIR}/lib -lopentelemetry_common -lopentelemetry_resources -lopentelemetry_otlp_recordable -lopentelemetry_exporter_in_memory_metric -lopentelemetry_exporter_in_memory -lopentelemetry_exporter_ostream_logs -lopentelemetry_exporter_ostream_metrics -lopentelemetry_exporter_ostream_span -lopentelemetry_exporter_otlp_grpc -lopentelemetry_exporter_otlp_grpc_client -lopentelemetry_exporter_otlp_grpc_log -lopentelemetry_exporter_otlp_grpc_metrics -lopentelemetry_trace -lopentelemetry_common -lopentelemetry_resources -lopentelemetry_logs -lopentelemetry_metrics -lopentelemetry_version
 else

+ 5 - 3
service/OneService.cpp

@@ -1601,15 +1601,17 @@ class OneServiceImpl : public OneService {
 				_exporterEndpoint = OSUtils::jsonString(otel["exporterEndpoint"], "");
 				_exporterSampleRate = OSUtils::jsonDouble(otel["exporterSampleRate"], 1.0f);
 				if (_exporterEndpoint.empty()) {
-					fprintf(stderr, "WARNING: OpenTelemetry exporter endpoint is not set. Metrics will not be exported." ZT_EOL_S);
+					fprintf(stderr, "WARNING: OpenTelemetry exporter endpoint is not set. Traces will not be exported." ZT_EOL_S);
 				}
 				if (_exporterSampleRate <= 0.0) {
-					fprintf(stderr, "WARNING: OpenTelemetry exporter sample rate is not set or invalid. Metrics will not be exported." ZT_EOL_S);
+					fprintf(stderr, "WARNING: OpenTelemetry exporter sample rate is not set or invalid. Traces will not be exported." ZT_EOL_S);
 				}
 			}
 			else {
-				fprintf(stderr, "WARNING: OpenTelemetry exporter settings are not set. Metrics will not be exported." ZT_EOL_S);
+				fprintf(stderr, "WARNING: OpenTelemetry exporter settings are not set. Traces will not be exported." ZT_EOL_S);
 			}
+#else
+			fprintf(stderr, "WARNING: OpenTelemetry support is not enabled. Traces will not be exported." ZT_EOL_S);
 #endif
 
 			// Bind to wildcard instead of to specific interfaces (disables full tunnel capability)