Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
9a80cbf
read container tags hash from agent
vandonr Dec 2, 2025
661e5db
[IAST] Use recursive_mutex instead of CS and mutex (#7890)
daniel-romano-DD Dec 3, 2025
d565d21
make ContainerMetadata an instance class
vandonr Dec 3, 2025
1ad4b02
use constant in tests
vandonr Dec 3, 2025
37a3ac1
adapt code to instance container metadata
vandonr Dec 4, 2025
c93c3a9
Merge remote-tracking branch 'origin/master' into vandonr/process3
vandonr Jan 5, 2026
66630ec
use local instance
vandonr Jan 5, 2026
dcb297a
nit
vandonr Jan 5, 2026
653a3a5
fix integration tests
vandonr Jan 5, 2026
4fd01fa
add container tags hash to DBM queries (if enabled)
vandonr Jan 14, 2026
d9abd75
use volatile read/write
vandonr Jan 19, 2026
a5f3f8d
use collection expression
vandonr Jan 19, 2026
c18fc65
add container ID header to MinimalAgentHeaderHelper
vandonr Jan 19, 2026
4ca4fdf
Merge remote-tracking branch 'origin/master' into vandonr/process3
vandonr Jan 19, 2026
fdaf436
Merge branch 'vandonr/process3' into vandonr/process2
vandonr Jan 21, 2026
043c8b6
add a class for basehash
vandonr Jan 21, 2026
beb1980
use base hash
vandonr Jan 21, 2026
a75fa60
rename configuration key (I missed the prefix)
vandonr Jan 28, 2026
18f4461
Merge remote-tracking branch 'origin/master' into vandonr/process2
vandonr Feb 4, 2026
7a738b7
fix merge
vandonr Feb 4, 2026
8ace897
add config to json
vandonr Feb 4, 2026
92e4c6e
Merge remote-tracking branch 'origin/master' into vandonr/process2
vandonr Mar 10, 2026
121cae0
remove files that were removed upstream
vandonr Mar 12, 2026
57d31bb
fix nullability && centralize config check
vandonr Mar 12, 2026
3d5ed34
fix test
vandonr Mar 16, 2026
2161f1f
clean imports in adonet instrumentation
vandonr Mar 16, 2026
2f0eeb2
nits
vandonr Mar 16, 2026
1d2679c
Merge remote-tracking branch 'origin/master' into vandonr/process2
vandonr Mar 16, 2026
3d04aad
replace static init with getter init
vandonr Mar 17, 2026
6af872d
rename basehash for clarity
vandonr Mar 17, 2026
d81eb71
apply the same changes to container metadata as in the DSM PR
vandonr Mar 17, 2026
335479d
exclude test that is specific to netcore
vandonr Mar 17, 2026
747be87
Merge remote-tracking branch 'origin/master' into vandonr/process2
vandonr Mar 23, 2026
a89cb3f
move tags hash to serviceremapping hash, make it non-static, feed it …
vandonr Mar 24, 2026
d3c5d7f
reduce number of modified files
vandonr Mar 24, 2026
900ac90
undo some autoformating
vandonr Mar 24, 2026
f1c304e
use url-safe b64
vandonr Mar 24, 2026
91dc0c7
allow SRH injection into tracerManagerFactory
vandonr Mar 24, 2026
44c94a7
fix itest build
vandonr Mar 24, 2026
1c23065
address comments
vandonr Mar 25, 2026
d84c674
move setting check up one call in DbScopeFactory
vandonr Mar 25, 2026
65b181a
add tests to the hash class, and change ctor param to ease testing
vandonr Mar 25, 2026
e1eac20
mini optim: cut only one =
vandonr Mar 25, 2026
e67176d
replace range with slice
vandonr Mar 25, 2026
8fed285
little fixes
vandonr Mar 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions tracer/src/Datadog.Trace/BaseHash.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// <copyright file="BaseHash.cs" company="Datadog">
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
// </copyright>

#nullable enable

using System;
using System.Threading;
using Datadog.Trace.PlatformHelpers;
using Datadog.Trace.Util;

namespace Datadog.Trace;

/// <summary>
/// This class is a container for the "base hash", a hash of process tags and container tags.
/// Used by DBM to retrieve all the tag values from the spans, from just a single parameter (this hash),
/// Used by DSM in the pathway to identify different sources that could have been service-remapped
/// </summary>
internal static class BaseHash
{
/// <summary>
/// Gets the base64 representation of the hash
/// </summary>
public static string B64Value
{
get => Volatile.Read(ref field);
private set => Volatile.Write(ref field, value);
}

= Recompute(ProcessTags.SerializedTags, ContainerMetadata.Instance.ContainerTagsHash);

public static string Recompute(string processTags, string? containerTagsHash)
{
var hash = FnvHash64.GenerateHash(processTags, FnvHash64.Version.V1);
if (containerTagsHash != null)
{
hash = FnvHash64.GenerateHash(containerTagsHash, FnvHash64.Version.V1, hash);
}

return B64Value = Convert.ToBase64String(BitConverter.GetBytes(hash));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Data;
using System.Threading;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -28,7 +29,7 @@ public sealed class CommandExecuteNonQueryAsyncIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance, CancellationToken cancellationToken)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -26,7 +27,7 @@ public sealed class CommandExecuteNonQueryIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -28,7 +29,7 @@ public sealed class CommandExecuteNonQueryWithBehaviorIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget, TBehavior>(TTarget instance, TBehavior commandBehavior)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -26,7 +27,7 @@ public sealed class CommandExecuteReaderAsyncIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -26,7 +27,7 @@ public sealed class CommandExecuteReaderIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Data;
using System.Threading;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -31,7 +32,7 @@ public sealed class CommandExecuteReaderWithBehaviorAndCancellationAsyncIntegrat
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget, TBehavior>(TTarget instance, TBehavior commandBehavior, CancellationToken cancellationToken)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -28,7 +29,7 @@ public sealed class CommandExecuteReaderWithBehaviorAsyncIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget, TBehavior>(TTarget instance, TBehavior commandBehavior)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -29,7 +30,7 @@ public sealed class CommandExecuteReaderWithBehaviorIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget, TBehavior>(TTarget instance, TBehavior commandBehavior)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Data;
using System.Threading;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -28,7 +29,7 @@ public sealed class CommandExecuteReaderWithCancellationAsyncIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance, CancellationToken cancellationToken)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Data;
using System.Threading;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -28,7 +29,7 @@ public sealed class CommandExecuteScalarAsyncIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance, CancellationToken cancellationToken)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -26,7 +27,7 @@ public sealed class CommandExecuteScalarIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget>(TTarget instance)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.ComponentModel;
using System.Data;
using Datadog.Trace.ClrProfiler.CallTarget;
using Datadog.Trace.PlatformHelpers;

namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AdoNet
{
Expand All @@ -28,7 +29,7 @@ public sealed class CommandExecuteScalarWithBehaviorIntegration
/// <returns>Calltarget state value</returns>
internal static CallTargetState OnMethodBegin<TTarget, TBehavior>(TTarget instance, TBehavior commandBehavior)
{
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance));
return new CallTargetState(DbScopeFactory.Cache<TTarget>.CreateDbCommandScope(Tracer.Instance, (IDbCommand)instance, BaseHash.B64Value));
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Datadog.Trace.Configuration;
using Datadog.Trace.DatabaseMonitoring;
using Datadog.Trace.Logging;
using Datadog.Trace.PlatformHelpers;
using Datadog.Trace.Tagging;
using Datadog.Trace.Util;

Expand All @@ -24,7 +25,7 @@ internal static class DbScopeFactory
private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(DbScopeFactory));
private static bool _dbCommandCachingLogged = false;

private static Scope? CreateDbCommandScope(Tracer tracer, IDbCommand command, IntegrationId integrationId, string dbType, string operationName, string serviceName, ref DbCommandCache.TagsCacheItem tagsFromConnectionString)
private static Scope? CreateDbCommandScope(Tracer tracer, IDbCommand command, IntegrationId integrationId, string dbType, string operationName, string serviceName, ref DbCommandCache.TagsCacheItem tagsFromConnectionString, string? baseHash)
{
var perTraceSettings = tracer.CurrentTraceSettings;
if (!perTraceSettings.Settings.IsIntegrationEnabled(integrationId) || !perTraceSettings.Settings.IsIntegrationEnabled(IntegrationId.AdoNet))
Expand Down Expand Up @@ -102,9 +103,14 @@ internal static class DbScopeFactory
}
else
{
// PropagateDataViaComment (service) - this injects varius trace information as a comment in the query
if (tracer.Settings.DbmInjectSqlBasehash && !string.IsNullOrEmpty(baseHash))
{
tags.BaseHash = baseHash;
}

// PropagateDataViaComment (service) - this injects various trace information as a comment in the query
// PropagateDataViaContext (full) - this makes a special set context_info for Microsoft SQL Server (nothing else supported)
var traceParentInjectedInComment = DatabaseMonitoringPropagator.PropagateDataViaComment(tracer.Settings.DbmPropagationMode, integrationId, command, tracer.DefaultServiceName, tagsFromConnectionString.DbName, tagsFromConnectionString.OutHost, scope.Span, tracer.Settings.InjectContextIntoStoredProceduresEnabled);
var traceParentInjectedInComment = DatabaseMonitoringPropagator.PropagateDataViaComment(tracer.Settings.DbmPropagationMode, integrationId, command, tracer.DefaultServiceName, tagsFromConnectionString.DbName, tagsFromConnectionString.OutHost, scope.Span, tracer.Settings.InjectContextIntoStoredProceduresEnabled, tracer.Settings.DbmInjectSqlBasehash ? baseHash : null);
// try context injection only after comment injection, so that if it fails, we still have service level propagation
var traceParentInjectedInContext = DatabaseMonitoringPropagator.PropagateDataViaContext(tracer.Settings.DbmPropagationMode, integrationId, command, scope.Span);

Expand Down Expand Up @@ -255,7 +261,7 @@ static Cache()
}
}

