Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Dec 19, 2023
1 parent 0f7805f commit 812ea70
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ private static void Run(Options options, string[] args)
builder.Services.AddHttpLogging(logging =>
{
logging.LoggingFields = HttpLoggingFields.RequestPropertiesAndHeaders | HttpLoggingFields.ResponsePropertiesAndHeaders;
logging.RequestHeaders.Add("X-Upstream-Base-Uri");
logging.RequestHeaders.Add("x-ms-faultinjector-response-option");
logging.RequestHeaders.Add(Utils.ResponseSelectionHeader);
logging.RequestHeaders.Add(Utils.UpstreamBaseUriHeader);
logging.RequestHeaders.Add("ETag");
logging.ResponseHeaders.Add("ETag");
});
Expand All @@ -66,20 +66,12 @@ private static void Run(Options options, string[] args)
}

builder.Logging.ClearProviders();

/*
alternative:
"Console": {
"IncludeScopes": true,
"TimestampFormat": "[yyyy-MM-dd HH:mm:ss.ffffzzzz] "
}
*/
builder.Logging.AddOpenTelemetry(o =>
{
o.SetResourceBuilder(ResourceBuilder.CreateEmpty());
o.IncludeFormattedMessage = false;
o.IncludeScopes = false;
o.ParseStateValues = true;
o.IncludeScopes = true;
// can add more exporters, e.g. ApplicationInsights
o.AddConsoleExporter();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"profiles": {
"Azure.Sdk.Tools.HttpFaultInjector": {
"commandName": "Project",
"launchBrowser": false,
"environmentVariables": {
"OTEL_SERVICE_NAME": "HttpFaultInjector",
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:7777;https://localhost:7778"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static class Utils
"Proxy-Connection",

// "X-Upstream-Base-Uri" in original request is used as the Base URI in the upstream request
"X-Upstream-Base-Uri",
UpstreamBaseUriHeader,
"Host",

ResponseSelectionHeader
Expand Down

0 comments on commit 812ea70

Please sign in to comment.