-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Currently opentelemetry-application-insights
reports all attributes (span and resource attributes) as properties. This means that attributes that are mapped to tags are reported twice, e.g.:
- Attributes
device.id
anddevice.model.name
:opentelemetry-application-insights/tests/http_requests.rs
Lines 38 to 39 in 542e80b
KeyValue::new(semcov::resource::DEVICE_ID, "123"), KeyValue::new(semcov::resource::DEVICE_MODEL_NAME, "device"), - Reported as tags:
opentelemetry-application-insights/tests/snapshots/http_requests__traces_simple.snap
Lines 164 to 165 in 542e80b
"ai.device.id": "123", "ai.device.model": "device", - Also reported as properties:
opentelemetry-application-insights/tests/snapshots/http_requests__traces_simple.snap
Lines 138 to 139 in 542e80b
"device.id": "123", "device.model.name": "device",
Advantages:
- Some tags have stricter length limitations. The property could report the full value while the tag would have a shorter one.
- Some tags are made up of multiple attributes, e.g.
server.address
+server.port
form the Dependency Target. The properties still report the individual values.
Disadvantages:
- Sending data twice causes more network traffic and storage. Is the amount of data relevant or small enough that it doesn't matter?
Looks like the JS exporter elides some attributes: https://github.com/Azure/azure-sdk-for-js/blob/c66cad23c4b803719db65cb48a453b0adc13307b/sdk/monitor/monitor-opentelemetry-exporter/src/utils/spanUtils.ts#L108-L143