Skip to content

Commit 7039e2c

Browse files
committed
Run precommit
1 parent 779896f commit 7039e2c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

opentelemetry-exporter-gcp-logging/src/opentelemetry/exporter/cloud_logging/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,13 @@ def export(self, batch: Sequence[LogData]):
199199
)
200200
log_suffix = self.default_log_name
201201
if attributes.get(LOG_NAME_ATTRIBUTE_KEY):
202-
log_suffix = urllib.parse.quote_plus(attributes.get(LOG_NAME_ATTRIBUTE_KEY))
202+
log_suffix = urllib.parse.quote_plus(
203+
attributes.get(LOG_NAME_ATTRIBUTE_KEY)
204+
)
203205
elif log_record.event_name:
204-
log_suffix = urllib.parse.quote_plus(log_record.event_name.replace('.', '_'))
206+
log_suffix = urllib.parse.quote_plus(
207+
log_record.event_name.replace(".", "_")
208+
)
205209
log_entry.log_name = f"projects/{project_id}/logs/{log_suffix}"
206210
# If timestamp is unset fall back to observed_time_unix_nano as recommended,
207211
# see https://github.com/open-telemetry/opentelemetry-proto/blob/4abbb78/opentelemetry/proto/logs/v1/logs.proto#L176-L179

opentelemetry-exporter-gcp-logging/tests/test_cloud_logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def test_convert_otlp_dict_body(
7474
log_data = [
7575
LogData(
7676
log_record=LogRecord(
77-
event_name='random.genai.event',
77+
event_name="random.genai.event",
7878
timestamp=1736976310997977393,
7979
severity_number=SeverityNumber(20),
8080
trace_id=25,

0 commit comments

Comments
 (0)