pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/DataDog/datadog-agent/commit/1dfe3dab47bee66595fe800685de3e6918f552bb

ss" /> dyninst: send logs to the DEBUGGER track (#43432) · DataDog/datadog-agent@1dfe3da · GitHub
Skip to content

Commit 1dfe3da

Browse files
authored
dyninst: send logs to the DEBUGGER track (#43432)
Before this patch, logs (including snapshots) were sent to /debugger/v1/input. Now, they will be sent to /debugger/v2/input. The v2/input URL pipes the snapshots to our DEBUGGER EvP track, where we'll do redaction. Closes https://datadoghq.atlassian.net/browse/DEBUG-4344 Co-authored-by: andrei.matei <andrei.matei@datadoghq.com>
1 parent 3f3007a commit 1dfe3da

File tree

220 files changed

+492
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+492
-201
lines changed

pkg/dyninst/decode/decoder.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ func (d *Decoder) resetForNextMessage() {
240240
// Event wraps the output Event from the BPF program. It also adds fields
241241
// that are not present in the BPF program.
242242
type Event struct {
243-
Probe *ir.Probe
244243
EntryOrLine output.Event
245244
Return output.Event
246245
ServiceName string
@@ -311,6 +310,11 @@ func (s *message) init(
311310
}
312311
probeEvent := decoder.probeEvents[decoder.entryOrLine.rootType.ID]
313312
probe := probeEvent.probe
313+
314+
if probe.GetKind() == ir.ProbeKindSnapshot || probe.GetKind() == ir.ProbeKindLog {
315+
s.Debugger.Type = payloadTypeSnapshot
316+
}
317+
314318
header, err := event.EntryOrLine.Header()
315319
if err != nil {
316320
return probe, fmt.Errorf("error getting header %w", err)

pkg/dyninst/decode/marshal.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@ type logger struct {
3232
ThreadName string `json:"thread_name"`
3333
}
3434

35+
type payloadType string
36+
37+
const (
38+
payloadTypeSnapshot payloadType = "snapshot"
39+
)
40+
3541
type debuggerData struct {
3642
Snapshot snapshotData `json:"snapshot,omitempty"`
43+
Type payloadType `json:"type,omitempty"`
3744
EvaluationErrors []evaluationError `json:"evaluationErrors,omitempty"`
3845
}
3946

pkg/dyninst/module/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
// Config is the configuration for the dynamic instrumentation module.
3030
type Config struct {
3131
ebpf.Config
32+
// The URL to upload logs (with or without snapshots) to.
3233
LogUploaderURL string
3334
DiagsUploaderURL string
3435
SymDBUploadEnabled bool
@@ -147,7 +148,7 @@ const (
147148

148149
traceAgentURLEnvVar = "DD_TRACE_AGENT_URL"
149150

150-
logUploaderPath = "/debugger/v1/input"
151+
logUploaderPath = "/debugger/v2/input"
151152
diagsUploaderPath = "/debugger/v1/diagnostics"
152153
symdbUploaderPath = "/symdb/v1/input"
153154
)

pkg/dyninst/module/module.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,19 +204,17 @@ func makeRealDependencies(
204204
}
205205
}()
206206

207-
logUploaderURL, err := url.Parse(config.LogUploaderURL)
207+
logsURL, err := url.Parse(config.LogUploaderURL)
208208
if err != nil {
209209
return ret, fmt.Errorf("error parsing log uploader URL: %w", err)
210210
}
211-
ret.logUploader = uploader.NewLogsUploaderFactory(
212-
uploader.WithURL(logUploaderURL),
213-
)
211+
ret.logUploader = uploader.NewLogsUploaderFactory(logsURL)
214212

215213
diagsUploaderURL, err := url.Parse(config.DiagsUploaderURL)
216214
if err != nil {
217215
return ret, fmt.Errorf("error parsing diagnostics uploader URL: %w", err)
218216
}
219-
diagsUploader := uploader.NewDiagnosticsUploader(uploader.WithURL(diagsUploaderURL))
217+
diagsUploader := uploader.NewDiagnosticsUploader(diagsUploaderURL)
220218
ret.diagsUploader = diagsUploader
221219

222220
var symdbUploaderURL *url.URL

pkg/dyninst/module/module_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,9 @@ func (f *fakeLogsUploaderFactory) GetUploader(
855855
return ul
856856
}
857857

858+
// fakeLogsUploader implements module.LogsUploader.
859+
var _ module.LogsUploader = (*fakeLogsUploader)(nil)
860+
858861
type fakeLogsUploader struct {
859862
messages []json.RawMessage
860863
closed bool

pkg/dyninst/module/sink.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
package module
99

1010
import (
11-
"encoding/json"
1211
"fmt"
1312
"io"
1413
"slices"
@@ -228,10 +227,10 @@ func (s *sink) HandleEvent(msg dispatcher.Message) error {
228227
return nil
229228
}
230229
s.runtime.setProbeMaybeEmitting(s.programID, probe)
231-
s.logUploader.Enqueue(json.RawMessage(decodedBytes))
232230
if missingTypes := s.missingTypes.drain(); len(missingTypes) > 0 {
233231
s.runtime.actuator.ReportMissingTypes(s.processID, missingTypes)
234232
}
233+
s.logUploader.Enqueue(decodedBytes)
235234
return nil
236235
}
237236

pkg/dyninst/testdata/decoded/fault/callMe.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
}
6363
}
6464
}
65-
}
65+
},
66+
"type": "snapshot"
6667
},
6768
"timestamp": "[ts]",
6869
"duration": "[duration]"

