You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a help needed for my implementation. As per a port the "HealthChecksDb" dbcontext has been made public and is now accessible to make changes at runtime. Below is my code setup. I am able to refresh the Configrations DbSet but the same does not reflect in the UI
Startup.cs ConfigureServices(......){
...
services.AddDbContext<APIHealthCheckContext>(options => options.UseInMemoryDatabase("HealthCheckMock"));//Local context to get the list of configured endpoints
services.AddDbContext<HealthChecksDb>(options => options.UseInMemoryDatabase("HealthCheckMock"));
services.AddHealthChecksUI(setupSettings:setup =>{ setup.SetEvaluationTimeInSeconds(300); setup.SetMinimumSecondsBetweenFailureNotifications(300);}).AddInMemoryStorage(options =>{ options.UseInMemoryDatabase("HealthCheckMock");});
...}
Startup.cs Configure(......){
...
app.UseHealthChecksUI(setup =>{ setup.UIPath ="/healthcheckdashboard-ui"; setup.ApiPath ="/healthcheckdashboard-api";});
...}
Controller
public ActionResult TrackEndpoints([FromQuery]stringApiVersion,[FromQuery]stringApiName){varendpoints= _processor.UpdateEndpoints(ApiVersion, ApiName);//Business layer which gets the endpoints based on the version and name filterif(endpoints?.Count >0){List<HealthCheckConfiguration>endpointsList=newList<HealthCheckConfiguration>();foreach(var endpoint in endpoints.ToList()){
endpointsList.Add(new HealthCheckConfiguration
{Name=string.Join(' ', endpoint.APIName, endpoint.Version),Uri= endpoint.BaseURL
});}
_context.Configurations.RemoveRange(_context.Configurations);
_context.SaveChangesAsync();
_context.Configurations.AddRangeAsync(endpointsList);
_context.SaveChangesAsync();return Redirect("/healthcheckdashboard-ui");}elsereturn NotFound("No API found based on the filters. Please resend");}
In local debug I see that the data in the context with respect to Configurations is getting updated but the same is not reflecting when the request is redirected to UI endpoints.
Can anyone help what I am doing wrong here. Thanks in advance :)
The text was updated successfully, but these errors were encountered:
kisalay19
changed the title
Dynamic addition on endpoints does not reflect in UI
QUESTION: Dynamic addition on endpoints does not reflect in UI
Jul 2, 2020
@kilasay19, take a look to our docker image that adds and removes endpoints on the fly when receives requests from the operator. Be sure you are using an updated UI version package
This is more of a help needed for my implementation. As per a port the "HealthChecksDb" dbcontext has been made public and is now accessible to make changes at runtime. Below is my code setup. I am able to refresh the
Configrations
DbSet but the same does not reflect in the UIIn local debug I see that the data in the context with respect to
Configurations
is getting updated but the same is not reflecting when the request is redirected to UI endpoints.Can anyone help what I am doing wrong here. Thanks in advance :)
The text was updated successfully, but these errors were encountered: