File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ def span(
5555 with self .tracer .start_as_current_span (span_name ) as span :
5656 span .set_attribute ("http.request.method" , method )
5757 span .set_attribute ("db.system" , "elasticsearch" )
58+ if endpoint_id is not None :
59+ span .set_attribute ("db.operation" , endpoint_id )
5860 for key , value in path_parts .items ():
5961 span .set_attribute (f"db.elasticsearch.path_parts.{ key } " , value )
6062 yield
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ def test_detailed_span():
6262 assert spans [0 ].attributes == {
6363 "http.request.method" : "GET" ,
6464 "db.system" : "elasticsearch" ,
65+ "db.operation" : "ml.close_job" ,
6566 "db.elasticsearch.path_parts.job_id" : "my-job" ,
6667 "db.elasticsearch.path_parts.foo" : "bar" ,
6768 }
You can’t perform that action at this time.
0 commit comments