terraform-provider-newrelic icon indicating copy to clipboard operation
terraform-provider-newrelic copied to clipboard

Migrate synthetics resources to GraphQL API

Open kidk opened this issue 3 years ago • 9 comments

Objective

The current synthetics resources are based on the REST API. The New Relic GraphQL library now supports Synthetic calls: https://api.newrelic.com/graphiql?#query=mutation%20%7B%0A%20%20syntheticsCreateMonitor%0A%7D%0A This work will track the migration of the resources to the new API.

Open questions

  • Will we be able to keep backwards compatibility?

kidk avatar Oct 05 '21 12:10 kidk

Hey @kidk, it looks like the next generation of synthetic monitoring runtime was recently announced on the forum and blog, including Nerdgraph/GraphQL API additions - which is great!

Would you happen to know when these changes are expected to make their way into the Terraform provider (and help take a big chunk out of the Synthetics GraphQL?

rdhar avatar Apr 15 '22 00:04 rdhar

As soon as we can 😄 Currently targeted for this quarter

kidk avatar Apr 20 '22 09:04 kidk

Fingers-crossed, looking forward to it!

Outta interest, would it include all types of monitors, such as the Broken Links and SSL Cert Expiration (#1585) which are currently outside the scope of the Terraform provider?

rdhar avatar Apr 20 '22 13:04 rdhar

It should 😄 at the moment our priority is to get feature parity, without too much change on the resource definition side. Depending on the effort required to get these new features in they might come at a later date. I hope to have more information over the coming weeks. I'll update this thread when I do.

kidk avatar Apr 21 '22 10:04 kidk

Thank you, really appreciate you sharing some background.

rdhar avatar Apr 21 '22 10:04 rdhar

I don't want to add pressure or anything, but monitors created with the current version of the provider are born in the legacy Node 10 runtime, which is currently being phased out. Since there are significant breaking changes for scripted Browser and APIs, it's... less than optimal, that new monitors be created in the legacy version, as there's quite a bit of effort involved in migrating them to new new one whenever the change comes.

As of now I'm creating monitors with terraform then manually going over each one to change their runtime version to the new Node 16, as to be able to write the scripts in forward compatible syntax.

guhcampos avatar May 13 '22 16:05 guhcampos

We currently have it planned to have this ready end of June. There's already a couple of PR's open with first draft of changes.

kidk avatar May 21 '22 15:05 kidk

Any update as to when this will be available?

eileenhayes avatar Aug 03 '22 09:08 eileenhayes

We hit some API blockers during the implementation. The work is planned to continue in September.

kidk avatar Aug 04 '22 12:08 kidk

We've released V3 version of our provider which includes all of the new Synthetics features: https://registry.terraform.io/providers/newrelic/newrelic/latest/docs/guides/migration_guide_v3

This completes the migration of synthetics resources from REST to GraphQL 🥳

Please let us know if you have any questions. If you encounter any issues please don't hesitate to create a new ticket.

I'll close this ticket as the work has been delivered. Feel free to continue the discussion if needed.

kidk avatar Aug 29 '22 08:08 kidk