File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313PROFILE_ID_SPAN_ATTRIBUTE_KEY = 'pyroscope.profile.id'
1414PROFILE_ID_PYROSCOPE_TAG_KEY = 'span_id'
15+ SPAN_NAME_PYROSCOPE_TAG_KEY = 'span_name'
1516
1617def _is_root_span (span : Span ):
1718 return span .parent is None or span .parent .is_remote
@@ -28,10 +29,12 @@ def on_start(
2829 if _is_root_span (span ):
2930 span .set_attribute (PROFILE_ID_SPAN_ATTRIBUTE_KEY , format (span .context .span_id , "016x" ))
3031 pyroscope .add_thread_tag (threading .get_ident (), PROFILE_ID_PYROSCOPE_TAG_KEY , _get_span_id (span ))
32+ pyroscope .add_thread_tag (threading .get_ident (), SPAN_NAME_PYROSCOPE_TAG_KEY , span .name )
3133
3234 def on_end (self , span : ReadableSpan ) -> None :
3335 if _is_root_span (span ):
3436 pyroscope .remove_thread_tag (threading .get_ident (), PROFILE_ID_PYROSCOPE_TAG_KEY , _get_span_id (span ))
37+ pyroscope .remove_thread_tag (threading .get_ident (), SPAN_NAME_PYROSCOPE_TAG_KEY , span .name )
3538
3639 def shutdown (self ) -> None :
3740 pass
You can’t perform that action at this time.
0 commit comments