#How to get span fields values from on_event() when implementing a Layer?

3 messages · Page 1 of 1 (latest)

elfin spoke

Hi there, this is probably a slight case of "I'm not cafeinated (enough) yet", but in implementing a tracing Layer, how am I supposed to get the values of the fields stored in the span from on_event() ? It's easy to get the field names through ctx.current_span().metadata().fields() but how do I get the values?

warped helm

You have to store them in a span extension in new_span and on_record.

elfin spoke

thanks. It's probably very naive of me but I find the whole Layer API quite complicated, is there a document somewhere explaining why it's designed like that?