File tree 2 files changed +5
-0
lines changed
2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ def format_to_ecs(self, record):
165
165
extras ["span.id" ] = extras .pop ("elasticapm_span_id" , None )
166
166
extras ["transaction.id" ] = extras .pop ("elasticapm_transaction_id" , None )
167
167
extras ["trace.id" ] = extras .pop ("elasticapm_trace_id" , None )
168
+ extras ["service.name" ] = extras .pop ("elasticapm_service_name" , None )
168
169
169
170
# Merge in any keys that were set within 'extra={...}'
170
171
for field , value in extras .items ():
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ def test_elasticapm_structlog_log_correlation_ecs_fields(spec_validator):
39
39
"span" : {"id" : span_id },
40
40
"trace" : {"id" : trace_id },
41
41
"transaction" : {"id" : transaction_id },
42
+ "service" : {"name" : "apm-service" },
42
43
}
43
44
44
45
@@ -85,6 +86,7 @@ def test_elastic_apm_stdlib_no_filter_log_correlation_ecs_fields():
85
86
"span" : {"id" : span_id },
86
87
"trace" : {"id" : trace_id },
87
88
"transaction" : {"id" : transaction_id },
89
+ "service" : {"name" : "apm-service" },
88
90
}
89
91
90
92
@@ -129,6 +131,7 @@ def test_elastic_apm_stdlib_with_filter_log_correlation_ecs_fields():
129
131
"span" : {"id" : span_id },
130
132
"trace" : {"id" : trace_id },
131
133
"transaction" : {"id" : transaction_id },
134
+ "service" : {"name" : "apm-service" },
132
135
}
133
136
134
137
@@ -174,4 +177,5 @@ def test_elastic_apm_stdlib_exclude_fields():
174
177
},
175
178
"message" : "test message" ,
176
179
"trace" : {"id" : trace_id },
180
+ "service" : {"name" : "apm-service" },
177
181
}
You can’t perform that action at this time.
0 commit comments