newrelic-client-go icon indicating copy to clipboard operation
newrelic-client-go copied to clipboard

Region Constants reference Deprecated API Endpoints

Open tcgbrett opened this issue 3 years ago • 4 comments

Description

The restBaseURL in pkg/region/region_constants.go refers to api.newrelic.com/v2 which is deprecated for Dashboard interaction. That means the whole Dashboards package can't actually interact with the new NerdGraph API.

Go Version

go version go1.17.2 darwin/amd64

Current behavior

When I use the dashboards package, the URL points to a deprecated endpoint, so the request fails. The failure

error creating dashboard:410 response returned: This endpoint is deprecated: Please see documentation on migrating to NerdGraph, our GraphQL API, here:, https://docs.newrelic.com/docs/new-relic-one/use-new-relic-one/core-concepts/dashboards-api-migration-insights-api-nerdgraph, and check the announcement: https://discuss.newrelic.com/t/important-insights-dashboard-api-end-of-life/149357

I changed my local NR code in pkg/dashboards/dashboard.go to print what the devised URL is, and it does confirm my suspicions. I changed this to a print statement

	url := d.config.Region().RestURL("dashboards.json")
	log.Println("Built URL: ", url)

And it printed: Built URL: https://api.newrelic.com/v2/dashboards.json

Expected behavior

This should interact with a non-deprecated API so it's usable.

Steps To Reproduce

Steps to reproduce the behavior: Try to use client.CreateDashboard(*db) and it will fail.

tcgbrett avatar Dec 28 '21 22:12 tcgbrett

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jan 14 '22 17:01 stale[bot]

... I would not like this issue closed. I would like if someone from NR responded.

tcgbrett avatar Jan 18 '22 19:01 tcgbrett

This is affecting us as well so would be keen on a fix

michaelprice232 avatar Jan 21 '22 12:01 michaelprice232

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Feb 19 '22 12:02 stale[bot]