Skip to content

Conversation

ayusjayaswal
Copy link

Contributor: Ayush Jayaswal
Track: Core Framework

@coolwednesday please review this PR.

This Patch does the following:

  • Improvements in pkg/gofr/grpc.go:
    • Improved support for metrics.
    • Ensures logs and metrics are recorded for every stream sent/received.
    • Cleaner code with more maintainable functions.
    • Updated createServer(...) function to return error if encountered.
    • pkg/factory.go updated to reflect on this change.
  • Improvements in pkg/gofr/gprc/log.go:
    • Introduced Fatalf errors
    • Streamlined codebase for better mentainability
    • Reduced sizes of larger functions into smaller helper functions.
    • Major improvements to log_test.go for better coverage.
  • Improvements in documentation
    • Added a section about Stream interceptors
    • Added sections for Error handling, Reflection and Metrics
  • Major improvements to log_test.go for better coverage.- Improvements in documentation
    • Added a section about Stream interceptors
    • Added sections for Error handling, Reflection and Metrics

closes #2027

Copy link
Member

@coolwednesday coolwednesday left a comment

Choose a reason for hiding this comment

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

@ayusjayaswal , Hey can you fix the code quality issues. I will test the PR after that and we will be good to go.

@ayusjayaswal
Copy link
Author

hi! @coolwednesday thanks for the help; the mistakes you pointed out are now corrected :D

Copy link
Member

@coolwednesday coolwednesday left a comment

Choose a reason for hiding this comment

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

@ayusjayaswal, Here’s the screenshot. I noticed the logs are a bit inconsistent.

  • Please review and update the logs for streaming client & server as well as unary client & server examples in the GoFr examples folder.
  • Also, add the metrics and traces and logs screenshots.
  • Once that’s done, we can proceed to merge this PR.
  • While updating, make sure to check for any log inconsistencies and fix them.
  • Also fix the code quality issues.

Scenario : When port is blocked.
Screenshot 2025-08-12 at 11 59 37 AM

@ayusjayaswal
Copy link
Author

Hi @coolwednesday following changes are done

  • finalize the gRPC related code for code quality
  • made the logs consistent

following are some screenshots

for streaming server and client
streamin

for unary server and client
unary

coolwednesday
coolwednesday previously approved these changes Aug 21, 2025
@coolwednesday coolwednesday dismissed their stale review August 21, 2025 06:35

Accidentally Approved

Copy link
Member

@coolwednesday coolwednesday left a comment

Choose a reason for hiding this comment

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

Hey I checked your tests are not passing. Please check that. Also Please also check sending requests through postman if you are able to see their correct traces, logs etc ... based on the changes that you did. Add screenshots of the same.

Thanks ! Post these , we will be good to go to fix these.

@coolwednesday
Copy link
Member

@ayusjayaswal ? Any updates on this ?

@ayusjayaswal
Copy link
Author

@coolwednesday hi I'm working on fixing the registerMetrics function in grpc.go, it is causing problems for the testing. Once this is done all tests should pass properly.

@coolwednesday
Copy link
Member

@coolwednesday hi I'm working on fixing the registerMetrics function in grpc.go, it is causing problems for the testing. Once this is done all tests should pass properly.

Sure ! Let me know if you are stuck. You can share it here !

@ayusjayaswal
Copy link
Author

Hi, I have made most tests pass properly, lints should pass too. But, I couldn't get past this issue (see screenshot 2).

@coolwednesday , I'll need some help with the TestGRPC_ServerRun function.

logtest grpc

@coolwednesday
Copy link
Member

Hi, I have made most tests pass properly, lints should pass too. But, I couldn't get past this issue (see screenshot 2).

@coolwednesday , I'll need some help with the TestGRPC_ServerRun function.

logtest grpc

No worries. Will pick this up as soon as I can ...and get this PR done. Thanks for the work you have put Ayush.

@ayusjayaswal
Copy link
Author

Thanks! @coolwednesday , I’d prefer to complete this PR, whichever feels appropriate to you.

@coolwednesday
Copy link
Member

coolwednesday commented Sep 3, 2025

Thanks! @coolwednesday , I’d prefer to complete this PR, whichever feels appropriate to you.

Go ahead ! Let me know the blocker than. The test I will check and try to fix it tomorrow. Try debugging it till then.

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.

Improve gRPC implementation
3 participants