File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
sdk/monitor/azure-monitor-opentelemetry-exporter
azure/monitor/opentelemetry/exporter Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
- Add device.* to part A fields
8
8
([ #34229 ] ( https://github.com/Azure/azure-sdk-for-python/pull/34229 ) )
9
+ - Add application.ver to part A fields
10
+ ([ #34401 ] ( https://github.com/Azure/azure-sdk-for-python/pull/34401 ) )
9
11
10
12
### Breaking Changes
11
13
Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ def _populate_part_a_fields(resource: Resource):
182
182
device_id = resource .attributes .get (ResourceAttributes .DEVICE_ID )
183
183
device_model = resource .attributes .get (ResourceAttributes .DEVICE_MODEL_NAME )
184
184
device_make = resource .attributes .get (ResourceAttributes .DEVICE_MANUFACTURER )
185
+ app_version = resource .attributes .get (ResourceAttributes .SERVICE_VERSION )
185
186
if service_name :
186
187
if service_namespace :
187
188
tags [ContextTagKeys .AI_CLOUD_ROLE ] = str (service_namespace ) + \
@@ -199,6 +200,9 @@ def _populate_part_a_fields(resource: Resource):
199
200
tags [ContextTagKeys .AI_DEVICE_MODEL ] = device_model # type: ignore
200
201
if device_make :
201
202
tags [ContextTagKeys .AI_DEVICE_OEM_NAME ] = device_make # type: ignore
203
+ if app_version :
204
+ tags [ContextTagKeys .AI_APPLICATION_VER ] = app_version # type: ignore
205
+
202
206
return tags
203
207
204
208
# pylint: disable=W0622
Original file line number Diff line number Diff line change @@ -51,7 +51,10 @@ def test_populate_part_a_fields(self):
51
51
"service.instance.id" : "testServiceInstanceId" ,
52
52
"device.id" : "testDeviceId" ,
53
53
"device.model.name" : "testDeviceModel" ,
54
- "device.manufacturer" : "testDeviceMake" })
54
+ "device.manufacturer" : "testDeviceMake" ,
55
+ "service.version" : "testApplicationVer" ,
56
+ }
57
+ )
55
58
tags = _utils ._populate_part_a_fields (resource )
56
59
self .assertIsNotNone (tags )
57
60
self .assertEqual (tags .get ("ai.cloud.role" ), "testServiceNamespace.testServiceName" )
@@ -60,6 +63,7 @@ def test_populate_part_a_fields(self):
60
63
self .assertEqual (tags .get ("ai.device.id" ), "testDeviceId" )
61
64
self .assertEqual (tags .get ("ai.device.model" ), "testDeviceModel" )
62
65
self .assertEqual (tags .get ("ai.device.oemName" ), "testDeviceMake" )
66
+ self .assertEqual (tags .get ("ai.application.ver" ), "testApplicationVer" )
63
67
64
68
def test_populate_part_a_fields_default (self ):
65
69
resource = Resource (
You can’t perform that action at this time.
0 commit comments