Skip to content
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

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

priettt
Copy link
Contributor

@priettt priettt commented Apr 17, 2024

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()

@priettt priettt marked this pull request as ready for review April 17, 2024 14:28
@priettt priettt requested a review from a team as a code owner April 17, 2024 14:28
"error.type" to networkRequest.errorType,
"error.message" to networkRequest.errorMessage,
"emb.w3c_traceparent" to networkRequest.w3cTraceparent,
"emb.trace_id" to getValidTraceId(networkRequest.traceId),
Copy link
Collaborator

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,
Copy link
Collaborator

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

Copy link
Collaborator

@bidetofevil bidetofevil left a 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.

Copy link
Collaborator

@bidetofevil bidetofevil left a 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

Copy link
Collaborator

bidetofevil commented Apr 18, 2024

Merge activity

  • Apr 18, 7:50 PM EDT: @bidetofevil started a stack merge that includes this pull request via Graphite.
  • Apr 18, 7:54 PM EDT: Graphite rebased this pull request as part of a merge.
  • Apr 18, 7:57 PM EDT: @bidetofevil merged this pull request with Graphite.

Base automatically changed from remove-network-snapshots to master April 18, 2024 23:53
@bidetofevil bidetofevil merged commit dab7985 into master Apr 18, 2024
1 of 2 checks passed
@bidetofevil bidetofevil deleted the request-schema-type branch April 18, 2024 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants