Skip to content
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

refactor telemetry backendRefs #3293

Merged
merged 23 commits into from
May 22, 2024
Merged

Conversation

zirain
Copy link
Contributor

@zirain zirain commented Apr 29, 2024

fix: #3161

@zirain zirain requested a review from a team as a code owner April 29, 2024 02:49
@zirain zirain force-pushed the telemetry-backend branch from 08ca96d to 0b3d6bb Compare April 29, 2024 21:14
zirain added 5 commits April 30, 2024 05:34
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
@zirain zirain force-pushed the telemetry-backend branch from 0b3d6bb to 246a49f Compare April 29, 2024 21:34
@zirain zirain changed the title [WIP] refactor telemetry backendRefs refactor telemetry backendRefs May 1, 2024
internal/ir/xds.go Outdated Show resolved Hide resolved
internal/provider/kubernetes/controller.go Show resolved Hide resolved
internal/gatewayapi/listener.go Outdated Show resolved Hide resolved
internal/gatewayapi/route.go Outdated Show resolved Hide resolved
Signed-off-by: zirain <zirain2009@gmail.com>
@zirain zirain requested a review from shawnh2 May 9, 2024 06:10
Copy link
Contributor

@shawnh2 shawnh2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! no questions from my side.

@zirain zirain requested a review from arkodg May 9, 2024 21:11
internal/ir/xds.go Outdated Show resolved Hide resolved
internal/ir/xds.go Outdated Show resolved Hide resolved
@@ -226,18 +239,6 @@ func (r *gatewayAPIReconciler) Reconcile(ctx context.Context, _ reconcile.Reques
gwcResource.Namespaces = append(gwcResource.Namespaces, namespace)
}

// Process the parametersRef of the accepted GatewayClass.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why we moved this away from L241

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need update allAssociatedBackendRefs first.

@@ -1465,6 +1466,60 @@ func (r *gatewayAPIReconciler) processParamsRef(ctx context.Context, gc *gwapiv1
validationErr = fmt.Errorf("invalid envoyproxy: %w", err)
continue
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably also need to enhance

func (r *gatewayAPIReconciler) validateServiceForReconcile(obj client.Object) bool {
to make sure we trigger a reconcile when the Service changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but want to do that in an seperated PR.

zirain added 2 commits May 17, 2024 13:09
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
@zirain zirain force-pushed the telemetry-backend branch from 809c8c5 to bc2883e Compare May 17, 2024 06:28
zirain added 2 commits May 17, 2024 14:40
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
zirain added 4 commits May 18, 2024 09:28
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
@zirain zirain requested a review from arkodg May 20, 2024 01:07
return nil, err
}
al.Destination = ir.RouteDestination{
Name: fmt.Sprintf("accesslog-%d", idx), // TODO: rename this, so that we can share backend with tracing?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to this prefix, once we add cluster level features like circuitBreaking which will live on backendRef level , we won't be able to reuse tracing- here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we should reuse with tracing provider, normally there's only one collector per cluster.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may not be possible to reuse if we decide to put features inside backendRef field, if feature live in top level policy, it may be possible

var port uint32
if tracing.Provider.Host != nil {
host, port = *tracing.Provider.Host, uint32(tracing.Provider.Port)
// TODO: how to get authority from the backendRefs?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name.namespace ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about a service outside of cluster.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yah that we'd need to add an explicit field in the future

Copy link

codecov bot commented May 21, 2024

Codecov Report

Attention: Patch coverage is 69.68085% with 57 lines in your changes are missing coverage. Please review.

Project coverage is 67.26%. Comparing base (926d572) to head (91e990f).
Report is 14 commits behind head on main.

Files Patch % Lines
internal/provider/kubernetes/controller.go 4.54% 40 Missing and 2 partials ⚠️
internal/gatewayapi/route.go 79.41% 5 Missing and 2 partials ⚠️
internal/gatewayapi/listener.go 95.23% 2 Missing and 2 partials ⚠️
internal/gatewayapi/status/gateway.go 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3293      +/-   ##
==========================================
- Coverage   67.37%   67.26%   -0.12%     
==========================================
  Files         166      166              
  Lines       19357    19438      +81     
==========================================
+ Hits        13041    13074      +33     
- Misses       5376     5421      +45     
- Partials      940      943       +3     

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

zirain added 2 commits May 21, 2024 08:18
Signed-off-by: zirain <zirain2009@gmail.com>
@zirain zirain force-pushed the telemetry-backend branch from aa582af to 654997f Compare May 21, 2024 00:21
Signed-off-by: zirain <zirain2009@gmail.com>
@zirain zirain requested a review from arkodg May 22, 2024 09:32
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks !

@arkodg arkodg merged commit 5aded1e into envoyproxy:main May 22, 2024
23 checks passed
@zirain zirain deleted the telemetry-backend branch May 23, 2024 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor BackendHostAndPort
3 participants