Skip to content

Commit

Permalink
fix: adds support for default max spans limit helm config (#291)
Browse files Browse the repository at this point in the history
* fix: adds support for default max spans limit helm config

* there is no limit as default
  • Loading branch information
kotharironak authored Nov 25, 2021
1 parent cdbd7b4 commit fcd88a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ data:
span.groupby.session.window.interval = {{ .Values.rawSpansGrouperConfig.span.groupby.internal }}
{{- if hasKey .Values.rawSpansGrouperConfig "defaultMaxSpanCount" }}
default.max.span.count = {{ .Values.rawSpansGrouperConfig.defaultMaxSpanCount }}
{{- end }}
{{- if hasKey .Values.rawSpansGrouperConfig "maxSpanCount" }}
max.span.count = {
{{- range $k, $v := .Values.rawSpansGrouperConfig.maxSpanCount }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,9 @@ private boolean shouldDropSpan(TraceIdentity key, TraceState traceState) {
long maxSpanCountTenantLimit =
maxSpanCountMap.containsKey(key.getTenantId())
? maxSpanCountMap.get(key.getTenantId())
: Long.MAX_VALUE;
: defaultMaxSpanCountLimit;

if (inFlightSpansPerTrace >= defaultMaxSpanCountLimit
|| inFlightSpansPerTrace >= maxSpanCountTenantLimit) {
if (inFlightSpansPerTrace >= maxSpanCountTenantLimit) {

if (logger.isDebugEnabled()) {
logger.debug(
Expand All @@ -199,8 +198,7 @@ private boolean shouldDropSpan(TraceIdentity key, TraceState traceState) {
.increment();

// increment the counter when the number of spans reaches the max.span.count limit.
if (inFlightSpansPerTrace == defaultMaxSpanCountLimit
|| inFlightSpansPerTrace == maxSpanCountTenantLimit) {
if (inFlightSpansPerTrace == maxSpanCountTenantLimit) {
truncatedTracesCounter
.computeIfAbsent(
key.getTenantId(),
Expand Down

0 comments on commit fcd88a5

Please sign in to comment.