#Breadcrumbs for metrics?

8 messages · Page 1 of 1 (latest)

slow wave
#

I've implemented metrics - they're great! I would like to dig deeper into outlier metrics.

What's the best way to do this? I believe I'm sending transactions as well, but they're not showing up in spans under the metrics. I should be sampling 100% of the relevant transactions.

south niche
#

Which SDK are you using and when do you emit your metrics in your code? Metrics are span seeking, and should attach themselves to the current active span.

slow wave
#

We're using the Python SDK.

Here are the relevant code snippets:

  1. Transactions are started
  2. These transactions are sampled at 1.0
  3. I'm seeing the worker.message.success metrics, but no spans
midnight maple
#

Hey @slow wave your code looks good!

#

You do see the Transaction show up in Sentries "Performance" section, right?

#

Just from your metric you are not seeing the transaction, do I get this right?

#

One thing that could be happening: The metrics are ingested (because they are always ingested) but the transaction has been dropped because of sampling. Have you defined a traces_sample_rate?

#

Just a little heads up: We are currently working on some changes in our metrics api. So in the future you will have do something roughly like this:

with start_transaction(op="...", name="..."):
    with start_span(op="...", description="...") as span:
        sentry_sdk.set_tags(tag_dict)

        if ...:
          span.set_data("worker.router.unhandled_job_type", 1)

        span.set_data("worker.message.success", 1)
        span.set_data("worker.message.latency", (finish_time-start_time).total_seconds())