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
3 changes: 2 additions & 1 deletion documentation/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,8 @@
"Cpu",
"Http",
"Logs",
"Metrics"
"Metrics",
"GcCollect"
],
"type": "string"
},
Expand Down
6 changes: 4 additions & 2 deletions documentation/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2093,13 +2093,15 @@
"Cpu",
"Http",
"Logs",
"Metrics"
"Metrics",
"GcCollect"
],
"enum": [
"Cpu",
"Http",
"Logs",
"Metrics"
"Metrics",
"GcCollect"
]
},
"EventPipeProvider": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Microsoft.Diagnostics.Monitoring.WebApi.Controllers
[ProducesResponseType(typeof(void), StatusCodes.Status401Unauthorized)]
public partial class DiagController : DiagnosticsControllerBase
{
private const TraceProfile DefaultTraceProfiles = TraceProfile.Cpu | TraceProfile.Http | TraceProfile.Metrics;
private const TraceProfile DefaultTraceProfiles = TraceProfile.Cpu | TraceProfile.Http | TraceProfile.Metrics | TraceProfile.GcCollect;

private readonly IOptions<DiagnosticPortOptions> _diagnosticPortOptions;
private readonly IOptions<CallStacksOptions> _callStacksOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public enum TraceProfile
Cpu = 0x1,
Http = 0x2,
Logs = 0x4,
Metrics = 0x8
Metrics = 0x8,
GcCollect = 0x10,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public static MonitoringSourceConfiguration GetTraceConfiguration(Models.TracePr

configurations.Add(new MetricSourceConfiguration(options.GetIntervalSeconds(), defaultProviders));
}
if (profile.HasFlag(Models.TraceProfile.GcCollect))
{
configurations.Add(new GcCollectConfiguration());
}

return new AggregateSourceConfiguration(configurations.ToArray());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public static IEnumerable<object[]> GetTfmsAndTraceProfiles()
yield return new object[] { tfm, TraceProfile.Metrics };
yield return new object[] { tfm, TraceProfile.Http };
yield return new object[] { tfm, TraceProfile.Cpu };
yield return new object[] { tfm, TraceProfile.GcCollect };
}
}

Expand Down