ClickStack - Sample logs, traces and metrics

Run the following command to send the data to the OTel collector:

```
for filename in $(tar -tf sample.tar.gz); do
  endpoint="http://localhost:4318/v1/${filename%.json}"
  echo "loading ${filename%.json}"
  tar -xOf sample.tar.gz "$filename" | while read -r line; do
    printf '%s\n' "$line" | curl -s -o /dev/null -X POST "$endpoint" \
    -H "Content-Type: application/json" \
    -H "authorization: ${CLICKSTACK_API_KEY}" \
    --data-binary @-
  done
done
```

This simulates OTLP log, trace, and metric sources sending data to the OTel collector. In production, these sources may be language clients or even other OTel collectors.

Returning to the `Search` view, you should see that data has started to load (adjust the time frame to the `Last 1 hour` if the data doesn't render):

Data loading will take a few minutes. Allow for the load to be completed before progressing to the next steps.

Explore sessions

### Explore sessions[​](#explore-sessions "Direct link to Explore sessions")

Suppose we have reports that our users are experiencing issues paying for goods. We can view their experience using HyperDX's session replay capabilities.

Select [`Client Sessions`](http://localhost:8080/sessions?from=1747312320000&to=1747312920000&sessionSource=l1324572572) from the left menu.

This view allows us to see front-end sessions for our e-commerce store. Sessions remain Anonymous until users check out and try to complete a purchase.

Note that some sessions with emails have an associated error, potentially confirming reports of failed transactions.

Select a trace with a failure and associated email. The subsequent view allows us to replay the user's session and review their issue. Press play to watch the session.

The replay shows the user navigating the site, adding items to their cart. Feel free to skip to later in the session where they attempt to complete a payment.

Tip

Any errors are annotated on the timeline in red.

The user was unable to place the order, with no obvious error. Scroll to the bottom of the left panel, containing the network and console events from the user's browser. You will notice a 500 error was thrown on making a `/api/checkout` call.

Select this `500` error. Neither the `Overview` nor `Column Values` indicate the source of the issue, other than the fact the error is unexpected, causing an `Internal Error`.

Explore traces

### Explore traces[​](#explore-traces "Direct link to Explore traces")

Navigate to the `Trace` tab to see the full distributed trace.

Scroll down the trace to see the origin of the error - the `checkout` service span. Select the `Payment` service span.

Select the tab `Column Values` and scroll down. We can see the issue is associated with a cache being full.

Scrolling up and returning to the trace, we can see logs are correlated with the span, thanks to our earlier configuration. These provide further context.

We've established that a cache is getting filled in the payment service, which is preventing payments from completing.

Explore logs

### Explore logs[​](#explore-logs "Direct link to Explore logs")

For further details, we can return to the [`Search` view](http://localhost:8080/search):

Select `Logs` from the sources and apply a filter to the `payment` service.

We can see that while the issue is recent, the number of impacted payments is high. Furthermore, a cache related to the visa payments appears to be causing issues.

Chart metrics

### Chart metrics[​](#chart-metrics "Direct link to Chart metrics")

While an error has clearly been introduced in the code, we can use metrics to confirm the cache size. Navigate to the `Chart Explorer` view.

Select `Metrics` as the data source. Complete the chart builder to plot the `Maximum` of `visa_validation_cache.size (Gauge)` and press the play button. The cache was clearly increasing before reaching a maximum size, after which errors were generated.

Was this page helpful?