[TraceQL] Add trace level intrinsics#2503
Conversation
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
|
async iterator benchmarks are showing an unfortunate increase in memory usage: sync iterator benchmarks are seeing a small, but expected increase in memory usage: |
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
| case columnPathDurationNanos: | ||
| finalSpanset.DurationNanos = e.Value.Uint64() | ||
| initAttrs() | ||
| traceAttrs[traceql.NewIntrinsic(traceql.IntrinsicTraceDuration)] = traceql.NewStaticDuration(time.Duration(finalSpanset.DurationNanos)) |
There was a problem hiding this comment.
A few thoughts on this:
- This copies the trace-level attributes to the span even if they aren't part of the query, just retrieved as basic metadata. Do we need to do that?
- This is likely the source of increased mem usage. The local map var could be a reusable buffer on the collector.
There was a problem hiding this comment.
At the fetch layer can we tell the difference? My thought was this only really negatively impacts the second pass which is significantly less important than the first pass. I figured handling different cases would not be worth the code grossness.
Good call on the reusable map.
knylander-grafana
left a comment
There was a problem hiding this comment.
Thank you for adding docs. The updates look good. I've added a suggestion for admonition shortcodes.
Signed-off-by: Joe Elliott <number101010@gmail.com>
Signed-off-by: Joe Elliott <number101010@gmail.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
| attribute.Intrinsic == IntrinsicDuration || | ||
| attribute.Intrinsic == IntrinsicTraceDuration || | ||
| attribute.Intrinsic == IntrinsicTraceRootService || | ||
| attribute.Intrinsic == IntrinsicTraceRootSpan { |
There was a problem hiding this comment.
👍 Ah ok I missed this before. We could probably simplify the Span interface and put the intrinsics just in the map and not dedicated fields in the future.
What this PR does:
This PR adds trace level intrinsics:
traceDuration,rootServiceNameandrootName.Which issue(s) this PR fixes:
This is not quite the same as adding a scope but it does address the major needs in #1989
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]