Skip to content

feat(dataconnect): add "X-Client-Platform" and "X-Client-Version" headers - #3222

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

feat(dataconnect): add "X-Client-Platform" and "X-Client-Version" headers#3222
dconeybe wants to merge 2 commits into
mainfrom
dconeybe/dataconnect/CloudMonitoringHeaders

Conversation

@dconeybe

@dconeybe dconeybe commented Jul 28, 2026

Copy link
Copy Markdown

This PR adds x-client-platform and x-client-version request headers to the Data Connect gRPC connections. These headers supply the client platform (node) and SDK version (utils.getSdkVersion()) to enable metrics collection in Cloud Monitoring.

Highlights

  • New Metadata Headers: Added x-client-platform (set to "node") and x-client-version (set to utils.getSdkVersion()) request headers to getHeaders() in data-connect-api-client-internal.ts.
  • Unit Tests: Updated EXPECTED_HEADERS, EXPECTED_HEADERS_WITH_GEN, and EMULATOR_EXPECTED_HEADERS test fixture objects in data-connect-api-client-internal.spec.ts to assert the presence and values of both headers on outgoing requests.
Changelog
  • data-connect-api-client-internal.ts
    • Added x-client-platform and x-client-version headers to getHeaders().
  • data-connect-api-client-internal.spec.ts
    • Updated test fixture objects to verify x-client-platform and x-client-version headers.

…lient-Version" headers

Googlers see go/dataconnect:sdk:headers for details
@dconeybe dconeybe self-assigned this Jul 28, 2026

@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 adds 'x-client-platform' and 'x-client-version' headers to the Data Connect API client and updates the corresponding unit tests. The reviewer suggested capitalizing these headers to 'X-Client-Platform' and 'X-Client-Version' in both the implementation and test files to maintain consistency with existing headers.

Comment thread src/data-connect/data-connect-api-client-internal.ts Outdated
Comment thread test/unit/data-connect/data-connect-api-client-internal.spec.ts Outdated
Comment thread test/unit/data-connect/data-connect-api-client-internal.spec.ts Outdated
Comment thread test/unit/data-connect/data-connect-api-client-internal.spec.ts Outdated
…ther headers

The new headers `'x-client-platform'` and `'x-client-version'` are defined in
lowercase, which is inconsistent with the Pascal-Kebab-Case used for other
headers in this object (e.g., `'X-Firebase-Client'`, `'X-Goog-Api-Client'`) and
the PR title (`X-Client-Platform` and `X-Client-Version`). For consistency and
to match the PR description, these should be capitalized.

See #3222 (comment)
@dconeybe
dconeybe marked this pull request as ready for review July 28, 2026 19:46
@dconeybe
dconeybe requested a review from stephenarosaj July 28, 2026 19:46
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