Skip to content

Commit 020884f

Browse files
Support flexible p0-p99 latency
1 parent ef30db2 commit 020884f

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

charts/nr-ebpf-agent/templates/_helpers.tpl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,10 @@ which contains pre-built kernel headers matching the RHCOS kernel.
148148
Validate the user inputted quantile when sampling by latency.
149149
*/}}
150150
{{- define "validate.samplingLatency" -}}
151-
{{- $validOptions := list "" "p1" "p10" "p50" "p90" "p99" -}}
152151
{{- $protocol := .protocol -}}
153152
{{- $latency := .latency -}}
154-
{{- if not (has $latency $validOptions) -}}
155-
{{- fail (printf "Invalid samplingLatency '%s' for protocol '%s'. Valid options are: %v" $latency $protocol $validOptions) -}}
153+
{{- if and (ne $latency "") (not (regexMatch "^p([0-9]|[1-9][0-9])$" $latency)) -}}
154+
{{- fail (printf "Invalid samplingLatency '%s' for protocol '%s'. Valid options are: p0-p99 (e.g. p0, p1, p10, p50, p90, p99)" $latency $protocol) -}}
156155
{{- end -}}
157156
{{- end -}}
158157

@@ -227,7 +226,7 @@ Generate environment variables for protocols configuration including enabled/dis
227226
{{- if and (eq $config.spans.enabled true) (hasKey $config.spans "samplingLatency") }}
228227
{{- include "validate.samplingLatency" (dict "protocol" $protocol "latency" $config.spans.samplingLatency) }}
229228
- name: PROTOCOLS_{{ upper $protocol }}_SPANS_SAMPLING_LATENCY
230-
value: "{{ $config.spans.samplingLatency | regexMatch "p1|p10|p50|p90|p99" | ternary $config.spans.samplingLatency "" }}"
229+
value: "{{ $config.spans.samplingLatency | regexMatch "^p([0-9]|[1-9][0-9])$" | ternary $config.spans.samplingLatency "" }}"
231230
{{- end }}
232231
{{- end }}
233232
{{- end }}

charts/nr-ebpf-agent/values.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ namespaceLicenseKeys: {}
1818
# -- Use this instead of namespaceLicenseKeys to avoid storing license keys in values.yaml.
1919
# -- The secret must contain a key named NAMESPACE_LICENSE_KEY_MAP with a JSON-encoded namespace-to-license-key map.
2020
customSecretNamespaceLicenseKeys: ""
21-
# -- If using a customSecretLicenseKey, you must supply your region "US"/"EU". Otherwise, leave this value as an empty string.
21+
# -- If using a customSecretLicenseKey, you must supply your region "US"/"EU"/"JP". Otherwise, leave this value as an empty string.
22+
# -- Accepted values: "staging", "US", "EU", "JP". Leave this value as an empty string for US (default).
2223
region: ""
2324
# -- Custom OTLP endpoint URL. When set, this takes precedence over the region-based static endpoints.
2425
customOtlpEndpoint: ""
@@ -69,7 +70,7 @@ ai_monitoring:
6970
# 'auto' (send only when neither APM nor OTel agent is attached)
7071
enabled: false
7172
# samplingLatency represents the sampling latency threshold for the spans to export.
72-
# Options: p1, p10, p50, p90, p99.
73+
# Options: any percentile from p0 to p99 (e.g., p0, p1, p5, p10, p50, p90, p99).
7374
samplingLatency: "p50"
7475
# -- samplingErrorRate represents the error rate threshold
7576
# for an HTTP route where surpassing it would mean the
@@ -195,7 +196,7 @@ logDataFilters:
195196
# Each protocol has the flexibility to selectively enable the type of OTLP data to export.
196197
# Metrics are sent by default when a protocol is enabled and it supports metrics. Note: AMQP, Kafka, DNS do not report metrics.
197198
# samplingLatency represents the sampling latency threshold for the spans to export.
198-
# Options: p1, p10, p50, p90, p99.
199+
# Options: any percentile from p0 to p99 (e.g., p0, p1, p5, p10, p50, p90, p99).
199200
protocols:
200201
global:
201202
# Controls maximum unlinked spans reported per protocol. Set to 0 to disable limit.

0 commit comments

Comments
 (0)