Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AzureMonitorExporter] cleanup todos (part1) #37913

Merged
merged 1 commit into from
Jul 28, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void Configure(AzureMonitorOptions options)

try
{
// TODO: should we replace this with IConfiguration?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better, we read it from IConfiguration in distro. Better to address it before GA.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets prioritize this for next week!

string connectionString = Environment.GetEnvironmentVariable(ConnectionStringEnvironmentVariable);

if (!string.IsNullOrWhiteSpace(connectionString))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ internal static class ArrayExtensions
StringBuilder sb = new(input.Length);
foreach (var item in input)
{
// TODO: Consider changing it to JSon array.
if (item != null)
{
sb.Append(item);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ private static ApplicationInsightsRestClient InitializeRestClient(AzureMonitorEx
}
catch (Exception ex)
{
// TODO:
// Remove this when we add an option to disable offline storage.
// So if someone opts in for storage and we cannot initialize, we can throw.
// Change needed on persistent storage side to throw if not able to create storage directory.
// TODO: Should we throw if customer has opted for storage?
AzureMonitorExporterEventSource.Log.FailedToInitializePersistentStorage(connectionVars.InstrumentationKey, ex);

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ internal static class ResourceExtensions
}

// TODO: Check if service.name as unknown_service should be sent.
// (2023-07) we need to drop the "unknown_service."
if (serviceName != null && serviceNamespace != null)
{
azureMonitorResource.RoleName = string.Concat(serviceNamespace, "/", serviceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public override void OnEnd(Activity activity)
}

// TODO: other activity kinds
// (2023-07) fix before GA
}

private void ReportRequestDurationMetric(Activity activity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ internal AzureMonitorStatsbeat(ConnectionVars connectionStringVars, IPlatform pl

// Configure for attach statsbeat which has collection
// schedule of 24 hrs == 86400000 milliseconds.
// TODO: Follow up in spec to confirm the behavior
// in case if the app exits before 24hrs duration.
var exporterOptions = new AzureMonitorExporterOptions
{
DisableOfflineStorage = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public void VerifyExceptionWithinActivity()
// ASSERT
Assert.True(telemetryItems.Any(), "Unit test failed to collect telemetry.");
this.telemetryOutput.Write(telemetryItems);
var activityTelemetryItem = telemetryItems.First(x => x.Name == "RemoteDependency"); // TODO: Change to Single(). Still investigating random duplicate export which only reproduces on build server.
var activityTelemetryItem = telemetryItems.First(x => x.Name == "RemoteDependency");

TelemetryItemValidationHelper.AssertActivity_As_DependencyTelemetry(
telemetryItem: activityTelemetryItem,
Expand Down