The GCP metric client does not currently allow overriding with a custom endpoint, which is necessary for testing against a mock GCP API endpoint.
Resolved this issue by implementing a check to determine if an endpoint is specified in the GCP configuration, and subsequently overriding the ClientOption with that endpoint.
Checklist
[X] My code follows the style guidelines of this project
[ ] I have commented my code, particularly in hard-to-understand areas
[X] I have made corresponding changes to the documentation
[X] I have made corresponding change to the default configuration files
[X] I have added tests that prove my fix is effective or that my feature works
[X] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.
Disruptive User Impact
Author's Checklist
[ ]
How to test this PR locally
Related issues
Closes #40848
Use cases
Screenshots
Logs
This is an automatic backport of pull request #40918 done by Mergify.
Proposed commit message
The GCP metric client does not currently allow overriding with a custom endpoint, which is necessary for testing against a mock GCP API endpoint. Resolved this issue by implementing a check to determine if an endpoint is specified in the GCP configuration, and subsequently overriding the
ClientOption
with that endpoint.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs
This is an automatic backport of pull request #40918 done by Mergify.