<PackageReference Include="Azure.Monitor.OpenTelemetry.Exporter" Version="1.8.0" />

Azure.Monitor.OpenTelemetry.Exporter.Internals.StringExtensions

static class StringExtensions
public static string Truncate(this string input, int maxLength)

This method will truncate a string if that string exceeds a specified max length.