Control CloudWatch Dashboard plot attributes, like line color?

0

I have a CloudWatch Dashboard with several widgets all with line plots breaking out the data by the same dimension. I'd like to be able to somehow control the colors (or other plotting attribute) of the line such that data in each widget's plot is easy to relate to the other widgets. For example, the plotted data lines are broken out by resource instances and I'd like all the line plots for a single instance to all be the same color.

Is this possible? If so, how to do it in the CloudWatch console and/or the Cloudwatch CLI?

Thanks,
-Kurt

klarson
demandé il y a 5 ans1744 vues
1 réponse
0

I found an answer to my question about controlling line color on CloudWatch Dashboard graphs in addition to labeling the breakout dimension too.

Color and label are controlled via the "Dashboard Widget Object: Rendering Properties Object Format" JSON documented here: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html?shortFooter=true#CloudWatch-Dashboard-Properties-Metric-Widget-Object.

The JSON can be passed to the CLI at dashboard creation time as documented here: https://docs.aws.amazon.com/cli/latest/reference/cloudwatch/put-dashboard.html

Also the CloudWatch Dashboard itself allows simple JSON editing of the properties via that "Action"->"View/edit source" control on the dashboard itself.

It's pretty straight forward. The only tricky part is the documentation for setting colors says "The six-digit HTML hex color code to be used for this metric." which I didn't inherently know. There's a good reference web page for HTML color codes here: https://htmlcolorcodes.com/

Turns out it all works better than I expected.

Enjoy,
-Kurt

klarson
répondu il y a 5 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions