@@ -7,26 +7,18 @@ import (
7
7
"io"
8
8
"net/http"
9
9
"net/url"
10
-
11
- "github.com/snyk/code-client-go/observability"
12
10
)
13
11
14
12
var (
15
- completeStatus = "COMPLETE"
16
- failedToObtainRequestIdString = "Failed to obtain request id. "
17
- defaultEndpointURL = "http://localhost:10000/explain"
13
+ completeStatus = "COMPLETE"
14
+ defaultEndpointURL = "http://localhost:10000/explain"
18
15
)
19
16
20
17
func (d * DeepCodeLLMBindingImpl ) runExplain (ctx context.Context , options ExplainOptions ) (Explanations , error ) {
21
18
span := d .instrumentor .StartSpan (ctx , "code.RunExplain" )
22
19
defer span .Finish ()
23
20
24
- requestId , err := observability .GetTraceId (ctx )
25
- logger := d .logger .With ().Str ("method" , "code.RunExplain" ).Str ("requestId" , requestId ).Logger ()
26
- if err != nil {
27
- logger .Err (err ).Msg (failedToObtainRequestIdString + err .Error ())
28
- return Explanations {}, err
29
- }
21
+ logger := d .logger .With ().Str ("method" , "code.RunExplain" ).Logger ()
30
22
31
23
logger .Debug ().Msg ("API: Retrieving explain for bundle" )
32
24
defer logger .Debug ().Msg ("API: Retrieving explain done" )
@@ -52,7 +44,7 @@ func (d *DeepCodeLLMBindingImpl) runExplain(ctx context.Context, options Explain
52
44
return Explanations {}, err
53
45
}
54
46
55
- d .addDefaultHeaders (req , requestId )
47
+ d .addDefaultHeaders (req )
56
48
57
49
resp , err := d .httpClientFunc ().Do (req ) //nolint:bodyclose // this seems to be a false positive
58
50
if err != nil {
@@ -111,8 +103,7 @@ func (d *DeepCodeLLMBindingImpl) explainRequestBody(options *ExplainOptions) ([]
111
103
return requestBody , marshalErr
112
104
}
113
105
114
- func (d * DeepCodeLLMBindingImpl ) addDefaultHeaders (req * http.Request , requestId string ) {
115
- req .Header .Set ("snyk-request-id" , requestId )
106
+ func (d * DeepCodeLLMBindingImpl ) addDefaultHeaders (req * http.Request ) {
116
107
req .Header .Set ("Cache-Control" , "private, max-age=0, no-cache" )
117
108
req .Header .Set ("Content-Type" , "application/json" )
118
109
}
0 commit comments