TraceGroups API, get data without using cookie

Hi,

I would like to hit this API using the API Key. This api is accepting a cookie. If the cookie is removed, it does not work. How can I do this?

curl --location --request POST 'https://distributed-tracing.service.newrelic.com/api/v2/analytics/traceGroups' \
--header 'content-type: application/json; charset=utf-8' \
--header 'cookie: TSNGUID=someCookieID' \
--data-raw '{
    "limit": 75,
    "durationMs": 1800000,
    "durationType": "TRACE_DURATION_MS",
    "filter": {
        "operator": "AND",
        "indexQuery": {
            "conditionType": "INDEX",
            "operator": "AND",
            "conditionSets": [
                {
                    "conditionType": "INDEX",
                    "conditions": [
                        {
                            "attr": "entityGuids",
                            "operator": "LIKE",
                            "value": "%MjYyNjU4N3xBUE18QVBQTElDQVRJT058NTA4MTgwODU0%"
                        }
                    ],
                    "operator": "OR"
                }
            ]
        },
        "spanQuery": {
            "operator": "AND",
            "conditionSets": []
        }
    },
    "traceStartMs": null,
    "sortBy": "TRACE_COUNT"
}'

Regards
Shashank

Hi, @kalpeshc09: Where did you find the documentation for this endpoint? Please post a link.

It is not a public facing api and i didn’t find any documentation on it. You can see the curl of this api in the network tab when you click on distributed tracing. You can see it in this image. My query is it takes a cookie to give results. How can i get the data from my New Relic account without using cookie?

I don’t think you can. As you noted, that API is not intended for public use. Instead, you may access your distributed tracing data by querying the Span data type: Span attributes | New Relic Documentation.

1 Like

I just want to get the data that this api is giving. Can i get the same data using https://api.newrelic.com/graphiql i.e graphiql api which is public facing? If we can then can you please help me with how the query should be structured?

Hi @kalpeshc09

Thanks for the providing some extra context and the link. Unfortunately this is out of my scope, however I will loop in the API Engineering team to have a look.

Please note they will reach out via this post with their updates! Should you have additional questions or findings, please do reach out. We are here to help.

Hey @kalpeshc09 stepping in here for a minute to lend a hand!

Not sure if you saw Phil’s suggestion to use NRQL and query FROM Span, but I think this has what you’re looking for – and is public facing!

https://onenr.io/0dQeV3MNdwe

Additionally, here are some docs which go into the definitions of the attributes on this table https://docs.newrelic.com/docs/distributed-tracing/ui-data/span-attributes/

Hopefully this was helpful! Please tag me in your response if you need further assistance!