Skip to content

dataconnect(change): add "X-Client-Platform" and "X-Client-Version" headers - #8486

Open
dconeybe wants to merge 4 commits into
mainfrom
dconeybe/dataconnect/CloudMonitoringHeaders
Open

dataconnect(change): add "X-Client-Platform" and "X-Client-Version" headers#8486
dconeybe wants to merge 4 commits into
mainfrom
dconeybe/dataconnect/CloudMonitoringHeaders

Conversation

@dconeybe

@dconeybe dconeybe commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR adds x-client-platform and x-client-version gRPC request headers to the firebase-dataconnect SDK. These headers supply the client platform (android) and SDK version to enable metrics collection in Cloud Monitoring.

Highlights

  • New gRPC Metadata Headers: Added x-client-platform (set to "android") and x-client-version (set to the SDK version) headers to DataConnectGrpcMetadata to enable Cloud Monitoring metrics collection.
  • Comprehensive Test Coverage: Expanded DataConnectGrpcMetadataUnitTest, DataConnectGrpcRPCsUnitTest, and GrpcMetadataIntegrationTest to verify that x-client-platform and x-client-version headers are included in all gRPC requests (executeQuery, executeMutation, and connect).
  • Changelog Entry: Added an entry in CHANGELOG.md under firebase-dataconnect.
Changelog
  • CHANGELOG.md
    • Added a changelog entry for adding gRPC request headers for platform name and SDK version.
  • DataConnectGrpcMetadata.kt
    • Added x-client-platform and x-client-version header keys and included them in outgoing gRPC metadata.
  • GrpcMetadataIntegrationTest.kt
    • Added assertions verifying x-client-platform and x-client-version headers are present in integration tests.
  • DataConnectGrpcMetadataUnitTest.kt
    • Refactored test assertions into testMetadataIncludesHeader and added unit tests for x-client-platform and x-client-version.
  • DataConnectGrpcRPCsUnitTest.kt
    • Added HeaderCapturingServerInterceptor and unit tests verifying x-client-platform and x-client-version headers across executeQuery, executeMutation, and connect RPCs.

@dconeybe

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces gRPC request headers for the client platform and SDK version to enable metrics collection in cloud monitoring, updating the metadata generation and adding corresponding integration and unit tests. The review feedback suggests defining these new header keys in lowercase (e.g., x-client-platform and x-client-version) to align with gRPC/HTTP2 standards and maintain consistency across the codebase and tests.

dconeybe added 2 commits July 27, 2026 18:22
…Client-Version" strings

gRPC and HTTP/2 headers are case-insensitive and are required to be lowercase on
the wire. Defining metadata keys with uppercase characters (like `X-Client-Platform`
and `X-Client-Version`) is inconsistent with the other headers defined in this file
(which are all lowercase, e.g., `x-goog-request-params`, `x-firebase-gmpid`) and
can lead to confusion or potential issues with case-sensitive interceptors or mocks.
It is highly recommended to define these keys in lowercase.

#8486 (comment)
@github-actions

Copy link
Copy Markdown
Contributor

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@dconeybe
dconeybe marked this pull request as ready for review July 28, 2026 01:14
@dconeybe dconeybe changed the title dataconnect(change): Add grpc request headers for platform name and sdk version dataconnect(change): add "X-Client-Platform" and "X-Client-Version" headers Jul 28, 2026
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.

1 participant