File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
metadata-ingestion/src/datahub/ingestion/source/bigquery_v2 Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1515
1616
1717def _get_bigquery_client_info () -> ClientInfo :
18- """Get ClientInfo with DataHub user-agent for BigQuery client identification"""
19- return ClientInfo (user_agent = f"datahub/{ __version__ } " )
18+ """Get ClientInfo with DataHub user-agent for GCP API identification.
19+
20+ Follows Google's recommended format:
21+ "<prod_name>/ver (GPN:<company name>; <other comments>)"
22+ """
23+ return ClientInfo (user_agent = f"DataHub/{ __version__ } (GPN:DataHub)" )
2024
2125
2226class BigQueryConnectionConfig (ConfigModel ):
@@ -68,9 +72,15 @@ def make_gcp_logging_client(
6872 client_options = self .extra_client_options .copy ()
6973 client_options ["_use_grpc" ] = False
7074 if project_id is not None :
71- return GCPLoggingClient (** client_options , project = project_id )
75+ return GCPLoggingClient (
76+ ** client_options ,
77+ project = project_id ,
78+ client_info = _get_bigquery_client_info (),
79+ )
7280 else :
73- return GCPLoggingClient (** client_options )
81+ return GCPLoggingClient (
82+ ** client_options , client_info = _get_bigquery_client_info ()
83+ )
7484
7585 def get_sql_alchemy_url (self ) -> str :
7686 if self .project_on_behalf :
You can’t perform that action at this time.
0 commit comments