File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1515from __future__ import annotations
1616
1717import logging
18+ import os
1819from typing import cast
1920from typing import Optional
2021from typing import TYPE_CHECKING
3738
3839logger = logging .getLogger ('google_adk.' + __name__ )
3940
41+ _GCP_LOG_NAME_ENV_VARIABLE_NAME = 'GOOGLE_CLOUD_DEFAULT_LOG_NAME'
42+ _DEFAULT_LOG_NAME = 'adk-otel'
43+
4044
4145@experimental
4246def get_gcp_exporters (
@@ -118,9 +122,13 @@ def _get_gcp_metrics_exporter(project_id: str) -> MetricReader:
118122def _get_gcp_logs_exporter (project_id : str ) -> LogRecordProcessor :
119123 from opentelemetry .exporter .cloud_logging import CloudLoggingExporter
120124
125+ default_log_name = os .environ .get (
126+ _GCP_LOG_NAME_ENV_VARIABLE_NAME , _DEFAULT_LOG_NAME
127+ )
121128 return BatchLogRecordProcessor (
122- # TODO(jawoszek) - add default_log_name once design is approved.
123- CloudLoggingExporter (project_id = project_id )
129+ CloudLoggingExporter (
130+ project_id = project_id , default_log_name = default_log_name
131+ ),
124132 )
125133
126134
You can’t perform that action at this time.
0 commit comments