public static Scope? CreateDbCommandScope(Tracer tracer, IDbCommand command)
public static Scope? CreateDbCommandScope(Tracer tracer, IDbCommand command, string? baseHash)
{
var commandType = command.GetType();

Expand All @@ -271,7 +277,8 @@ static Cache()
dbType: DbTypeName,
operationName: OperationName,
serviceName: GetServiceName(tracer, DbTypeName),
tagsFromConnectionString: ref tagsFromConnectionString);
ref tagsFromConnectionString,
baseHash);
}

// if command.GetType() != typeof(TCommand), we are probably instrumenting a method
Expand All @@ -287,7 +294,8 @@ static Cache()
dbType: dbTypeName,
operationName: operationName,
serviceName: GetServiceName(tracer, dbTypeName),
tagsFromConnectionString: ref tagsFromConnectionString);
ref tagsFromConnectionString,
baseHash);
}

return null;
Expand Down
10 changes: 10 additions & 0 deletions tracer/src/Datadog.Trace/Configuration/TracerSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,10 @@ not null when string.Equals(value, "otlp", StringComparison.OrdinalIgnoreCase) =
converter: x => ToDbmPropagationInput(x) ?? ParsingResult<DbmPropagationLevel>.Failure(),
validator: null);

DbmInjectSqlBasehash = config
.WithKeys(ConfigurationKeys.DbmInjectSqlBasehash)
.AsBool(false);

RemoteConfigurationEnabled = config.WithKeys(ConfigurationKeys.Rcm.RemoteConfigurationEnabled).AsBool(true);

TraceId128BitGenerationEnabled = config
Expand Down Expand Up @@ -1200,6 +1204,12 @@ not null when string.Equals(value, "otlp", StringComparison.OrdinalIgnoreCase) =
/// </summary>
internal DbmPropagationLevel DbmPropagationMode { get; }

/// <summary>
/// Gets a value indicating whether the tracer should inject Base Hash in SQL Comments.
/// Default value is false (disabled).
/// </summary>
internal bool DbmInjectSqlBasehash { get; }

/// <summary>
/// Gets a value indicating whether the tracer will generate 128-bit trace ids
/// instead of 64-bits trace ids.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,15 @@ supportedConfigurations:
Configuration key for setting DBM propagation mode
Default value is disabled, expected values are either: disabled, service or full
<seealso cref="Datadog.Trace.Configuration.TracerSettings.DbmPropagationMode"/>
DD_DBM_INJECT_SQL_BASEHASH:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh this configuration key should end with _ENABLED so it should be something like DD_DBM_SQL_BASEHASH_INJECTION_ENABLED. If this ship hasn't already sailed in other languages, can we please fix it 🙏 🥺

- implementation: A
type: boolean
default: 'false'
const_name: DbmInjectSqlBasehash
documentation: |-
Configuration key for enabling or disabling the injection of Base Hash in SQL Comments.
Default value is false (disabled).
<seealso cref="Datadog.Trace.Configuration.TracerSettings.DbmInjectSqlBasehash"/>
DD_DIAGNOSTIC_SOURCE_ENABLED:
- implementation: A
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Threading;
using Datadog.Trace.Configuration;
using Datadog.Trace.Logging;
using Datadog.Trace.PlatformHelpers;
using Datadog.Trace.Propagators;
using Datadog.Trace.Tagging;
using Datadog.Trace.Util;
Expand All @@ -28,6 +29,7 @@ internal static class DatabaseMonitoringPropagator
private const string SqlCommentOuthost = "ddh";
private const string SqlCommentVersion = "ddpv";
private const string SqlCommentEnv = "dde";
private const string SqlCommentBaseHash = "ddsh";
internal const string DbmPrefix = $"/*{SqlCommentSpanService}='";
private const string ContextInfoParameterName = "@dd_trace_context";
internal const string SetContextCommand = $"set context_info {ContextInfoParameterName}";
Expand All @@ -41,7 +43,8 @@ internal static class DatabaseMonitoringPropagator
private static int _remainingDirectionErrorLogs = 100;
private static int _remainingQuoteErrorLogs = 100;

internal static bool PropagateDataViaComment(DbmPropagationLevel propagationLevel, IntegrationId integrationId, IDbCommand command, string configuredServiceName, string? dbName, string? outhost, Span span, bool injectStoredProcedure)
// baseHash should be null if hash injection is disabled, config is not checked in this method
internal static bool PropagateDataViaComment(DbmPropagationLevel propagationLevel, IntegrationId integrationId, IDbCommand command, string configuredServiceName, string? dbName, string? outhost, Span span, bool injectStoredProcedure, string? baseHash)
{
if (integrationId is not (IntegrationId.MySql or IntegrationId.Npgsql or IntegrationId.SqlClient or IntegrationId.Oracle) ||
propagationLevel is not (DbmPropagationLevel.Service or DbmPropagationLevel.Full))
Expand Down Expand Up @@ -103,6 +106,11 @@ propagationLevel is not (DbmPropagationLevel.Service or DbmPropagationLevel.Full
propagatorStringBuilder.Append(',').Append(SqlCommentVersion).Append("='").Append(Uri.EscapeDataString(versionTag)).Append('\'');
}

if (!string.IsNullOrEmpty(baseHash))
{
propagatorStringBuilder.Append(',').Append(SqlCommentBaseHash).Append("='").Append(Uri.EscapeDataString(baseHash)).Append('\'');
}

var traceParentInjected = false;
// For SqlServer & Oracle we don't inject the traceparent to avoid affecting performance, since those DBs generate a new plan for any query changes
if (propagationLevel == DbmPropagationLevel.Full
Expand Down
Loading
Loading