AWS CloudWatch Logs metrics broken graph


We’ve configured a metric filter for a CloudWatch Log Group which collects data for one of our processes.

Initially, we had only one ec2 instance associated with the log stream of the log group. The retrieved data from the logs was showing up nicely in the graph.

However, we want to have multiple instances connected to that same log stream or log group. When we configured another instance for the log group, the graph becomes broken:


From what we observed, it looks like the points are only connected if they are consecutive data derived from the latest instance. Otherwise, it just shows a point.

All the data shown are still correct. It’s just that they aren’t all connected. Is there a way to have all the points connect?


This is the way CloudWatch graphs communicate the fact that your datapoints are not continuous. There is no way to force the connection between datapoints.

— update 2022-5-31 —

The above is still the correct answer. There is no way to connect the datapoints with a gap between them with just a line. If there is a gap in the line that means the data for that timestamp doesn’t exist. This could happen if the event you’re measuring with the graph never happened or there was an issue with publishing the metric. Both of these are valid scenarios.

However, CloudWatch launched the metric math feature in April 2018 and one of the functions supported with the metric math is FILL (see the answer below of this answer on how to use it).

FILL doesn’t just connect the lines to make the graph pretty. It will actually interpolate the missing values and insert them into the graph (only the graph, not the actual datastore). This hides the above-mentioned scenarios of missing data. This could be fine, but it could also cause issues and unpredicted behavior depending on the use case. I’d suggest to use the FILL function carefully and always making it clear on the graph (in the title or the legend) that the FILL was used in the graph.

Leave a Reply