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 an "Export to Terraform" button into the Datadog UI #10

Open
laurmurclar opened this issue Feb 14, 2019 · 2 comments
Open

Add an "Export to Terraform" button into the Datadog UI #10

laurmurclar opened this issue Feb 14, 2019 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed

Comments

@laurmurclar
Copy link
Owner

Chrome Extensions can modify the DOM - it would be awesome to have a button in the Export Monitor panel in Datadog. The button could take care of pulling out the monitor json & doing code generation all in one step.

image

@laurmurclar laurmurclar added the enhancement New feature or request label Feb 14, 2019
@laurmurclar laurmurclar added the good first issue Good for newcomers label Jul 30, 2019
@laurmurclar laurmurclar added hacktoberfest help wanted Extra attention is needed labels Sep 18, 2019
@flavio-cadete-cko
Copy link
Contributor

Was trying to build this during my spare time, (note: don't have much FE experience), but hit a wall:
Unexpected token 'export'
Cannot use import statement outside a module

Basically was trying to split intro folders and reuse same code, but I get those errors when loading the js files. If you know how to get around those issues, please say so.

@laurmurclar
Copy link
Owner Author

laurmurclar commented Mar 27, 2021

Hey @flavio-cadete-cko ! Cheers.

It's hard to know what exactly has gone wrong without seeing the code but it looks like you've got a syntax error or you're importing or exporting something incorrectly. This article gives some short and sweet examples of what those should look like.

BTW, I actually looked into this before but never left an update here. I think this will be a bit more complicated than I expected, since it involves a modal with elements that aren't in the DOM when the page is opened. We'd have to watch for the event which opens the modal and then try insert the button. Also, you can view the JSON for existing monitors and also when creating new ones, so we'd have to cover both cases. Another thing - it can't be done for dashboards/timeboards, only monitors, as exporting dashboards puts the JSON directly into your clipboard rather than adding it to the DOM.

I think it would be a really nice feature but I'm not sure it's worth it, it will be brittle to maintain since Datadog can obviously change their DOM and break it at any time 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants