chore(internal): container tags support for DSM/DBM#15293
Conversation
|
|
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 245 ± 2 ms. The average import time from base is: 248 ± 2 ms. The import time difference between this PR and base is: -3.08 ± 0.09 ms. Import time breakdownThe following import paths have appeared:
|
Performance SLOsComparing candidate dubloom/container-back-propagation (9c139a9) with baseline main (c6edb37) 📈 Performance Regressions (3 suites)📈 iastaspects - 118/118✅ add_aspectTime: ✅ 17.624µs (SLO: <20.000µs 📉 -11.9%) vs baseline: 📈 +21.9% Memory: ✅ 42.802MB (SLO: <43.250MB 🟡 -1.0%) vs baseline: +4.8% ✅ add_inplace_aspectTime: ✅ 14.344µs (SLO: <20.000µs 📉 -28.3%) vs baseline: -0.8% Memory: ✅ 42.821MB (SLO: <43.250MB 🟡 -1.0%) vs baseline: +5.1% ✅ add_inplace_noaspectTime: ✅ 0.336µs (SLO: <10.000µs 📉 -96.6%) vs baseline: +0.2% Memory: ✅ 42.566MB (SLO: <43.500MB -2.1%) vs baseline: +4.6% ✅ add_noaspectTime: ✅ 0.547µs (SLO: <10.000µs 📉 -94.5%) vs baseline: +0.9% Memory: ✅ 42.782MB (SLO: <43.500MB 🟡 -1.7%) vs baseline: +4.8% ✅ bytearray_aspectTime: ✅ 17.175µs (SLO: <30.000µs 📉 -42.7%) vs baseline: -1.2% Memory: ✅ 43.037MB (SLO: <43.500MB 🟡 -1.1%) vs baseline: +5.0% ✅ bytearray_extend_aspectTime: ✅ 22.759µs (SLO: <30.000µs 📉 -24.1%) vs baseline: -0.7% Memory: ✅ 42.979MB (SLO: <43.500MB 🟡 -1.2%) vs baseline: +4.8% ✅ bytearray_extend_noaspectTime: ✅ 2.691µs (SLO: <10.000µs 📉 -73.1%) vs baseline: -0.5% Memory: ✅ 42.979MB (SLO: <43.500MB 🟡 -1.2%) vs baseline: +4.9% ✅ bytearray_noaspectTime: ✅ 1.437µs (SLO: <10.000µs 📉 -85.6%) vs baseline: -0.9% Memory: ✅ 42.821MB (SLO: <43.500MB 🟡 -1.6%) vs baseline: +5.0% ✅ bytes_aspectTime: ✅ 15.923µs (SLO: <20.000µs 📉 -20.4%) vs baseline: -1.2% Memory: ✅ 42.802MB (SLO: <43.500MB 🟡 -1.6%) vs baseline: +5.1% ✅ bytes_noaspectTime: ✅ 1.393µs (SLO: <10.000µs 📉 -86.1%) vs baseline: -1.1% Memory: ✅ 42.625MB (SLO: <43.500MB -2.0%) vs baseline: +4.8% ✅ bytesio_aspectTime: ✅ 52.709µs (SLO: <70.000µs 📉 -24.7%) vs baseline: -1.0% Memory: ✅ 42.998MB (SLO: <43.500MB 🟡 -1.2%) vs baseline: +4.9% ✅ bytesio_noaspectTime: ✅ 3.231µs (SLO: <10.000µs 📉 -67.7%) vs baseline: ~same Memory: ✅ 42.487MB (SLO: <43.500MB -2.3%) vs baseline: +3.7% ✅ capitalize_aspectTime: ✅ 14.096µs (SLO: <20.000µs 📉 -29.5%) vs baseline: -0.6% Memory: ✅ 42.920MB (SLO: <43.500MB 🟡 -1.3%) vs baseline: +4.8% ✅ capitalize_noaspectTime: ✅ 2.560µs (SLO: <10.000µs 📉 -74.4%) vs baseline: ~same Memory: ✅ 42.762MB (SLO: <43.500MB 🟡 -1.7%) vs baseline: +4.3% ✅ casefold_aspectTime: ✅ 14.188µs (SLO: <20.000µs 📉 -29.1%) vs baseline: -0.6% Memory: ✅ 43.018MB (SLO: <43.500MB 🟡 -1.1%) vs baseline: +4.9% ✅ casefold_noaspectTime: ✅ 3.101µs (SLO: <10.000µs 📉 -69.0%) vs baseline: -0.7% Memory: ✅ 42.802MB (SLO: <43.500MB 🟡 -1.6%) vs baseline: +4.5% ✅ decode_aspectTime: ✅ 15.042µs (SLO: <30.000µs 📉 -49.9%) vs baseline: +0.2% Memory: ✅ 42.546MB (SLO: <43.500MB -2.2%) vs baseline: +3.9% ✅ decode_noaspectTime: ✅ 1.568µs (SLO: <10.000µs 📉 -84.3%) vs baseline: ~same Memory: ✅ 42.684MB (SLO: <43.500MB 🟡 -1.9%) vs baseline: +4.0% ✅ encode_aspectTime: ✅ 17.706µs (SLO: <30.000µs 📉 -41.0%) vs baseline: 📈 +23.1% Memory: ✅ 42.762MB (SLO: <43.500MB 🟡 -1.7%) vs baseline: +4.3% ✅ encode_noaspectTime: ✅ 1.483µs (SLO: <10.000µs 📉 -85.2%) vs baseline: +0.8% Memory: ✅ 42.625MB (SLO: <43.500MB -2.0%) vs baseline: +4.8% ✅ format_aspectTime: ✅ 168.905µs (SLO: <200.000µs 📉 -15.5%) vs baseline: ~same Memory: ✅ 42.998MB (SLO: <43.250MB 🟡 -0.6%) vs baseline: +4.5% ✅ format_map_aspectTime: ✅ 188.489µs (SLO: <200.000µs -5.8%) vs baseline: -0.1% Memory: ✅ 43.195MB (SLO: <43.500MB 🟡 -0.7%) vs baseline: +5.2% ✅ format_map_noaspectTime: ✅ 3.757µs (SLO: <10.000µs 📉 -62.4%) vs baseline: -0.5% Memory: ✅ 42.605MB (SLO: <43.250MB 🟡 -1.5%) vs baseline: +4.1% ✅ format_noaspectTime: ✅ 3.065µs (SLO: <10.000µs 📉 -69.3%) vs baseline: -0.4% Memory: ✅ 42.664MB (SLO: <43.250MB 🟡 -1.4%) vs baseline: +3.9% ✅ index_aspectTime: ✅ 14.679µs (SLO: <20.000µs 📉 -26.6%) vs baseline: -1.3% Memory: ✅ 42.566MB (SLO: <43.250MB 🟡 -1.6%) vs baseline: +4.5% ✅ index_noaspectTime: ✅ 0.462µs (SLO: <10.000µs 📉 -95.4%) vs baseline: -0.2% Memory: ✅ 42.723MB (SLO: <43.500MB 🟡 -1.8%) vs baseline: +4.9% ✅ join_aspectTime: ✅ 16.426µs (SLO: <20.000µs 📉 -17.9%) vs baseline: +0.4% Memory: ✅ 42.605MB (SLO: <43.500MB -2.1%) vs baseline: +4.0% ✅ join_noaspectTime: ✅ 1.536µs (SLO: <10.000µs 📉 -84.6%) vs baseline: +0.1% Memory: ✅ 42.743MB (SLO: <43.250MB 🟡 -1.2%) vs baseline: +4.7% ✅ ljust_aspectTime: ✅ 20.059µs (SLO: <30.000µs 📉 -33.1%) vs baseline: -0.3% Memory: ✅ 42.821MB (SLO: <43.250MB 🟡 -1.0%) vs baseline: +5.0% ✅ ljust_noaspectTime: ✅ 2.651µs (SLO: <10.000µs 📉 -73.5%) vs baseline: -1.1% Memory: ✅ 42.723MB (SLO: <43.250MB 🟡 -1.2%) vs baseline: +4.3% ✅ lower_aspectTime: ✅ 17.109µs (SLO: <30.000µs 📉 -43.0%) vs baseline: -1.7% Memory: ✅ 42.782MB (SLO: <43.500MB 🟡 -1.7%) vs baseline: +4.9% ✅ lower_noaspectTime: ✅ 2.366µs (SLO: <10.000µs 📉 -76.3%) vs baseline: -1.8% Memory: ✅ 42.703MB (SLO: <43.250MB 🟡 -1.3%) vs baseline: +4.3% ✅ lstrip_aspectTime: ✅ 16.946µs (SLO: <20.000µs 📉 -15.3%) vs baseline: -0.5% Memory: ✅ 42.684MB (SLO: <43.250MB 🟡 -1.3%) vs baseline: +4.1% ✅ lstrip_noaspectTime: ✅ 1.848µs (SLO: <10.000µs 📉 -81.5%) vs baseline: -1.3% Memory: ✅ 42.861MB (SLO: <43.500MB 🟡 -1.5%) vs baseline: +4.4% ✅ modulo_aspectTime: ✅ 164.187µs (SLO: <200.000µs 📉 -17.9%) vs baseline: +0.3% Memory: ✅ 42.861MB (SLO: <43.500MB 🟡 -1.5%) vs baseline: +4.0% ✅ modulo_aspect_for_bytearray_bytearrayTime: ✅ 171.932µs (SLO: <200.000µs 📉 -14.0%) vs baseline: -0.5% Memory: ✅ 43.096MB (SLO: <43.500MB 🟡 -0.9%) vs baseline: +5.6% ✅ modulo_aspect_for_bytesTime: ✅ 166.193µs (SLO: <200.000µs 📉 -16.9%) vs baseline: ~same Memory: ✅ 43.136MB (SLO: <43.500MB 🟡 -0.8%) vs baseline: +4.9% ✅ modulo_aspect_for_bytes_bytearrayTime: ✅ 169.534µs (SLO: <200.000µs 📉 -15.2%) vs baseline: ~same Memory: ✅ 43.037MB (SLO: <43.500MB 🟡 -1.1%) vs baseline: +5.0% ✅ modulo_noaspectTime: ✅ 3.547µs (SLO: <10.000µs 📉 -64.5%) vs baseline: +0.3% Memory: ✅ 42.684MB (SLO: <43.500MB 🟡 -1.9%) vs baseline: +4.0% ✅ replace_aspectTime: ✅ 218.414µs (SLO: <300.000µs 📉 -27.2%) vs baseline: +4.0% Memory: ✅ 43.155MB (SLO: <44.000MB 🟡 -1.9%) vs baseline: +4.9% ✅ replace_noaspectTime: ✅ 2.834µs (SLO: <10.000µs 📉 -71.7%) vs baseline: -0.8% Memory: ✅ 42.939MB (SLO: <43.500MB 🟡 -1.3%) vs baseline: +4.8% ✅ repr_aspectTime: ✅ 1.425µs (SLO: <10.000µs 📉 -85.7%) vs baseline: +1.0% Memory: ✅ 42.900MB (SLO: <43.500MB 🟡 -1.4%) vs baseline: +5.6% ✅ repr_noaspectTime: ✅ 0.523µs (SLO: <10.000µs 📉 -94.8%) vs baseline: ~same Memory: ✅ 42.684MB (SLO: <43.500MB 🟡 -1.9%) vs baseline: +5.1% ✅ rstrip_aspectTime: ✅ 22.312µs (SLO: <30.000µs 📉 -25.6%) vs baseline: 📈 +21.8% Memory: ✅ 42.723MB (SLO: <43.500MB 🟡 -1.8%) vs baseline: +3.9% ✅ rstrip_noaspectTime: ✅ 1.909µs (SLO: <10.000µs 📉 -80.9%) vs baseline: +0.4% Memory: ✅ 42.703MB (SLO: <43.500MB 🟡 -1.8%) vs baseline: +3.9% ✅ slice_aspectTime: ✅ 15.307µs (SLO: <20.000µs 📉 -23.5%) vs baseline: -1.2% Memory: ✅ 42.723MB (SLO: <43.500MB 🟡 -1.8%) vs baseline: +5.3% ✅ slice_noaspectTime: ✅ 0.593µs (SLO: <10.000µs 📉 -94.1%) vs baseline: -0.3% Memory: ✅ 42.782MB (SLO: <43.500MB 🟡 -1.7%) vs baseline: +5.3% ✅ stringio_aspectTime: ✅ 51.668µs (SLO: <80.000µs 📉 -35.4%) vs baseline: -0.6% Memory: ✅ 43.077MB (SLO: <43.500MB 🟡 -1.0%) vs baseline: +5.1% ✅ stringio_noaspectTime: ✅ 3.609µs (SLO: <10.000µs 📉 -63.9%) vs baseline: +0.4% Memory: ✅ 42.644MB (SLO: <43.500MB 🟡 -2.0%) vs baseline: +3.9% ✅ strip_aspectTime: ✅ 16.941µs (SLO: <20.000µs 📉 -15.3%) vs baseline: -0.4% Memory: ✅ 42.703MB (SLO: <43.500MB 🟡 -1.8%) vs baseline: +4.4% ✅ strip_noaspectTime: ✅ 1.842µs (SLO: <10.000µs 📉 -81.6%) vs baseline: -1.2% Memory: ✅ 42.939MB (SLO: <43.500MB 🟡 -1.3%) vs baseline: +4.9% ✅ swapcase_aspectTime: ✅ 17.904µs (SLO: <30.000µs 📉 -40.3%) vs baseline: -0.1% Memory: ✅ 43.057MB (SLO: <43.500MB 🟡 -1.0%) vs baseline: +5.0% ✅ swapcase_noaspectTime: ✅ 2.769µs (SLO: <10.000µs 📉 -72.3%) vs baseline: -0.8% Memory: ✅ 42.743MB (SLO: <43.500MB 🟡 -1.7%) vs baseline: +4.3% ✅ title_aspectTime: ✅ 17.596µs (SLO: <20.000µs 📉 -12.0%) vs baseline: +0.2% Memory: ✅ 42.644MB (SLO: <43.000MB 🟡 -0.8%) vs baseline: +4.2% ✅ title_noaspectTime: ✅ 2.858µs (SLO: <10.000µs 📉 -71.4%) vs baseline: +7.7% Memory: ✅ 42.625MB (SLO: <43.500MB -2.0%) vs baseline: +4.1% ✅ translate_aspectTime: ✅ 19.759µs (SLO: <30.000µs 📉 -34.1%) vs baseline: +0.4% Memory: ✅ 43.057MB (SLO: <43.500MB 🟡 -1.0%) vs baseline: +5.0% ✅ translate_noaspectTime: ✅ 4.235µs (SLO: <10.000µs 📉 -57.7%) vs baseline: ~same Memory: ✅ 42.605MB (SLO: <43.500MB -2.1%) vs baseline: +3.9% ✅ upper_aspectTime: ✅ 17.358µs (SLO: <30.000µs 📉 -42.1%) vs baseline: +0.2% Memory: ✅ 42.644MB (SLO: <43.500MB 🟡 -2.0%) vs baseline: +4.7% ✅ upper_noaspectTime: ✅ 2.398µs (SLO: <10.000µs 📉 -76.0%) vs baseline: -0.4% Memory: ✅ 42.723MB (SLO: <43.500MB 🟡 -1.8%) vs baseline: +4.2% 📈 iastaspectsospath - 24/24✅ ospathbasename_aspectTime: ✅ 4.971µs (SLO: <10.000µs 📉 -50.3%) vs baseline: 📈 +22.8% Memory: ✅ 41.445MB (SLO: <43.500MB -4.7%) vs baseline: +5.0% ✅ ospathbasename_noaspectTime: ✅ 4.055µs (SLO: <10.000µs 📉 -59.5%) vs baseline: -0.5% Memory: ✅ 41.386MB (SLO: <43.500MB -4.9%) vs baseline: +4.8% ✅ ospathjoin_aspectTime: ✅ 5.987µs (SLO: <10.000µs 📉 -40.1%) vs baseline: ~same Memory: ✅ 41.425MB (SLO: <43.500MB -4.8%) vs baseline: +5.0% ✅ ospathjoin_noaspectTime: ✅ 6.054µs (SLO: <10.000µs 📉 -39.5%) vs baseline: -0.6% Memory: ✅ 41.465MB (SLO: <43.500MB -4.7%) vs baseline: +4.8% ✅ ospathnormcase_aspectTime: ✅ 3.340µs (SLO: <10.000µs 📉 -66.6%) vs baseline: -1.1% Memory: ✅ 41.406MB (SLO: <43.500MB -4.8%) vs baseline: +4.8% ✅ ospathnormcase_noaspectTime: ✅ 3.401µs (SLO: <10.000µs 📉 -66.0%) vs baseline: -1.5% Memory: ✅ 41.406MB (SLO: <43.500MB -4.8%) vs baseline: +4.7% ✅ ospathsplit_aspectTime: ✅ 4.653µs (SLO: <10.000µs 📉 -53.5%) vs baseline: -0.4% Memory: ✅ 41.465MB (SLO: <43.500MB -4.7%) vs baseline: +5.1% ✅ ospathsplit_noaspectTime: ✅ 4.774µs (SLO: <10.000µs 📉 -52.3%) vs baseline: +0.1% Memory: ✅ 41.445MB (SLO: <43.500MB -4.7%) vs baseline: +5.0% ✅ ospathsplitdrive_aspectTime: ✅ 3.573µs (SLO: <10.000µs 📉 -64.3%) vs baseline: +0.2% Memory: ✅ 41.425MB (SLO: <43.500MB -4.8%) vs baseline: +4.7% ✅ ospathsplitdrive_noaspectTime: ✅ 0.740µs (SLO: <10.000µs 📉 -92.6%) vs baseline: -0.9% Memory: ✅ 41.465MB (SLO: <43.500MB -4.7%) vs baseline: +4.9% ✅ ospathsplitext_aspectTime: ✅ 4.408µs (SLO: <10.000µs 📉 -55.9%) vs baseline: -0.4% Memory: ✅ 41.465MB (SLO: <43.500MB -4.7%) vs baseline: +4.8% ✅ ospathsplitext_noaspectTime: ✅ 4.440µs (SLO: <10.000µs 📉 -55.6%) vs baseline: +0.1% Memory: ✅ 41.465MB (SLO: <43.500MB -4.7%) vs baseline: +5.1% 📈 telemetryaddmetric - 30/30✅ 1-count-metric-1-timesTime: ✅ 3.338µs (SLO: <20.000µs 📉 -83.3%) vs baseline: 📈 +11.4% Memory: ✅ 34.819MB (SLO: <35.500MB 🟡 -1.9%) vs baseline: +4.6% ✅ 1-count-metrics-100-timesTime: ✅ 197.639µs (SLO: <220.000µs 📉 -10.2%) vs baseline: -2.2% Memory: ✅ 34.819MB (SLO: <35.500MB 🟡 -1.9%) vs baseline: +4.9% ✅ 1-distribution-metric-1-timesTime: ✅ 3.294µs (SLO: <20.000µs 📉 -83.5%) vs baseline: -1.0% Memory: ✅ 34.918MB (SLO: <35.500MB 🟡 -1.6%) vs baseline: +5.2% ✅ 1-distribution-metrics-100-timesTime: ✅ 214.049µs (SLO: <230.000µs -6.9%) vs baseline: -0.8% Memory: ✅ 34.859MB (SLO: <35.500MB 🟡 -1.8%) vs baseline: +4.7% ✅ 1-gauge-metric-1-timesTime: ✅ 2.169µs (SLO: <20.000µs 📉 -89.2%) vs baseline: -2.6% Memory: ✅ 34.937MB (SLO: <35.500MB 🟡 -1.6%) vs baseline: +5.1% ✅ 1-gauge-metrics-100-timesTime: ✅ 137.478µs (SLO: <150.000µs -8.3%) vs baseline: +0.2% Memory: ✅ 34.859MB (SLO: <35.500MB 🟡 -1.8%) vs baseline: +4.9% ✅ 1-rate-metric-1-timesTime: ✅ 3.099µs (SLO: <20.000µs 📉 -84.5%) vs baseline: -1.9% Memory: ✅ 34.898MB (SLO: <35.500MB 🟡 -1.7%) vs baseline: +5.0% ✅ 1-rate-metrics-100-timesTime: ✅ 211.750µs (SLO: <250.000µs 📉 -15.3%) vs baseline: -1.8% Memory: ✅ 34.819MB (SLO: <35.500MB 🟡 -1.9%) vs baseline: +4.7% ✅ 100-count-metrics-100-timesTime: ✅ 20.275ms (SLO: <22.000ms -7.8%) vs baseline: +2.0% Memory: ✅ 34.878MB (SLO: <35.500MB 🟡 -1.8%) vs baseline: +5.1% ✅ 100-distribution-metrics-100-timesTime: ✅ 2.238ms (SLO: <2.550ms 📉 -12.2%) vs baseline: +0.2% Memory: ✅ 34.780MB (SLO: <35.500MB -2.0%) vs baseline: +4.4% ✅ 100-gauge-metrics-100-timesTime: ✅ 1.408ms (SLO: <1.550ms -9.2%) vs baseline: ~same Memory: ✅ 34.859MB (SLO: <35.500MB 🟡 -1.8%) vs baseline: +4.7% ✅ 100-rate-metrics-100-timesTime: ✅ 2.219ms (SLO: <2.550ms 📉 -13.0%) vs baseline: +2.3% Memory: ✅ 34.918MB (SLO: <35.500MB 🟡 -1.6%) vs baseline: +5.1% ✅ flush-1-metricTime: ✅ 4.652µs (SLO: <20.000µs 📉 -76.7%) vs baseline: +3.0% Memory: ✅ 35.232MB (SLO: <35.500MB 🟡 -0.8%) vs baseline: +5.0% ✅ flush-100-metricsTime: ✅ 173.417µs (SLO: <250.000µs 📉 -30.6%) vs baseline: +0.2% Memory: ✅ 35.212MB (SLO: <35.500MB 🟡 -0.8%) vs baseline: +4.6% ✅ flush-1000-metricsTime: ✅ 2.171ms (SLO: <2.500ms 📉 -13.2%) vs baseline: ~same Memory: ✅ 36.019MB (SLO: <36.500MB 🟡 -1.3%) vs baseline: +4.7% 🟡 Near SLO Breach (14 suites)🟡 coreapiscenario - 10/10 (1 unstable)
|
brettlangdon
left a comment
There was a problem hiding this comment.
no release note needed for this?
mabdinur
left a comment
There was a problem hiding this comment.
Left some nits that do not block this change. Overall LGTM
This PR implements the container tags support for DSM/DBM as described in this [RFC](https://docs.google.com/document/d/15GtNOKGBCt6Dc-HsDNnMmCdZwhewFQx8yUlI9in5n3M/edit?pli=1&tab=t.0). Currently tracers communicate their containerID through a request http header, the trace-agent can propagate back the resulting identifying container hash in http header responses. We retrieve this container hash and add it as a field in the DBM comment used for context propagation and use it as the base hash for DSM. --------- Co-authored-by: Brett Langdon <[email protected]>
This PR implements the container tags support for DSM/DBM as described in this [RFC](https://docs.google.com/document/d/15GtNOKGBCt6Dc-HsDNnMmCdZwhewFQx8yUlI9in5n3M/edit?pli=1&tab=t.0). Currently tracers communicate their containerID through a request http header, the trace-agent can propagate back the resulting identifying container hash in http header responses. We retrieve this container hash and add it as a field in the DBM comment used for context propagation and use it as the base hash for DSM. --------- Co-authored-by: Brett Langdon <[email protected]>
## Summary of changes Add the ability to write the container tags hash to DBM queries + to the related span. The goal is that DBM would then query the spans bearing that hash, and then use the container tags on this (those) spans(s) to enrich the queries with it. This is controlled by a setting that is disabled by default, and would be enabled if propagation mode is "service" or greater see RFC: https://docs.google.com/document/d/15GtNOKGBCt6Dc-HsDNnMmCdZwhewFQx8yUlI9in5n3M related PR in python: DataDog/dd-trace-py#15293 ## Reason for change DBM and DSM propagate service context in outbound communications (SQL comments, message headers), but neither product has awareness of the container environment (e.g., `kube_cluster`, `namespace`, `pod_name`). Propagating full container tags is not feasible due to cardinality constraints (query cache invalidation in OracleDB/SQLServer, exponential pathway growth in DSM) and size limitations (64–128 bytes for DBM non-comment methods). This is needed for the **service renaming initiative** (defining services based on container names) and **APM primary tags** (container-based dimensions like Kubernetes cluster). The solution: the agent computes a hash of low-cardinality container tags and back-propagates it to the tracer, which includes it in outbound DBM/DSM communications. DBM then resolves the hash by correlating with APM spans that carry the same hash as a span tag. ## Implementation details - Add `BaseHash` static class that computes an FNV-64 hash of `ProcessTags.SerializedTags` combined with the container tags hash from the agent, encoded as base64 - Read the container tags hash from the Datadog Agent via `DiscoveryService`, stored in `ContainerMetadata.ContainerTagsHash` - `ContainerMetadata` converted from static to instance class (singleton via `ContainerMetadata.Instance`) to improve testability - `DatabaseMonitoringPropagator` injects the base hash into SQL comments (as `ddsh`) when `DD_DBM_INJECT_SQL_BASEHASH` is true - Add `_dd.dbm_container_tags_hash` span tag on `SqlTags` so DBM can correlate the hash back to the span's container tags - New config key `DD_DBM_INJECT_SQL_BASEHASH` (disabled by default), intended to be enabled when DBM propagation mode is `service` or higher - Add container ID header to `MinimalAgentHeaderHelper` for agent communication ## Test coverage Adding a test in DbScopeFactoryTests.cs forced me to inject the value from pretty high, which I find a bit "dirty", but at least we don't have to rely on global static instance in tests. ## Other details <!-- Fixes #{issue} --> <!--⚠️ Note: Where possible, please obtain 2 approvals prior to merging. Unless CODEOWNERS specifies otherwise, for external teams it is typically best to have one review from a team member, and one review from apm-dotnet. Trivial changes do not require 2 reviews. MergeQueue is NOT enabled in this repository. If you have write access to the repo, the PR has 1-2 approvals (see above), and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #apm-dotnet channel in Slack. --> --------- Co-authored-by: Daniel Romano <[email protected]> Co-authored-by: Andrew Lock <[email protected]>
This PR implements the container tags support for DSM/DBM as described in this RFC.
Currently tracers communicate their containerID through a request http header, the trace-agent can propagate back the resulting identifying container hash in http header responses.
We retrieve this container hash and add it as a field in the DBM comment used for context propagation and use it as the base hash for DSM.