Fork me on GitHub
#clj-otel
<
2023-09-19
>
jmv18:09:43

is there any appetite for handling keywords for span names automatically? i find myself doing this a lot

(span/with-span! {:name (qualified-name ::my-span-name)}
  ...)

πŸ‘ 1
jasonjckn05:09:17

yes, it’ll be easier to mu/log it as an event too , since it expects keywords

steffan12:09:52

This sounds like a fair idea πŸ™‚ I like the idea of supporting alternatives to the span options map where it appears in the clj-api api. Supporting a string or keyword to provide a span name seems very reasonable. I think supporting the common case of supplying a span name and attributes would also be worthwhile.

steffan13:09:48

An aside on steffan-westcott.clj-otel.util/qualified-name : The https://opentelemetry.io/docs/specs/otel/common/attribute-naming/ says that the attribute base name should be in snake_case. However, the https://opentelemetry.io/docs/specs/otel/trace/api/#span does not have this stipulation for span names. qualified-name is intended to be used for attribute names only, as it formats qualified keywords and converts all to snake_case. Using namespace-qualified keywords for span names is a good practice, but it is not required (and undesirable) to also convert them to snake_case.

πŸ‘ 1
steffan17:10:45

I'll take a look at this now that I've got clj-otel release 0.2.4.1 out the door. I didn't fancy adding this on top of what is already a fairly chunky release πŸ™‚

πŸ™Œ 2