Skip to content

Commit c0cfd4e

Browse files
authored
Use span.update_context to avoid DroppedSpan issues in Elasticsearch instrumentation (#1690)
* Use span.update_context to avoid DroppedSpan issues * CHANGELOG
1 parent 8038a4d commit c0cfd4e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

CHANGELOG.asciidoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ endif::[]
2929
//===== Bug fixes
3030
//
3131
32+
=== Unreleased
33+
34+
// Unreleased changes go here
35+
// When the next release happens, nest these changes under the "Python Agent version 6.x" heading
36+
//[float]
37+
//===== Features
38+
//
39+
[float]
40+
===== Bug fixes
41+
42+
* Fix error in Elasticsearch instrumentation when spans are dropped {pull}1690[#1690]
43+
3244
[[release-notes-6.x]]
3345
=== Python Agent version 6.x
3446

elasticapm/instrumentation/packages/elasticsearch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def call(self, module, method, wrapped, instance, args, kwargs):
163163

164164
hits = self._get_hits(result_data)
165165
if hits:
166-
span.context["db"]["rows_affected"] = hits
166+
span.update_context("db", {"rows_affected": hits})
167167

168168
return result_data
169169

0 commit comments

Comments
 (0)