Wrong calculation in graphana

I have the following problem, I need to build a graph that takes all 4XXError_Maximum and the total time analyzed and make a division as follows 4XXError_Maximum / total time analyzed, but as you can see in the images below when he performs the division he gets value of 0.800, it should not be that value, the correct value would be zero because there is no error as you can see, in this case I am analyzing the total time of 5 minutes, and the 4XXError_Maximum is 0, so the division should be zero.

note: I am using transformations to count the 4XXError_Maximum and total time analyzed, then I do the math

Hi @gabrieliclubs,

Do you think you could switch this visualization to the Table plugin and then share another screenshot? Also maybe one of all your transformations?

1 Like

Do you mean use the table dashboard? Or install the pluin?

I just meant switch the vizualization from the gauge panel in your screenshot to the table panel. Is that clearer? sorry.

What I want to get a better look at is all your data in a table before, during, and after the transformations that lead to this calculation error. :+1:

1 Like

All right

In this case I am making a query taking the maximum 4xx and a second query using expression where I use FILL (METRICS (), 1), to return the selected time.

this without using transformations

then I use transformations to count the data points of 4XXError_Maximum and also of FILL (METRICS (), 1) → range

finally I do the division, but he does not consider the number of errors, and always divided by 4, regardless of how many errors there are, that is, if it is 0 errors or 20 errors, he always divides by 4.

Could you guide me if I’m really doing it right? What would be the best way to resolve this situation?


My sense is that there is a much easier way to get the data you want. You are using the CloudWatch datasource, yes?

Have you tried using any of the curated and pre-configured dashboards that ship with that datasource?

I would try those as a starting point while I try to figure out your current workflow.

But let me ask this: why do want this particular data? What value does it have for you? What do you want it to tell you about your system? The rate of 4xx errors over a given period of time?

That’s right I want him to show me the error 4xx rate as I select a certain period of time. I want to generate a graph of the time it was available.

For example: If I select 5 minutes and there is 1 minute of failure it will show 80%, that is, during the 5 minute period it will be 80% available, if there was no failure it would have to show 100%.

yes I am.

I’m already using cloudwatch as a data source but I haven’t used these pre-configured panels.

I’m sorry, I forgot to mention it, but the complete formula would be 1- (4XXError / time analyzed), I want that based on this formula I can generate an availability graph. All these images that I sent previously would be just part of the division, I just needed to show that in the end I would do a subtraction by 1

I would highly recommend that you explore those pre-configured panels. They will be full of well-written queries that, if nothing else, you can adapt to get the metrics you want.