Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 6a83329

Browse files
authored
Put span.attributes to AzureMonitor properties (#682)
1 parent 7055f16 commit 6a83329

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

contrib/opencensus-ext-azure/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## Unreleased
4+
- Support span attributes
5+
([#682](https://github.com/census-instrumentation/opencensus-python/pull/682))
46

57
## 0.2.0
68
Released 2019-05-31

contrib/opencensus-ext-azure/opencensus/ext/azure/trace_exporter/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def span_data_to_envelope(self, sd):
7171
),
7272
responseCode='0', # TODO
7373
success=True, # TODO
74+
properties={},
7475
)
7576
envelope.data = Data(baseData=data, baseType='RequestData')
7677
if 'http.method' in sd.attributes:
@@ -92,6 +93,7 @@ def span_data_to_envelope(self, sd):
9293
sd.end_time,
9394
),
9495
success=True, # TODO
96+
properties={},
9597
)
9698
envelope.data = Data(
9799
baseData=data,
@@ -107,7 +109,9 @@ def span_data_to_envelope(self, sd):
107109
data.resultCode = str(sd.attributes['http.status_code'])
108110
else:
109111
data.type = 'INPROC'
110-
# TODO: links, tracestate, tags, attrs
112+
# TODO: links, tracestate, tags
113+
for key in sd.attributes:
114+
data.properties[key] = sd.attributes[key]
111115
return envelope
112116

113117
def emit(self, batch, event=None):

0 commit comments

Comments
 (0)