Skip to content

Commit

Permalink
add reset stream event
Browse files Browse the repository at this point in the history
  • Loading branch information
rochdev committed Apr 25, 2024
1 parent 56b8e17 commit 1c5ca91
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/dd-trace/src/collector/encoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const SOFT_LIMIT = 8 * 1024 * 1024 // 8MB
const { DD_TRACE_COLLECTOR_DEBUG } = process.env

const eventTypes = {
RESET: 0,
PROCESS_INFO: 129,
START_SEGMENT: 130,
START_SPAN: 131,
Expand Down Expand Up @@ -44,6 +45,8 @@ class Encoder {
this._stringBytes = new Chunk()
this._reset()

this.encodeProcessInfo()

this.setUrl(url || new URL(format({
protocol: 'http:',
hostname: hostname || 'localhost',
Expand All @@ -63,6 +66,10 @@ class Encoder {
this.encodeConfig({ host })
}

encodeReset () {
this._encodeUnsigned(this._eventBytes, eventTypes.RESET)
}

encodeConfig (options) {
const bytes = this._eventBytes

Expand Down Expand Up @@ -268,7 +275,7 @@ class Encoder {
'': 0
}

this.encodeProcessInfo()
this.encodeReset(this._eventBytes)
}

_encodeFixArray (bytes, size = 0) {
Expand Down

0 comments on commit 1c5ca91

Please sign in to comment.