Datadog k6 metrics for Graphql operations

I am doing performance testing for a application which have graphql operations. The tool I used for monitoring is Datadog. I was using datadog metrics to get the test results details, such as status, latency, error count when testing for http requests using k6.http.req metrics. But I couldn’t find any datadog k6 metrics to get such details on the graphql operations that I’m currently testing.
The reason I want to use this k6 metrics is to capture the requests failures that happens due to network timeouts, script issues because those issues were not captured in the Datadog APM as the failure happens before the request hits the application server. I cannot add console logs to the k6 script as it will exceeds the memory capacity of the load generator.
Is there a k6 datadog metrics that I can use or any other way that I capture those information?

Hi @sahaniperera995,

If you’re using the k6/net/grpc module in your k6 tests, they should report some metrics. You can confirm it by using the standard end-of-test summary output, or an alternative output like JSON.

Once you confirm that, those metrics should be pushed to Datadog. If not, I guess it might be because of the Output extension you’re using to do so. Try to find out if there’s any configuration you can tweak to try to get it working.

Note that, if you’re using StatsD for that purpose, it’s no longer part of k6 (deprecated) and we no longer offer official support. But it has been continued by a community contributor, so perhaps you can reach them to get some help on doing this research.

I hope you can find the reason why gRPC metrics aren’t being pushed to your Datadog account :bowing_man:
Please, let me know if there’s anything else I can help you with!

Hi @joanlopez
I’m using this extension K6_STATSD_ENABLE_TAGS=true as the Output extension. And also I was referring to these metrics. I actually want to get the request status code to check from datadog. E.g. - At the end of test in end-of-test summary, k6 failure rate threshold shows 100 failures. I want to see the status code of those 100 failures from Datadog.
Is there a way I can do that?

Hi @sahaniperera995,

Unless I’m wrong, I cannot see any of the metrics you referred to include status codes. So, you’ll probably need to define and use your own custom metrics, or directly write log logs if you need finer grained detailes.

I’m sorry for having to say that there’s nothing like what you’re looking for by default, but I hope what I suggested helps you! Please, let me know, or create another thread, if you have any issues with defining and using custom metrics.

Regards!

Hi @joanlopez, Thanks for your response.

I guess my questions seems bit unclear. Let me try to ask it in a clear way.

I already have custom metrics in my performance scripts. And using those metrics I gather information such as Latency, failure rate and request count. With the use of ‘Rate’ metrics, I gather failure rate of the query I’m being looking. We are using graphql operations. we already have the systen datadog integrated and we can view the requests in datadog.

Below I have explained my requirement. :point_down:

when we are doing performance testing for HTTP requests, I have created a table in a Datadog dashboard which can capture status code of the requests using k6.http_reqs datadog k6 metrics. From that I was able to get a summarised information of the all requests of their status code. To be more clear I have attached a screenshot as well.

I want to do similar thing for graphql perf tests. But I was unable to do that because the unavailability of k6.http_reqs metrics for graphql oeprations. The reason I need to do this is, to capture the requests failures that happens due to network timeouts, script issues because those issues were not captured in the Datadog APM as the failure happens before the request hits the application server. I cannot add console logs to the k6 script as it will exceeds the memory capacity of the load generator.

Is there a way that I can do this?

Hi @sahaniperera995,

I think that, based on your most recent reply, your questions were clear. The problem likely was that my answer wasn’t clear enough :pray:

As far as I can see in the codebase, there’s no equivalent to k6.http_reqs in the grpc module, but other metrics like: grpc_streams_msgs_sent or grpc_streams_msgs_received. That’s why I suggested you to try to define your own custom metrics, so you can manually account them, when performing operations over gRPC, and then use those to build a similar dashboard.

If that doesn’t work, or even as an alternative solution, you can try to create a new issue in the k6 repository as a feature request, but please bring as many details as possible there. Like, concretely what operations would you like to account, and why you think these should be built-in (can’t be defined as custom metrics, widely used, etc - whatever).

I hope that’s a bit more clear now, and hopefully helps!