-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a SchemaType for mapping an EmbraceNetworkRequest to OTel compliant attributes #747
Conversation
"error.type" to networkRequest.errorType, | ||
"error.message" to networkRequest.errorMessage, | ||
"emb.w3c_traceparent" to networkRequest.w3cTraceparent, | ||
"emb.trace_id" to getValidTraceId(networkRequest.traceId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should rename this as it is confusing in terms of what traceId means in OTel.
@@ -195,6 +197,20 @@ internal sealed class SchemaType( | |||
).toNonNullMap() | |||
} | |||
|
|||
internal class NetworkRequest(networkRequest: EmbraceNetworkRequest) : SchemaType(EmbType.Performance.Network) { | |||
override val attrs = mapOf( | |||
"url.full" to networkRequest.url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll move to the semantic conventions if they can fix it in time - otherwise, we can move these into OpenTelemetryAttributeKeys
later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should pick a different attribute name than emb.trace_id
as that is confusing. Hopefully the backend can make this change in time? If not, we can merge as is and fix it later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provisional LGTM - renaming emb.trace_id
would be ideal
6e4df14
to
7db70d7
Compare
9be830b
to
97196f8
Compare
Merge activity
|
7db70d7
to
1b90b3f
Compare
97196f8
to
c0bc028
Compare
Goal
This will be used in EmbraceNetworkLoggingService to map from an EmbraceNetworkRequest to the correct span attributes.
We verified with backend that removing null attributes would cause no issues, so we are using toNonNullMap()