in src/Elastic.OpenTelemetry.Core/Configuration/Instrumentations/MetricInstrumentation.cs [15:34]
internal class MetricInstrumentations(IEnumerable<MetricInstrumentation> instrumentations) : HashSet<MetricInstrumentation>(instrumentations)
{
/// <summary>
/// All available <see cref="MetricInstrumentation"/> libraries.
/// </summary>
public static readonly MetricInstrumentations All = new([.. MetricInstrumentationExtensions.GetValues()]);
/// <inheritdoc cref="object.ToString"/>
public override string ToString()
{
if (Count == 0)
return "None";
if (Count == All.Count)
return "All";
if (All.Count - Count < All.Count)
return $"All Except: {string.Join(", ", All.Except(this).Select(i => i.ToStringFast()))}";
return string.Join(", ", this.Select(i => i.ToStringFast()));
}
}