File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ class SpanStatsEncoder extends AgentEncoder {
9595 }
9696
9797 _encode ( bytes , stats ) {
98- this . _encodeMapPrefix ( bytes , 8 )
98+ this . _encodeMapPrefix ( bytes , stats . ProcessTags ? 9 : 8 )
9999
100100 this . _encodeString ( bytes , 'Hostname' )
101101 this . _encodeString ( bytes , stats . Hostname )
@@ -123,6 +123,11 @@ class SpanStatsEncoder extends AgentEncoder {
123123
124124 this . _encodeString ( bytes , 'Sequence' )
125125 this . _encodeLong ( bytes , stats . Sequence )
126+
127+ if ( stats . ProcessTags ) {
128+ this . _encodeString ( bytes , 'ProcessTags' )
129+ this . _encodeString ( bytes , stats . ProcessTags )
130+ }
126131 }
127132}
128133
Original file line number Diff line number Diff line change @@ -66,8 +66,7 @@ module.exports.DYNAMIC_INSTRUMENTATION_FIELD_NAME = 'process_tags'
6666module . exports . TELEMETRY_FIELD_NAME = 'process_tags'
6767module . exports . REMOTE_CONFIG_FIELD_NAME = 'process_tags'
6868module . exports . CRASH_TRACKING_FIELD_NAME = 'process_tags'
69-
70- // TODO: CLIENT_TRACE_STATISTICS_FIELD_NAME process_tags
69+ module . exports . CLIENT_TRACE_STATISTICS_FIELD_NAME = 'ProcessTags'
7170
7271/**
7372 * Sanitize a process tag value
Original file line number Diff line number Diff line change 11'use strict'
22
3- const os = require ( 'os' )
3+ const os = require ( 'node: os' )
44const pkg = require ( '../../../package.json' )
55
66const { LogCollapsingLowestDenseDDSketch } = require ( '../../../vendor/dist/@datadog/sketches-js' )
@@ -13,6 +13,7 @@ const {
1313} = require ( '../../../ext/tags' )
1414const { ORIGIN_KEY , TOP_LEVEL_KEY } = require ( './constants' )
1515const { version } = require ( './pkg' )
16+ const processTags = require ( './process-tags' )
1617
1718const { SpanStatsExporter } = require ( './exporters/span-stats' )
1819
@@ -176,7 +177,8 @@ class SpanStatsProcessor {
176177 Lang : 'javascript' ,
177178 TracerVersion : pkg . version ,
178179 RuntimeID : this . tags [ 'runtime-id' ] ,
179- Sequence : ++ this . sequence
180+ Sequence : ++ this . sequence ,
181+ ProcessTags : processTags . serialized
180182 } )
181183 }
182184
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const {
1717 DEFAULT_SPAN_NAME ,
1818 DEFAULT_SERVICE_NAME
1919} = require ( '../../src/encode/tags-processors' )
20+ const processTags = require ( '../../src/process-tags' )
2021
2122describe ( 'span-stats-encode' , ( ) => {
2223 let encoder
@@ -71,7 +72,8 @@ describe('span-stats-encode', () => {
7172 Lang : 'javascript' ,
7273 TracerVersion : '1.2.3' ,
7374 RuntimeID : 'some-runtime-id' ,
74- Sequence : 1
75+ Sequence : 1 ,
76+ ProcessTags : processTags . serialized
7577 }
7678 } )
7779
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const {
2424 DEFAULT_SPAN_NAME ,
2525 DEFAULT_SERVICE_NAME
2626} = require ( '../src/encode/tags-processors' )
27+ const processTags = require ( '../src/process-tags' )
2728
2829// Mock spans
2930const basicSpan = {
@@ -388,7 +389,8 @@ describe('SpanStatsProcessor', () => {
388389 Lang : 'javascript' ,
389390 TracerVersion : pkg . version ,
390391 RuntimeID : processor . tags [ 'runtime-id' ] ,
391- Sequence : processor . sequence
392+ Sequence : processor . sequence ,
393+ ProcessTags : processTags . serialized
392394 } ) )
393395 } )
394396
@@ -406,7 +408,8 @@ describe('SpanStatsProcessor', () => {
406408 Lang : 'javascript' ,
407409 TracerVersion : pkg . version ,
408410 RuntimeID : processor . tags [ 'runtime-id' ] ,
409- Sequence : processor . sequence
411+ Sequence : processor . sequence ,
412+ ProcessTags : processTags . serialized
410413 } ) )
411414 } )
412415} )
You can’t perform that action at this time.
0 commit comments