Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aiplatform): Add support for setting User agent header #364

Merged
merged 14 commits into from May 6, 2021
Merged
3 changes: 3 additions & 0 deletions google/cloud/aiplatform/constants.py
Expand Up @@ -75,3 +75,6 @@
"MOBILE_JETSON_LOW_LATENCY_1",
},
}

# Used in constructing the requests user_agent header for metrics reporting.
USER_AGENT_PRODUCT = "model-builder"
3 changes: 2 additions & 1 deletion google/cloud/aiplatform/initializer.py
Expand Up @@ -259,7 +259,8 @@ def create_client(
"google-cloud-aiplatform",
).version
client_info = gapic_v1.client_info.ClientInfo(
gapic_version=gapic_version, user_agent=f"model-builder/{gapic_version}"
gapic_version=gapic_version,
user_agent=f"{constants.USER_AGENT_PRODUCT}/{gapic_version}"
)

kwargs = {
Expand Down