taoensso / telemere

Structured telemetry library for Clojure/Script
https://www.taoensso.com/telemere
Eclipse Public License 1.0
200 stars 5 forks source link

:id and :uid are nil on CLJS?? #18

Closed johanatan closed 2 months ago

johanatan commented 2 months ago

.

ptaoussanis commented 2 months ago

@johanatan Hi Jonathan - can you please show an example of your signal creator call?

johanatan commented 2 months ago

(tel/log! {:level :error :error ex} "Insuffient data")

ptaoussanis commented 2 months ago

Great, thanks 👍

So that call will intentionally generate signals without an id or uid.

To include an id, you'll need to specify one - e.g.:

(tel/with-signal
  (tel/log! {:level :error, :error ex, :id ::my-id} "Insuffient data")) ; => {:id ::my-id ...}

Likewise, signals don't get a :uid by default unless they're tracing (see trace! or spy!):

(with-signal (trace! {:level :error} (do "my form"))) ; => {:uid "gDDvd6QYqjwPTwm4Zj__E" ...}, etc.

It should actually be possible to also do this to force an auto uid even when not tracing-

(tel/log! {:level :error, :error ex, :id ::my-id, :uid :auto})

But I can see that's currently not working. Will get it fixed in the next beta 👍 I'll also update the docs to make it clearer that uids are automatic by default only when tracing.

Does that help?

johanatan commented 2 months ago

Yes, thank you.