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

chore(migrate): migrate otelgrpc pkg interceptor to stats handler(#18258) #18366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jack-R-lantern
Copy link
Contributor

@Jack-R-lantern Jack-R-lantern commented May 22, 2024

This PR will migrate the otelgrpc pkg.
It changes server/clientinterceptor in otelgrpc to NewServer/ClientHandler
I think that otelgrpc should be updated to 0.52.0 or higher in the future, in which case grpc should also be updated to 1.64.

Closes #18258

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

@Jack-R-lantern Jack-R-lantern changed the title chore(migrate): migrate otelgrpc pkg interceptor to stats handler chore(migrate): migrate otelgrpc pkg interceptor to stats handler(#18258) May 22, 2024
Copy link

codecov bot commented May 22, 2024

Codecov Report

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

Project coverage is 44.95%. Comparing base (9fe1dbf) to head (c1e018a).
Report is 5 commits behind head on master.

Files Patch % Lines
cmpserver/apiclient/clientset.go 0.00% 1 Missing ⚠️
cmpserver/server.go 0.00% 1 Missing ⚠️
pkg/apiclient/apiclient.go 0.00% 1 Missing ⚠️
reposerver/server.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18366      +/-   ##
==========================================
+ Coverage   44.94%   44.95%   +0.01%     
==========================================
  Files         354      353       -1     
  Lines       47740    47722      -18     
==========================================
- Hits        21457    21454       -3     
+ Misses      23481    23466      -15     
  Partials     2802     2802              

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

@Jack-R-lantern Jack-R-lantern force-pushed the ISSUE-18258/otelgrpc_package_should_use_interceptors_in_favor_of_stats_handlers branch 12 times, most recently from 464c408 to 37c0f77 Compare May 28, 2024 12:01
@Jack-R-lantern
Copy link
Contributor Author

Jack-R-lantern commented May 28, 2024

[previous CI integratiion tests e2e log]

time="2024-05-28T09:10:36Z" level=error msg="../../dist/argocd app diff test-app-with-secrets --local testdata --server-side-generate --plaintext --server 127.0.0.1:8088 --auth-token *** --insecure failed exit status 20: time="2024-05-28T09:10:36Z" level=fatal msg="rpc error: code = Unimplemented desc = grpc_retry: cannot retry on ClientStreams, set grpc_retry.Disable()"" execID=c6fd7
time="2024-05-28T09:10:36Z" level=fatal msg="../../dist/argocd app diff test-app-with-secrets --local testdata --server-side-generate --plaintext --server 127.0.0.1:8088 --auth-token *** --insecure failed exit status 20: time="2024-05-28T09:10:36Z" level=fatal msg="rpc error: code = Unimplemented desc = grpc_retry: cannot retry on ClientStreams, set grpc_retry.Disable()""

Modified the code based on the logs from the previous E2E test.
I think this was the problem.
It seems that using WithStreamInterceptor without using a chain overwrote an existing Interceptor.

migrate cmdserver, server, pkg/apiclient, reposerver
- server
  - migrate ServerInterceptor -> NewServerHandler
- client
  - migrate ClientInterceptor -> NewClientHandler

fix server/application
- add ClientStream GenerateManfiestWithFiles retry.Disable()

remove util/grpc/trace
- remvoe util/grpc/trace.go

Signed-off-by: Jack-R-lantern <tjdfkr2421@gmail.com>
@Jack-R-lantern Jack-R-lantern force-pushed the ISSUE-18258/otelgrpc_package_should_use_interceptors_in_favor_of_stats_handlers branch from 37c0f77 to c1e018a Compare May 28, 2024 13:08
@Jack-R-lantern Jack-R-lantern marked this pull request as ready for review May 28, 2024 13:15
@Jack-R-lantern Jack-R-lantern requested a review from a team as a code owner May 28, 2024 13:15
@Jack-R-lantern
Copy link
Contributor Author

@blakepettersson Can you check on that PR?

Copy link
Member

@blakepettersson blakepettersson left a comment

Choose a reason for hiding this comment

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

This LGTM @Jack-R-lantern

@blakepettersson
Copy link
Member

For reference: #17790, #17197 and #17103 were previous attempts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for final review
Development

Successfully merging this pull request may close these issues.

otelgrpc package should use interceptors in favor of stats handlers
2 participants