clj-otel

jmv 2024-02-13T18:58:45.682749Z

hello! when using keywords as spans, i see that the colon is left on the front. would you be opposed to stripping that for consistency with the built-in agent instrumentation spans?

steffan 2024-02-13T22:34:42.584079Z

Retaining the : is an intentional design choice, I think there is value in not altering keywords, particularly when considering that span names may be queried in the telemetry backend. Remember you are free to use a string or a symbol instead of a keyword for the span name:

(defn square [n]
  (span/with-span! 'my-app/squaring
    (* n n)))

jmv 2024-02-14T17:02:32.837309Z

yep, that makes sense. just trying to enable my span naming laziness. 🙂

steffan 2024-02-14T22:42:28.014779Z

I will bear this in mind though. I've been thinking about adding a feature to enable span-opts to be modified by an arbitrary function for all spans as they are created. This could be used for tweaking span names, for example. The use case I have in mind is copying specified key-value pairs in baggage to span attributes. I know Honeycomb has a basic form of this idea in BaggageSpanProcessor class in their Java OpenTelemetry SDK.

👍 2