protected override async Task WorkLoopIteration() { if (!_getCloudMetadata) { var cloud = await _cloudMetadataProviderCollection.GetMetadataAsync().ConfigureAwait(false); if (cloud != null) { _metadata.Cloud = cloud; } _getCloudMetadata = true; } if (!_getApmServerVersion && _apmServerInfo?.Version is null) { await ApmServerInfoProvider.FillApmServerInfo(_apmServerInfo, _logger, _configSnapshot, HttpClient).ConfigureAwait(false); _getApmServerVersion = true; } var batch = await ReceiveBatchAsync().ConfigureAwait(false); await ProcessQueueItems(batch).ConfigureAwait(false); }
/// <summary> /// Runs on the background thread dedicated to sending data to APM Server. It's ok to block this thread. /// </summary> protected override void WorkLoopIteration() { if (!_getCloudMetadata) { var cloud = _cloudMetadataProviderCollection.GetMetadataAsync().ConfigureAwait(false).GetAwaiter().GetResult(); if (cloud != null) { _metadata.Cloud = cloud; } _getCloudMetadata = true; } if (!_getApmServerVersion && _apmServerInfo?.Version is null) { ApmServerInfoProvider.FillApmServerInfo(_apmServerInfo, _logger, _configuration, HttpClient, _serverInfoCallback) .ConfigureAwait(false) .GetAwaiter() .GetResult(); _getApmServerVersion = true; } var batch = ReceiveBatch(); if (batch != null) { ProcessQueueItems(batch); } }