You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-23 22:34:47 +02:00
Change ClientResponse to accept an *http.Response (#3617)
This commit is contained in:
@@ -68,7 +68,7 @@ var (
|
|||||||
// request contained in resp. For example:
|
// request contained in resp. For example:
|
||||||
//
|
//
|
||||||
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
||||||
func ClientResponse(resp http.Response) []attribute.KeyValue {
|
func ClientResponse(resp *http.Response) []attribute.KeyValue {
|
||||||
return hc.ClientResponse(resp)
|
return hc.ClientResponse(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ type HTTPConv struct {
|
|||||||
// request contained in resp. For example:
|
// request contained in resp. For example:
|
||||||
//
|
//
|
||||||
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
||||||
func (c *HTTPConv) ClientResponse(resp http.Response) []attribute.KeyValue {
|
func (c *HTTPConv) ClientResponse(resp *http.Response) []attribute.KeyValue {
|
||||||
var n int
|
var n int
|
||||||
if resp.StatusCode > 0 {
|
if resp.StatusCode > 0 {
|
||||||
n++
|
n++
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ var hc = &HTTPConv{
|
|||||||
|
|
||||||
func TestHTTPClientResponse(t *testing.T) {
|
func TestHTTPClientResponse(t *testing.T) {
|
||||||
const stat, n = 201, 397
|
const stat, n = 201, 397
|
||||||
resp := http.Response{
|
resp := &http.Response{
|
||||||
StatusCode: stat,
|
StatusCode: stat,
|
||||||
ContentLength: n,
|
ContentLength: n,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ var (
|
|||||||
// request contained in resp. For example:
|
// request contained in resp. For example:
|
||||||
//
|
//
|
||||||
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
||||||
func ClientResponse(resp http.Response) []attribute.KeyValue {
|
func ClientResponse(resp *http.Response) []attribute.KeyValue {
|
||||||
return hc.ClientResponse(resp)
|
return hc.ClientResponse(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ var (
|
|||||||
// request contained in resp. For example:
|
// request contained in resp. For example:
|
||||||
//
|
//
|
||||||
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
||||||
func ClientResponse(resp http.Response) []attribute.KeyValue {
|
func ClientResponse(resp *http.Response) []attribute.KeyValue {
|
||||||
return hc.ClientResponse(resp)
|
return hc.ClientResponse(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ var (
|
|||||||
// request contained in resp. For example:
|
// request contained in resp. For example:
|
||||||
//
|
//
|
||||||
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
||||||
func ClientResponse(resp http.Response) []attribute.KeyValue {
|
func ClientResponse(resp *http.Response) []attribute.KeyValue {
|
||||||
return hc.ClientResponse(resp)
|
return hc.ClientResponse(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ var (
|
|||||||
// request contained in resp. For example:
|
// request contained in resp. For example:
|
||||||
//
|
//
|
||||||
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
||||||
func ClientResponse(resp http.Response) []attribute.KeyValue {
|
func ClientResponse(resp *http.Response) []attribute.KeyValue {
|
||||||
return hc.ClientResponse(resp)
|
return hc.ClientResponse(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ var (
|
|||||||
// request contained in resp. For example:
|
// request contained in resp. For example:
|
||||||
//
|
//
|
||||||
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
// append(ClientResponse(resp), ClientRequest(resp.Request)...)
|
||||||
func ClientResponse(resp http.Response) []attribute.KeyValue {
|
func ClientResponse(resp *http.Response) []attribute.KeyValue {
|
||||||
return hc.ClientResponse(resp)
|
return hc.ClientResponse(resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user