Attribute names generated by steffan-westcott.clj-otel.api.attributes/->attributes contain a slash
Closed this issue · 3 comments
https://opentelemetry.io/docs/reference/specification/common/attribute-naming/ says:
Names SHOULD follow these rules:
- Use namespacing to avoid name clashes. Delimit the namespaces using a dot character. For example
service.version
denotes the service version whereservice
is the namespace andversion
is an attribute in that namespace.
but steffan-westcott.clj-otel.api.attributes/->attributes
generates names with a slash /
character delimiting the namespace instead of the dot .
character:
(steffan-westcott.clj-otel.api.attributes/->attributes {:foo/bar 1})
;=> #object[io.opentelemetry.api.common.ArrayBackedAttributes 0x1d4845f0 "{foo/bar=1}"]
@devurandom Thank you for raising this issue. Originally I intentionally retained the Clojure syntax for separating namespace and name with /
for attribute names, but on reflection, I think it is preferable to adopt the OpenTelemetry recommendation.
I noticed that https://opentelemetry.io/docs/specs/otel/common/attribute-naming/ also proposes snake_case instead of kebab-case, that is more common in Clojure keywords:
For each multi-word dot-delimited component of the attribute name separate the words by underscores (i.e. use snake_case). For example
http.status_code
denotes the status code in the http namespace.
@devurandom Thanks for highlighting this naming convention for attributes. I have addressed this shortcoming in this commit.