Traces in grafana cloud are not wroking in k6

I have added this line to my code and its not working.
tracing.instrumentHTTP({
propagator: “w3c”,
});

Hi @ilanv2703, welcome to the community forum!

Can you tell us what actually didn’t work? Was there any errors printed? What did you expect will happen?

Hi @mstoykov , I want to see the trace in this page:


buts its not working. No errors were printed

Hey @ilanv2703, thanks for reporting the issue!

To enable Distributed Tracing in Grafana Cloud k6, please follow the official documentation.

Essentially, two requirements must be satisfied:

  1. Send your application tracing data to Grafana Cloud Traces.
  2. Enable the tracing feature in your k6 test (Add K6_CLOUD_TRACES_ENABLED=true for local executions of k6).

Assuming you have covered the above, could you provide a broader context regarding your application deployment? Here are a few questions that can help us identify your issue:

  1. When sending tracing data to Grafana Cloud Traces, do you use remote endpoint directly in your application, or is there an agent sitting in between.
  2. What instrumentation library are you using within your application to record traces?
  3. Is there a reverse proxy sitting between k6 and your application?

Best,
Lukasz

Hi @lukasz , about K6_CLOUD_TRACES_ENABLED=true I typed it in the terminal but it didn’t do anything. About 1 and 2 I didn’t understand what thats means and about 3 i think there is a proxy.
Here is my test:

Thanks for your reply, @ilanv2703.

Regarding point (1) - Distributed Tracing in k6 is an integration between Grafana Cloud k6 and Grafana Cloud Traces. In order to use this feature in Grafana Cloud k6, you must send your traces to Grafana Cloud Traces, our hosted offering of Grafana Tempo. Specifically, the traces must be sent to an instance of Grafana Cloud Traces that’s part of the same cloud stack as the Grafana instance you use access the Grafana Cloud k6 app. With that in mind, I was asking whether you send your tracing data directly from you apps using an OpenTelemetry SDK, or do you have some sort of agent (e.g. Grafana Agent) deployed in your infrastructure that collects these traces and sends them to Grafana Cloud.

Regarding point (2) - From the script you provided, I can see that you try to use a w3c propagator. Is your application using an OpenTelemetry SDK?

Best,
Lukasz