Skip to content

Commit

Permalink
Redact URL in opencensus tracing
Browse files Browse the repository at this point in the history
This commit will also redact the URL to not expose credentials, similar
to #1459.
  • Loading branch information
olivere committed Jan 7, 2022
1 parent b130b33 commit 65568e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trace/opencensus/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) {
attrs = append(attrs,
trace.StringAttribute("Component", "github.com/olivere/elastic/v7"),
trace.StringAttribute("Method", req.Method),
trace.StringAttribute("URL", req.URL.String()),
trace.StringAttribute("URL", req.URL.Redacted()),
trace.StringAttribute("Hostname", req.URL.Hostname()),
trace.Int64Attribute("Port", atoi64(req.URL.Port())),
)
Expand Down

0 comments on commit 65568e6

Please sign in to comment.