Skip to content

Commit

Permalink
updated http operations to be snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanosiano committed May 26, 2023
1 parent 06d74ff commit 247ceb3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ class SentryOkHttpEventListener(
private var originalEventListener: EventListener? = null

companion object {
internal const val PROXY_SELECT_EVENT = "proxySelect"
internal const val PROXY_SELECT_EVENT = "proxy_select"
internal const val DNS_EVENT = "dns"
internal const val SECURE_CONNECT_EVENT = "secureConnect"
internal const val SECURE_CONNECT_EVENT = "secure_connect"
internal const val CONNECT_EVENT = "connect"
internal const val CONNECTION_EVENT = "connection"
internal const val REQUEST_HEADERS_EVENT = "requestHeaders"
internal const val REQUEST_BODY_EVENT = "requestBody"
internal const val RESPONSE_HEADERS_EVENT = "responseHeaders"
internal const val RESPONSE_BODY_EVENT = "responseBody"
internal const val REQUEST_HEADERS_EVENT = "request_headers"
internal const val REQUEST_BODY_EVENT = "request_body"
internal const val RESPONSE_HEADERS_EVENT = "response_headers"
internal const val RESPONSE_BODY_EVENT = "response_body"

internal val eventMap: MutableMap<Call, SentryOkHttpEvent> = ConcurrentHashMap()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class SentryOkHttpEventListenerTest {
assertEquals(201, span.data["status_code"])
}
1 -> {
assertEquals("http.client.proxySelect", span.operation)
assertEquals("http.client.proxy_select", span.operation)
assertNotNull(span.data["proxies"])
}
2 -> {
Expand All @@ -176,14 +176,14 @@ class SentryOkHttpEventListenerTest {
assertEquals("http.client.connection", span.operation)
}
5 -> {
assertEquals("http.client.requestHeaders", span.operation)
assertEquals("http.client.request_headers", span.operation)
}
6 -> {
assertEquals("http.client.responseHeaders", span.operation)
assertEquals("http.client.response_headers", span.operation)
assertEquals(201, span.data["status_code"])
}
7 -> {
assertEquals("http.client.responseBody", span.operation)
assertEquals("http.client.response_body", span.operation)
}
}
}
Expand All @@ -200,7 +200,7 @@ class SentryOkHttpEventListenerTest {
val callSpan = okHttpEvent?.callRootSpan
response.close()
assertEquals(9, fixture.sentryTracer.children.size)
val requestBodySpan = fixture.sentryTracer.children.firstOrNull { it.operation == "http.client.requestBody" }
val requestBodySpan = fixture.sentryTracer.children.firstOrNull { it.operation == "http.client.request_body" }
assertNotNull(requestBodySpan)
assertEquals(requestBody.toByteArray().size.toLong(), requestBodySpan.data["http.request_content_length"])
assertEquals(requestBody.toByteArray().size.toLong(), callSpan?.getData("http.request_content_length"))
Expand All @@ -221,7 +221,7 @@ class SentryOkHttpEventListenerTest {
assertNotNull(responseBytes)

response.close()
val requestBodySpan = fixture.sentryTracer.children.firstOrNull { it.operation == "http.client.responseBody" }
val requestBodySpan = fixture.sentryTracer.children.firstOrNull { it.operation == "http.client.response_body" }
assertNotNull(requestBodySpan)
assertEquals(responseBytes.size.toLong(), requestBodySpan.data["http.response_content_length"])
assertEquals(responseBytes.size.toLong(), callSpan?.getData("http.response_content_length"))
Expand Down

0 comments on commit 247ceb3

Please sign in to comment.