Compare commits

...

2 commits

Author SHA1 Message Date
Peter Taoussanis
38f4246145 [fix] Line info missing from OpenTelemetry output
Some checks failed
Clj tests / tests (17, ubuntu-latest) (push) Has been cancelled
Clj tests / tests (19, ubuntu-latest) (push) Has been cancelled
Clj tests / tests (21, ubuntu-latest) (push) Has been cancelled
Cljs tests / tests (21, ubuntu-latest) (push) Has been cancelled
Graal tests / tests (17, macOS-latest) (push) Has been cancelled
Graal tests / tests (17, ubuntu-latest) (push) Has been cancelled
Graal tests / tests (17, windows-latest) (push) Has been cancelled
Previous code was a vestigial leftover from when signals
had {:line <num> :column <num> ...} rather than
{:coords [<line-num> <column-num>] ...}
2025-11-05 07:00:39 +01:00
Peter Taoussanis
ff31519d8f [mod] [fix] Timbre->Telemere appender callsite coords
There was unfortunately a bug in the Timbre->Telemere appender that
was producing signals with {:line <num> :column <num> ...} keys instead
of the expected {:coords [<line-num> <column-num>] ...} key.

This commit fixes the mistake, which should help fix issues with
any downstream middleware or handlers that expect a `:coords` key.

Unfortunately this fix could break a small minority of users that
have come to expect `:line` and `:column` keys on their Timbre signals
(none of the built-in middleware or handlers do).

Apologies for the trouble!
2025-11-05 06:57:13 +01:00
2 changed files with 6 additions and 7 deletions

View file

@ -219,15 +219,15 @@
(if (or common-attrs trace-attrs)
(let [ab (Attributes/builder)]
(when-let [ns (get signal :ns)] (.put ab "ns" (str ns)))
(when-let [line (get signal :line)] (.put ab "line" (long line)))
(when-let [ns (get signal :ns)] (.put ab "ns" (str ns)))
(when-let [line (enc/get-in* signal [:coords 0])] (.put ab "line" (long line)))
(when-let [attrs common-attrs] (put-attrs! ab attrs))
(when-let [attrs trace-attrs] (put-attrs! ab attrs))
(.build ab))
;; Common case
(when-let [ns (get signal :ns)]
(if-let [line (get signal :line)]
(when-let [ns (get signal :ns)]
(if-let [line (enc/get-in* signal [:coords 0])]
(Attributes/of ak-ns ns, ak-line (long line))
(Attributes/of ak-ns ns)))))))

View file

@ -200,9 +200,8 @@
:ctx+ context
:ns ?ns-str
:file ?file
:line ?line
:column ?column
:coords (when ?line [?line ?column])
:file ?file ; Non-standard, goes to kvs
:error ?err
:msg (force output_)})))})