TelemetryClient.FlushAsync(CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Asynchronously Flushes the in-memory buffer and any metrics being pre-aggregated.
public System.Threading.Tasks.Task<bool> FlushAsync (System.Threading.CancellationToken cancellationToken);
member this.FlushAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<bool>
Public Function FlushAsync (cancellationToken As CancellationToken) As Task(Of Boolean)
Parameters
- cancellationToken
- CancellationToken
Returns
Returns true when telemetry data is transferred out of process (application insights server or local storage) and are emitted before the flush invocation. Returns false when transfer of telemetry data to server has failed with non-retriable http status. FlushAsync on InMemoryChannel always returns true, as the channel offers minimal reliability guarantees and doesn't retry sending telemetry after a failure.
Remarks
Applies to
Azure SDK for .NET