-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[configgrpc,exporter/otlp] Move gRPC client endpoint validation to configgrpc #14221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #14221 will degrade performances by 100%Comparing
|
| 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 Report❌ Patch coverage is
❌ 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. 🚀 New features to boost your workflow:
|
|
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? |
|
Yes. It is fine as soon as the configuration for users doesn't change |
Description
Moves validation of gRPC endpoint from OTLP exporter to configgrpc
Link to tracking issue
Fixes #10451