NerdGraph tutorial: Create, list, and revoke public sharing chart URLs
Charts are visual representations of data helping you understand and analyze information from your apps, infrastructure, or services. You can convert these charts into URLs and share them publicly. Public chart links allow you to easily share graphs and data with others, even if they don't have a New Relic account.
With the appropriate security and access settings, you can create, manage, and revoke publicly accessible live chart URLs using queries and mutations in NerdGraph. Alternatively, you can perform these actions via the New Relic UI.
Cuidado
Anyone with access to the live chart URLs can view all the information from the underlying chart query. Ensure that information is shared cautiously and in compliance with your company's internal policies and procedures.
For creating, listing, or revoking a publicly accessible live chart URL from NerdGraph: go to GraphQL Explorer and then follow these instructions.
Generate a live chart URL
To create a live chart URL, you first need to know your account ID. Use the following mutation to fetch your account ID, and then you can create your live chart URL.
For creating public sharing chart URLs, you need an account ID. This API allows you to retrieve your account ID using the actor query.
Sample request
{
actor{
accounts{
id
}
}
}
Sample response
{
"data":{
"actor":{
"accounts":[
{
"id":xxxxxxxx
},
{
"id":xxxxxxxx
}
]
}
}
}
This API allows you to execute NRQL queries on a specified account and retrieve an embedded chart URL based on the query results.
Input parameters
Parameter
Data Type
Is it Required?
Description
id
Integer
Yes
Your account ID refers to the unique identifier associated with the account you wish to query.
query
String
Yes
The NRQL query to execute.
Sample request
{
actor{
account(id:YOUR_ACCOUNT_ID){
nrql(query:"$query"){
embeddedChartUrl
}
}
}
}
# Parameters:
# {
# id: xxxxxxxx
# query: SELECT count(*) from Transaction TIMESERIES
To revoke a specific live chart URL, you first need to list all live chart URLs. Use the following query to display the list of live chart URLs. Then, you can select the specific chart's UUID to revoke its URL.
This API retrieves live URLs for dashboard widgets, providing the title, URL, creation date, and type for each.