-
Notifications
You must be signed in to change notification settings - Fork 805
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
Health check UI is not showing nor recording status history when using SQL server storage provider #559
Comments
Hello @AndrzejKroczynski, could you show your localhost:5111/status/ui endpoint healthchecks configuration?. Thanks! |
Hi @CarlosLanderas, The startup code is:
Also, see below sample output if you would like to mock it: Also, note that localhost:5111 is on .Net Core 2.2 (cannot upgrade it yet due to other dependencies), so it also uses Health Check UI in 2.2.* version. Could that be the problem? Other than issues with SQL Server storage this mix seems to work fine... |
@AndrzejKroczynski the status history timeline only writes a new entry when the state switches from healthy to unhealthy and viceversa (so it is not writing continuously when the state is the current one). Are you aware of that?. Are you trying this forcing the sql to be healthty-unhealthy-healthy? As you can see here: |
@CarlosLanderas - yep - I am aware about that. This works perfectly fine when I'm using in memory storage provider (this looks exactly as on screen you've provided). The problem is than when I switch to SQL server storage provider it stops working so I only see the current status, but no time line showing how the status was changing (even though it actually changed coupe of times). There are also no records in HealthCheckExecutionHistories table (I guess this is where those changes should be kept). So the summary is that if I use AddInMemoryStorage() all works fine, but with AddSqlServerStorage(...) history does not work (all other code is exactly the same). |
Thanks for the info! I'll take a look into it. It's really weird as the code running is the same for all providers |
@AndrzejKroczynski I am not able to reproduce the issue. I am using the StorageProviders sample: and everything is working fine: One question. Are you using the same sql instance for the SQL HealthCheck project and the UI project?. Maybe you are shutting down sql server for the healthcheck and the UI is not able to write as well?. That would explain why in memory is working |
@CarlosLanderas - I'm using separate instance for Health Check UI. Let me checkout the sample as well and see what is the difference between mine code and the sample. |
That sample runs local Healthchecks and UI. I am going to try to reproduce this using different processes |
@CarlosLanderas - checked the sample with local UI checks and it works perfectly fine, but when I switched to remote service (e.g. localhost:5111) it stopped working.... The JSON returned by both local and remote api seems to be in the same format... |
Issue: Health check UI is not showing TimeLine and HealthCheckExecutionHistories table is empty. Steps followed:
app.UseEndpoints(endpoints => {
Let me know if i am missing anything to persist executionhistories and to show Timeline. |
@AndrzejKroczynski @rajeshkandati I've created a sample from scratch using nuget packages and two different sql instances. https://github.com/CarlosLanderas/healthchecks-sample (There is a docker-compose file to easily start the two sql instances) Everything is working fine for me. Could you give it a try and compare with your codebase?. In the docker compose folder execute:
two switch health status. Thanks! |
@CarlosLanderas - Your sample with two sql instances works just fine, but I think it helped me to identify the problem. I think the issue is that status history is only saved when OVERALL component status changes. For example if we have health check end point with 10 checks where one of the checks constantly fails, then overall status is constantly Unhealthy - but other 9 checks are still performed, but their history is not saved. For example, if you replace sql check with:
In that case "random" check changes are not being tracked, because overall status remains unchanged. |
@CarlosLanderas - Same here. Sample is working fine for me too. Is it possible to find if the HealthCheckEndpoint is available or not(Alive or dead) from the HealthCheckSample? |
@CarlosLanderas - were you able to reproduce this on your side? |
Hello @AndrzejKroczynski and @rajeshkandati . Unfortunately I'm having very busy days. I'll try to check this tonight :). Thanks! |
Can confirm that I have the same issue when using a postgress database as storage. |
yup same problem with postgresql. Sometimes it saves history but other times it doesnt. |
Anyone found any solution to this problem? |
@AndrzejKroczynski exactly, I need to check the code because this part was done by @unaizorrilla but I think the intention of the status history is recording the Overall endpoint health status, and not at the individual level. |
@CarlosLanderas - thanks for answer. The history icon is displayed next to each individual item, so it suggests that history tracking is per each individual item. Anyways - from usability perspective it would be really nice if we track that on individual item level. |
Then we have two options. Moving the details icon to the endpoint header or saving history at the individual level. @unaizorrilla what do you think? |
@CarlosLanderas @unaizorrilla - I would really appreciate if you decide to record that on individual level, because it adds usability in real-life scenario. For example - I have web service with 10 health checks - one of health checks is constantly failing because third-party service has issue. But the service that is failing is not critical, so I can live with that. In that case if another health check - this time critical is failing every now end then history will not show that because overall status doe not change. |
Hello, I'm having the same problem with history, when I have multiple checks configure and one is constantly changing to healthy and unhealthy, the history of that element is not present but, when I only leave one check in the configuration, the history is present. Like @AndrzejKroczynski said, I think is better for the user to record individual history of checks. |
Hello, I have a similar issue when using SQLServer Storage. This table dbo.HealthCheckExecutionHistories contains history of only one endpoint out of 11 I have configured. If the status changes for that one particular endpoint it is logged correctly, but the rest is omitted every single time. |
I have the same problem |
Hi all, Seems the problem hasn't been solved yet. I tried both InMemoryStorage and SqlServerStorage, but the UI doesn't display the historical changes on the statuses. These are the package versions I have used:
|
Does recording status history timeline not work with following packages? It shows me with "Healthy" or "Unhealthy". No history graph.
|
Hi all, |
I am having a similar issue but i've found out that the way I've tested for negatives also broke my endpoint entirely: |
Any updates on this ? |
Do we have an ETA on this? |
Nope. See #1714 |
Same problem here. I am using SQLite... |
As workaround I ended up creating a trigger on the database (in my case Sqlite): CREATE TRIGGER after_update_executions
AFTER UPDATE ON Executions
WHEN old.Status <> new.Status
BEGIN
INSERT INTO HealthCheckExecutionHistories ([Name], [Status], [On], [HealthCheckExecutionId])
VALUES
(
new.Name,
new.Status,
new.OnStateFrom,
new.id
);
END |
The UI is not working with .NET 7.0 |
@jsanjuan2016 I converted it to SQL and tried it out. This worked for me as a temporary workaround: CREATE TRIGGER after_update_executionentries ON HealthCheckExecutionEntries
AFTER UPDATE
AS DECLARE @Name NVARCHAR(500), @Status INT, @On DATETIME2(7), @HealthCheckExecutionId INT, @Description NVARCHAR(MAX)
SELECT @Name = ins.Name FROM INSERTED ins;
SELECT @Status = ins.Status FROM INSERTED ins;
SELECT @On = GETDATE();
SELECT @HealthCheckExecutionId = ins.HealthCheckExecutionId FROM INSERTED ins;
SELECT @Description = ins.[Description] FROM INSERTED ins;
BEGIN
SET NOCOUNT ON;
IF UPDATE([Status])
BEGIN
INSERT INTO HealthCheckExecutionHistories
([Name], [Status], [On], [HealthCheckExecutionId], [Description])
VALUES
(
@Name,
@Status,
@On,
@HealthCheckExecutionId,
@Description
);
PRINT 'HealthCheckExecutionEntries was updated and an event trigger was updated into HealthCheckExecutionHistories'
END
END |
i can comfirm this is still an issue today with the lastest versions |
What happened:
Health check UI is not showing nor recording status history when using SQL server storage provider.
What you expected to happen:
Health check UI shows and records history in the same way as when using in memory storage provider (which works just fine)
How to reproduce it (as minimally and precisely as possible):
Source code sample:
Startup.cs of .Net core API
Connection to db works fine, tables are created, other data is stored correctly, but HealthCheckExecutionHistories table remains empty.
Anything else we need to know?:
Environment:
The text was updated successfully, but these errors were encountered: