File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
ext/opentelemetry-ext-azure-monitor/src/opentelemetry/ext/azure_monitor Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,22 @@ def span_to_envelope(self, span): # noqa pylint: disable=too-many-branches
152
152
data .resultCode = str (span .attributes ["http.status_code" ])
153
153
else : # SpanKind.INTERNAL
154
154
data .type = "InProc"
155
- # TODO: links, tracestate, tags
156
155
for key in span .attributes :
157
156
data .properties [key ] = span .attributes [key ]
157
+ if span .links :
158
+ links = []
159
+ for link in span .links :
160
+ links .append (
161
+ {
162
+ "operation_Id" : "{:032x}" .format (
163
+ link .context .trace_id
164
+ ),
165
+ "id" : "|{:032x}.{:016x}." .format (
166
+ link .context .trace_id , link .context .span_id
167
+ ),
168
+ }
169
+ )
170
+ data .properties ["_MS.links" ] = json .dumps (links )
171
+ print (data .properties ["_MS.links" ])
172
+ # TODO: tracestate, tags
158
173
return envelope
You can’t perform that action at this time.
0 commit comments