Skip to content

Conversation

rohanshah18
Copy link
Contributor

@rohanshah18 rohanshah18 commented Jun 26, 2024

Problem

The user agent string was defaulting to netty-java-grpc/1.60.2 even though the user agent + source tag was passed in.

Solution

Instead of passing user agent as extra headers to the stubs, set the user agent string using .userAgent() on NettyChannelBuilder object.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Test Plan

Added a screenshot of the user agent being correctly populated in datadog on the internal ticket.

@rohanshah18 rohanshah18 requested a review from ssmith-pc June 26, 2024 17:52
@rohanshah18 rohanshah18 marked this pull request as ready for review June 26, 2024 17:56
*
* @return The user agent string for gRPC requests.
*/
public String getUserAgentGrpc() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this method since netty-java-grpc/ is already appended to the user-agent string

Copy link
Contributor

@ssmith-pc ssmith-pc left a comment

Choose a reason for hiding this comment

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

Love to see all that deleted code 👍

@rohanshah18 rohanshah18 merged commit fb4fb48 into main Jun 26, 2024
@rohanshah18 rohanshah18 deleted the rshah/fixUserAgentGRPC branch June 26, 2024 18:31
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.

2 participants