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

Stop recording http.request.socket.encrypted #1129

Merged
merged 3 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ endif::[]

https://github.com/elastic/apm-agent-go/compare/v1.14.0...master[View commits]

- Deprecate `http.request.socket.encrypted` and stop recording it in `module/apmhttp`, `module/apmgrpc` and `module/apmfiber`. {pull}1129[#(1129)]

[[release-notes-1.x]]
=== Go Agent version 1.x

Expand Down
1 change: 0 additions & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ func (c *Context) SetHTTPRequest(req *http.Request) {
}

c.requestSocket = model.RequestSocket{
Encrypted: req.TLS != nil,
RemoteAddress: apmhttputil.RemoteAddr(req),
}
if c.requestSocket != (model.RequestSocket{}) {
Expand Down
4 changes: 0 additions & 4 deletions gofuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package apm // import "go.elastic.co/apm"
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io"
Expand Down Expand Up @@ -81,9 +80,6 @@ func Fuzz(data []byte) int {
capturedBody := tracer.CaptureHTTPRequestBody(req)
if in.Request.Socket != nil {
req.RemoteAddr = in.Request.Socket.RemoteAddress
if in.Request.Socket.Encrypted {
req.TLS = new(tls.ConnectionState)
}
}
req.PostForm = postForm
if in.User != nil && in.User.Username != "" {
Expand Down
10 changes: 0 additions & 10 deletions model/marshal_fastjson.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions model/marshal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ func TestMarshalTransaction(t *testing.T) {
"random": "junk",
},
"socket": map[string]interface{}{
"encrypted": true,
"remote_address": "[::1]",
},
},
Expand Down Expand Up @@ -594,7 +593,6 @@ func fakeTransaction() model.Transaction {
{Name: "random", Value: "junk"},
},
Socket: &model.RequestSocket{
Encrypted: true,
RemoteAddress: "[::1]",
},
},
Expand Down
2 changes: 1 addition & 1 deletion model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ type Header struct {
// RequestSocket holds transport-level information relating to an HTTP request.
type RequestSocket struct {
// Encrypted indicates whether or not the request was sent
// as an SSL/HTTPS request.
// as an SSL/HTTPS request. Deprecated.
Encrypted bool `json:"encrypted,omitempty"`

// RemoteAddress holds the remote address for the request.
Expand Down
1 change: 0 additions & 1 deletion module/apmfiber/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ func TestMiddleware(t *testing.T) {
},
Request: &model.Request{
Socket: &model.RequestSocket{
Encrypted: false,
RemoteAddress: "remote-addr",
},
URL: model.URL{
Expand Down
1 change: 0 additions & 1 deletion module/apmgrpc/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ func TestServerTLS(t *testing.T) {
Values: []string{"grpc-go/" + grpc.Version},
}},
Socket: &model.RequestSocket{
Encrypted: true,
// Server is listening on loopback, so the client
// should have the same IP address. RemoteAddress
// does not record the port.
Expand Down
1 change: 0 additions & 1 deletion module/apmhttp/handler_http2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func TestHandlerHTTP2(t *testing.T) {
assert.Equal(t, &model.Context{
Request: &model.Request{
Socket: &model.RequestSocket{
Encrypted: true,
// 127.0.0.1 or ::1.
RemoteAddress: srvAddr.IP.String(),
},
Expand Down