Skip to content
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

Add template_variable_presets to datadog_dashboard #401

Merged
merged 2 commits into from
Feb 10, 2020

Conversation

jackellenberger
Copy link
Contributor

@jackellenberger jackellenberger commented Jan 31, 2020

This is a bit premature as zorkian/go-datadog-api#296 is still awaiting review, but I've confirmed it works when everything is hooked together properly:

What

image

"Template Variable Presets" aka "Saved Views" are a quick shortcut that
can be added by hand or via json to dashboards in datadog, and appear in
the top left corner.

They allow you to string together common combinations of template
variable values, so if for example you want a "production us-east-2"
view of your dashboard, you could have a "production us-east-2" preset
that sets your template variables to environment = production and
region = us-east-2.

This PR adds support for template variable presets to dashboards, using the
new SDK functionality linked to above.

Cheers!

@ghost ghost added the size/L label Jan 31, 2020
Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks a lot for sending this PR! The code looks good and works like a charm. I left a small note inline to rebase on top of latest master. I'd also like to ask you to update the docs in website/docs/r/dashboard.html.markdown to provide an example and docs of this feature (make website and make website-test will help you see if your changes look fine). Thanks!

go.mod Outdated
@@ -6,7 +6,7 @@ require (
github.com/hashicorp/go-cleanhttp v0.5.0
github.com/hashicorp/terraform v0.12.5
github.com/kr/pretty v0.1.0
github.com/zorkian/go-datadog-api v2.25.0+incompatible
github.com/zorkian/go-datadog-api v2.26.0+incompatible
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase to latest master which already has this version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can do! I'll take care of this soon.

@ghost ghost added the documentation label Feb 8, 2020
@jackellenberger
Copy link
Contributor Author

@bkabrda done! Does this layout seem alright?

Screen Shot 2020-02-08 at 11 34 12 AM

Copy link
Contributor

@bkabrda bkabrda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is perfect, thanks! LGTM, merging this now.

@bkabrda bkabrda merged commit 5a9efbd into DataDog:master Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants