Fix endpoint and OTEL-017 false positives - #67
Open
starkross wants to merge 1 commit into
Open
Conversation
Running augur over a corpus of real configs (OTel Helm charts, AWS, demo)
surfaced false positives in three rules.
is_env_var only matched a value that was *wholly* an env reference (it
required endswith "}"), so "${env:MY_POD_IP}:4317" β the Helm charts'
standard bind β slipped past the guard and tripped OTEL-033/OTEL-018.
Match any value that *contains* ${env:/${ENV:, which also covers headers
like "Bearer ${env:TOKEN}". This removed 54 false OTEL-033 findings on the
helm fixtures with no loss of real coverage.
OTEL-017 (no retry/sending_queue) fired on two exporters that are not at
risk:
- loadbalancing nests retry_on_failure/sending_queue under protocol.otlp,
not at the top level β teach _exporter_has_alt_retry about it.
- nop discards data by design, so retry/queue is meaningless β add it to
the pull-based exclusion set (and to the matching sets for OTEL-048/052).
Left intentionally unchanged: OTEL-017 still warns on a bare otlp exporter
and on awsxray/awsemf without max_retries. Those are deliberate,
test-locked "be explicit about resilience" nudges, not logic bugs.
Tests: env-var-with-port pass cases for OTEL-033/018; nop and nested-
loadbalancing pass cases for OTEL-017. regal clean, conftest 95/95.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Ran augur across a corpus of ~66 real and synthetic collector configs (OTel Helm charts, AWS ADOT, the OTel demo, collector-contrib testdata, plus hand-authored deployments). That surfaced ~56 false positives, concentrated in three rules. This PR fixes them.
Fixes
1.
is_env_varmissed${env:VAR}:port(54 false OTEL-033, plus OTEL-018/046)The helper only matched a value that was wholly an env reference (it required
endswith("}")), so${env:MY_POD_IP}:4317β the Helm charts' standard bind β slipped past the guard and tripped OTEL-033/OTEL-018.Now it matches any value that contains
${env:/${ENV:, which also covers things likeBearer ${env:TOKEN}.2. OTEL-017 fired on
loadbalancingdespite configured resilienceloadbalancingnestsretry_on_failure/sending_queueunderprotocol.otlp, not at the top level. Taught_exporter_has_alt_retryto look there.3. OTEL-017 fired on the
nopexporternopdiscards data by design β retry/queue is meaningless. Added it to the pull-based exclusion set (and to the matching sets for OTEL-048/052 to prevent the same latent FP).Deliberately left unchanged
OTEL-017 still warns on a bare
otlpexporter and onawsxray/awsemfwithoutmax_retries. These look like false positives (those exporters enable retry/queue by default), but they are deliberate, test-locked behavior (test_017_warn_otlp_no_retry,test_017_warn_aws*_without_max_retries) β a "be explicit about resilience" nudge, not a logic bug. Reversing them is a product decision, so I left them and am flagging it here instead.Impact on the corpus
Total findings 351 β 295 (β56). OTEL-033 91 β 37 (every env-var hit gone; the 37 left are real literal-IP /
0.0.0.0binds). OTEL-017 14 β 12 (loadbalancing+nopremoved; the 12 left are the intentional otlp/aws cases).Tests
Added env-var-with-port pass cases for OTEL-033/018, and
nop+ nested-loadbalancingpass cases for OTEL-017.regalclean,conftest verify95/95,go test ./...green.π€ Generated with Claude Code