Getting the time to first byte (Cloudflare plugin)

Hi all
I’m working on a dashboard that includes retrieving the time to first byte (edgeTimeToFirstByteMs) and have been trying to build a graphQL query to get that data.

Unfortunately I haven’t had any luck so far. Have tried this query which doesn’t return an error but returns no data

httpRequestsAdaptiveGroups(limit: 10000, filter: {datetime_geq: $sinceTime, datetime_lt: $untilTime}) {
    dimensions {
        timeslot: datetime
    }
    sum{
        edgeTimeToFirstByteMs
    }
}
1 Like

Network log is giving “Data Stream failed: DataStream Error: All data source requests failed”

I’m seeing the same issue - I’ll do some digging and come back to you!

So it looks like the data source is not handling the newer httpRequestsAdaptiveGroups dataset correctly. We should be able to fix this, however it can still be fiddly to get SquaredUp to format the data correctly depending on whether it’s timeseries data or just scalar values.

Could you share a bit more about the kind of tiles/dashboards you’re trying to create, e.g. a line chart or just some scalar values, e.g. P95 TTFB?

1 Like

Thank you for the quick reply! I’m just planning to output it as a table of scalar values so don’t need timeseries data.

I think the P95 would probably be a better metric actually. My original plan was just showing an average of the response times but that works better (I am fairly new to GraphQL)

(so will change the query to this instead of edgeTimeToFirstByteMs)

quantiles {
edgeTimeToFirstByteMsP95
}

Thanks for the extra detail - that’s really helpful! We’ve identified a bug with the GraphQL datastream that means datasets like httpRequestsAdaptiveGroups aren’t working as expected. We’re going to take two actions:

  1. Implement a small fix to allow you to query the httpRequestsAdaptiveGroups dataset as expected, this should allow you to query the performance metrics you’re after. This should be available within a few days.

  2. Raise a feature request to allow you to query all available datasets more easily - I’ll add your use case to this and we’ll prioritize accordingly.

As an aside - I’ve love to hear a little more about your journey with SquaredUp so far and any feedback you might have. If you’re happy to chat, could you drop me a line at [email protected] please?

Just to let you know @someGuy - that query should now be working for you! e.g.

httpRequestsAdaptiveGroups(limit: 1, filter: {datetime_geq: $sinceTime, datetime_lt: $untilTime}) {
    quantiles {
        edgeTimeToFirstByteMsP95
    }
}