Open
Description
Current Distributed Tracing Sampling is based on "magic" (assuming "most common request is most important")
While the business is running on:
- we have an anomaly, how to debug this particular page?
- we do not care about 50% of information page traffic which are bots, we want to optimize checkout flow that is paying the bills
Therefore, we want to "teach" SDK what is important to sample.
Summary
Current Sampling logic is not configurable
Therefore developers have to end up with hacks.
It feels wrong paying for Observability platform and still need to have code like:
txn := newrelic.FromContext(ctx)
log := logrus.WithContext(newrelic.NewContext(ctx, txn))
if debugThisPage {
log.WithField("url", u.String()).Debug("Outgoing call")
}
Desired Behaviour
txn := newrelic.FromContext(ctx)
txn.MarkKeyTransaction(true)
or
txn := newrelic.FromContext(ctx)
txn.PreferSampled(true)
Additional context
- Same problem:
Infinite Tracing will figure out which trace data is most important
: https://docs.newrelic.com/docs/distributed-tracing/concepts/how-new-relic-distributed-tracing-works/#tail-based - Key transactions do not work for Debug this page, because would end on too many transactions: https://docs.newrelic.com/docs/apm/transactions/key-transactions/introduction-key-transactions/