Skip to content

Conversation

@mx-psi
Copy link
Member

@mx-psi mx-psi commented Nov 26, 2025

Description

Moves validation of gRPC endpoint from OTLP exporter to configgrpc

Link to tracking issue

Fixes #10451

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 26, 2025

CodSpeed Performance Report

Merging #14221 will degrade performances by 100%

Comparing mx-psi:mx-psi/configgrpc-validation (88bd909) with main (b12ce10)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

❌ 4 (👁 2) regressions
✅ 69 untouched

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
zstdNoConcurrency 34.3 µs 47.6 µs -27.93%
zstdWithConcurrency 21.2 µs 29.3 µs -27.64%
👁 BenchmarkBatchMetricProcessor2k 1.9 µs 145,688.6 µs -100%
👁 BenchmarkMultiBatchMetricProcessor2k 2.4 µs 141,568.6 µs -100%

@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 60.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.15%. Comparing base (b12ce10) to head (88bd909).

Files with missing lines Patch % Lines
config/configgrpc/configgrpc.go 53.84% 3 Missing and 3 partials ⚠️

❌ Your patch check has failed because the patch coverage (60.00%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14221      +/-   ##
==========================================
- Coverage   92.17%   92.15%   -0.03%     
==========================================
  Files         668      668              
  Lines       41463    41466       +3     
==========================================
- Hits        38220    38211       -9     
- Misses       2211     2218       +7     
- Partials     1032     1037       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mx-psi mx-psi marked this pull request as ready for review November 26, 2025 17:44
@mx-psi mx-psi requested a review from a team as a code owner November 26, 2025 17:44
@mx-psi mx-psi requested a review from evan-bradley November 26, 2025 17:44
@mx-psi
Copy link
Member Author

mx-psi commented Nov 27, 2025

The Coralogix exporter has some valid configurations in which the endpoint is empty https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/5b3e9b34d1a3fde3c0527e962284b56dae1c5b89/exporter/coralogixexporter/config.go#L121-L124

I could either fix the Coralogix exporter (I guess by moving this logic to a new unmarshal function) or make 'empty endpoint' a valid config, something like the following diff:

diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go
index 025970c6c..27cc037f5 100644
--- a/config/configgrpc/configgrpc.go
+++ b/config/configgrpc/configgrpc.go
@@ -234,23 +234,20 @@ func (cc *ClientConfig) Validate() error {
 		return nil
 	}

-	endpoint := cc.sanitizedEndpoint()
-	if endpoint == "" {
-		return errors.New(`requires a non-empty "endpoint"`)
-	}
-
-	// Validate that the port is in the address
-	_, port, err := net.SplitHostPort(endpoint)
-	if err != nil {
-		return err
-	}
-	if _, err := strconv.Atoi(port); err != nil {
-		return fmt.Errorf(`invalid port "%v"`, port)
-	}
+	if endpoint := cc.sanitizedEndpoint(); endpoint != "" {
+		// Validate that the port is in the address
+		_, port, err := net.SplitHostPort(endpoint)
+		if err != nil {
+			return err
+		}
+		if _, err := strconv.Atoi(port); err != nil {
+			return fmt.Errorf(`invalid port "%v"`, port)
+		}

-	if cc.BalancerName != "" {
-		if balancer.Get(cc.BalancerName) == nil {
-			return fmt.Errorf("invalid balancer_name: %s", cc.BalancerName)
+		if cc.BalancerName != "" {
+			if balancer.Get(cc.BalancerName) == nil {
+				return fmt.Errorf("invalid balancer_name: %s", cc.BalancerName)
+			}
 		}
 	}

@iblancasa what do you think?

@iblancasa
Copy link
Contributor

Yes. It is fine as soon as the configuration for users doesn't change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configgrpc: should configgrpc validate the endpoint?

3 participants