NerdGraph tutorial: Create, revoke, and list 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.
Prudence
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, revoking, or listing a publicly accessible live chart URL from NerdGraph: go to GraphQL Explorer and then follow these instructions.
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