File tree Expand file tree Collapse file tree
opentelemetry-exporter-gcp-logging/src/opentelemetry/exporter/cloud_logging Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,8 +226,6 @@ def export(self, batch: Sequence[LogData]):
226226 log_entry = LogEntry ()
227227 log_record = log_data .log_record
228228 attributes = log_record .attributes or {}
229- if log_record .event_name :
230- attributes ["event.name" ] = log_record .event_name
231229 project_id = str (
232230 attributes .get (PROJECT_ID_ATTRIBUTE_KEY , self .project_id )
233231 )
@@ -269,6 +267,8 @@ def export(self, batch: Sequence[LogData]):
269267 k : _convert_any_value_to_string (v )
270268 for k , v in attributes .items ()
271269 }
270+ if log_record .event_name :
271+ log_entry .labels ["event.name" ] = log_record .event_name
272272 _set_payload_in_log_entry (log_entry , log_record .body )
273273 log_entries .append (log_entry )
274274
You can’t perform that action at this time.
0 commit comments