pkg/dyninst/testdata/decoded/sample/stackC.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
}
6868
}
6969
}
70-
}
70+
},
71+
"type": "snapshot"
7172
},
7273
"timestamp": "[ts]",
7374
"duration": "[duration]",

pkg/dyninst/testdata/decoded/sample/testAny.json

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
}
7171
}
7272
}
73-
}
73+
},
74+
"type": "snapshot"
7475
},
7576
"timestamp": "[ts]",
7677
"duration": "[duration]",
@@ -147,7 +148,8 @@
147148
}
148149
}
149150
}
150-
}
151+
},
152+
"type": "snapshot"
151153
},
152154
"timestamp": "[ts]",
153155
"duration": "[duration]",
@@ -224,7 +226,8 @@
224226
}
225227
}
226228
}
227-
}
229+
},
230+
"type": "snapshot"
228231
},
229232
"timestamp": "[ts]",
230233
"duration": "[duration]",
@@ -301,7 +304,8 @@
301304
}
302305
}
303306
}
304-
}
307+
},
308+
"type": "snapshot"
305309
},
306310
"timestamp": "[ts]",
307311
"duration": "[duration]",
@@ -378,7 +382,8 @@
378382
}
379383
}
380384
}
381-
}
385+
},
386+
"type": "snapshot"
382387
},
383388
"timestamp": "[ts]",
384389
"duration": "[duration]",
@@ -455,7 +460,8 @@
455460
}
456461
}
457462
}
458-
}
463+
},
464+
"type": "snapshot"
459465
},
460466
"timestamp": "[ts]",
461467
"duration": "[duration]",
@@ -527,7 +533,8 @@
527533
}
528534
}
529535
}
530-
}
536+
},
537+
"type": "snapshot"
531538
},
532539
"timestamp": "[ts]",
533540
"duration": "[duration]",
@@ -604,7 +611,8 @@
604611
}
605612
}
606613
}
607-
}
614+
},
615+
"type": "snapshot"
608616
},
609617
"timestamp": "[ts]",
610618
"duration": "[duration]",
@@ -682,7 +690,8 @@
682690
}
683691
}
684692
}
685-
}
693+
},
694+
"type": "snapshot"
686695
},
687696
"timestamp": "[ts]",
688697
"duration": "[duration]",
@@ -759,7 +768,8 @@
759768
}
760769
}
761770
}
762-
}
771+
},
772+
"type": "snapshot"
763773
},
764774
"timestamp": "[ts]",
765775
"duration": "[duration]",

pkg/dyninst/testdata/decoded/sample/testAnyPtr.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
}
6666
}
6767
}
68-
}
68+
},
69+
"type": "snapshot"
6970
},
7071
"timestamp": "[ts]",
7172
"duration": "[duration]",
@@ -138,7 +139,8 @@
138139
}
139140
}
140141
}
141-
}
142+
},
143+
"type": "snapshot"
142144
},
143145
"timestamp": "[ts]",
144146
"duration": "[duration]",
@@ -216,7 +218,8 @@
216218
}
217219
}
218220
}
219-
}
221+
},
222+
"type": "snapshot"
220223
},
221224
"timestamp": "[ts]",
222225
"duration": "[duration]",
@@ -294,7 +297,8 @@
294297
}
295298
}
296299
}
297-
}
300+
},
301+
"type": "snapshot"
298302
},
299303
"timestamp": "[ts]",
300304
"duration": "[duration]",
@@ -378,7 +382,8 @@
378382
}
379383
}
380384
}
381-
}
385+
},
386+
"type": "snapshot"
382387
},
383388
"timestamp": "[ts]",
384389
"duration": "[duration]",
@@ -468,7 +473,8 @@
468473
}
469474
}
470475
}
471-
}
476+
},
477+
"type": "snapshot"
472478
},
473479
"timestamp": "[ts]",
474480
"duration": "[duration]",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy