-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add Commented Out Code for Azure Native Monitoring #464
base: main
Are you sure you want to change the base?
Changes from 3 commits
686a984
955c311
4c11773
feb068b
84614cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,14 @@ | |
|
||
var launchProfileName = ShouldUseHttpForEndpoints() ? "http" : "https"; | ||
|
||
// To configure Azure Monitor Application Insights, add the following: | ||
// var insights = builder.AddConnectionString("myInsightsResource", "APPLICATIONINSIGHTS_CONNECTION_STRING"); | ||
// You also need to add .WithReference(insights) to each service that should be monitored. | ||
|
||
// Services | ||
var identityApi = builder.AddProject<Projects.Identity_API>("identity-api", launchProfileName) | ||
.WithExternalHttpEndpoints() | ||
// .WithReference(insights) // Sample reference to Azure Monitor Application Insights. Copy/paste for each service. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was going to add an overload to have a conditional reference, but it already seems to be there, so the following could be added to each app and not need to be commented out. It should silently ignore it if the resource is null. .WithReference(appInsights,null,true); @mitchdenny - It turns out this doesn't work as the resource parameter isn't nullable. Is there a cleaner workaround? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just use a conditional? I'm not sure we want to invent a new API for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mitchdenny conditionals don't fit nicely into the chained builder pattern, unless there is something I don't know? |
||
.WithReference(identityDb); | ||
|
||
var identityEndpoint = identityApi.GetEndpoint(launchProfileName); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be replaced with a conditional such as