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

Provide (or release?) a way to set apdex_t for an existing new relic application #538

Closed
ryangardner opened this issue May 1, 2020 · 5 comments
Labels
dependencies Changes to dependencies enhancement New feature or request

Comments

@ryangardner
Copy link

I was about to pull down this provider and start fumbling my way through trying to implement this myself, when I came across:

https://github.com/terraform-providers/terraform-provider-newrelic/blob/master/newrelic/resource_newrelic_application.go

Which looks like it has the ability to do what I was needing. Is there a rough idea when the next release might go out that will include this feature? (If you accept bribes, what's your preferred way to be bribed?)

@jthurman42
Copy link
Contributor

There is a bit of work to get this into the provider, but there is an API endpoint to do so. We're currently prepping to start a 2.x release cycle with the change required to enable this ability.

The specific endpoint in question is: https://api.newrelic.com/graphiql

with the following graphql query:

mutation {
  apmApplicationEntityChangeSettings(guid: "<MY APPLICATION ENTITY GUID>", settings: {apdexTarget: 0.5}) {
    entity {
      guid
      name
      settings {
        apdexTarget
      }
    }
  }
}

@jthurman42 jthurman42 added this to the Provider 2.0 milestone May 1, 2020
@jthurman42 jthurman42 added dependencies Changes to dependencies enhancement New feature or request size/S labels May 1, 2020
@ryangardner
Copy link
Author

Great, thanks for the reply!

We did see that graphql endpoint - (that currently only lets you set apdexTarget - but maybe someday will let you set other settings)

Is the current master branch getting ready for the 2.x release? We did build the current master version and what's inside there that lets you set the appdex and a couple other settings does seem to work (at least to set apdex): https://github.com/terraform-providers/terraform-provider-newrelic/blob/master/newrelic/resource_newrelic_application.go#L22-L36

(and one piece of feedback on that specific resource, since it hasn't been released yet... you might want to consider naming it applicationSettings or something since the version there almost makes it seem like it will create a new application in new relic rather than just modify an existing one )

@jthurman42
Copy link
Contributor

Looks like this was merged into master just after the split, but appears to be backwards compatible. @zlesnr any reason not to port the application resource to v1.x?

Good point on the naming, as this won't create an application. We overrode the 'create' function to act as an import. Read/Update/Delete should all function (note the API requires apps to stop reporting for 12 hours before a delete can occur, so this is also slightly unexpected behavior)

@zlesnr
Copy link
Contributor

zlesnr commented May 1, 2020

Not that I see @jthurman42. Looks like its all REST there.

@ctrombley
Copy link
Contributor

@ryangardner Support for this has been added in v1.18.0 of the provider via the newrelic_application_settings resource. Give it a try and let us know if you have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Changes to dependencies enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants