Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 14 additions & 0 deletions tracer/build/_build/UpdateVendors/VendoredDependency.cs
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,20 @@ private static string ApplyStatsdClientTweaks(string filePath, string content)
"Task.Factory.StartNew(() => Dequeue(), CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default)");
}

if (normalizedPath.EndsWith("StatsdConfig.cs", StringComparison.OrdinalIgnoreCase))
{
// Upstream raised these defaults (512/2048) after 6.0.0 in dogstatsd-csharp-client#170,
// so bump to match them. 1432 keeps a UDP datagram inside a standard 1500-byte MTU, and
// 8192 matches the agent's dogstatsd_buffer_size default (its max packet size).
content = content.Replace(
"public const int DefaultStatsdMaxUDPPacketSize = 512;",
"public const int DefaultStatsdMaxUDPPacketSize = 1432;");

content = content.Replace(
"public int StatsdMaxUnixDomainSocketPacketSize { get; set; } = 2048;",
"public int StatsdMaxUnixDomainSocketPacketSize { get; set; } = 8192;");
}

return content;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal class StatsdConfig
/// <summary>
/// The default UDP maximum packet size.
/// </summary>
public const int DefaultStatsdMaxUDPPacketSize = 512;
public const int DefaultStatsdMaxUDPPacketSize = 1432;

/// <summary>
/// The name of the environment variable defining the global tags to be applied to every metric, event, and service check.
Expand Down Expand Up @@ -97,7 +97,7 @@ public StatsdConfig()
/// Gets or sets the maximum Unix domain socket packet size.
/// </summary>
/// <value>The maximum Unix domain socket packet size.</value>
public int StatsdMaxUnixDomainSocketPacketSize { get; set; } = 2048;
public int StatsdMaxUnixDomainSocketPacketSize { get; set; } = 8192;

/// <summary>
/// Gets or sets a value indicating whether we truncate the metric if it is too long.
Expand Down
3 changes: 2 additions & 1 deletion tracer/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,8 @@ private void HandleUdsStats()
{
try
{
var bytesReceived = new byte[0x1000];
// Must be at least StatsdMaxUnixDomainSocketPacketSize
var bytesReceived = new byte[0x2000];
// Connectionless protocol doesn't need Accept, Receive will block until we get something
var byteCount = _udsStatsSocket.Receive(bytesReceived);
var stats = Encoding.UTF8.GetString(bytesReceived, 0, byteCount);
Expand Down
Loading