Replies: 2 comments 4 replies
-
There is an attribute.StringSlice for arrays of strings. IntSlice exists too. Maps are a bit different, as otel doesn't explicitly say how nested hash keys should be represented (they will have to end up being flattened). So you will have to setup your own helper method which will loop through each entry and set the proper key/value. |
Beta Was this translation helpful? Give feedback.
-
AFAIK most people do marshal JSON and pass it as a string attribute. Also a heads up, that OTel Go Logs (which is in design phase) will allow complex, structured attributes. |
Beta Was this translation helpful? Give feedback.
-
I've used structured loggers like zap and logrus where I can set maps or structs. How can I do this with opentelemetry traces? I feel like it is possible since I am using datadog and https://github.com/connectrpc/otelconnect-go which results in traces with nested attributes that look like this in datadog. (Apologies if this is too datadog specific)
However, I can't seem to find anything in this package that looks like
attribute.Map
orattribute.Any
.What strategies are people using?
Beta Was this translation helpful? Give feedback.
All reactions