Open
Conversation
Per-repo index for string literals that cross an API boundary —
Datadog/dogstatsd metric names, errors.New / fmt.Errorf messages,
and raw HTTP route paths. Each extractor emits a KindString node
and an EdgeEmits from the enclosing function; applyRepoPrefix
stamps the repo slug so two repos emitting the same metric stay
distinct.
Go extractor whitelist:
- metric: Increment, Decrement, Count, Gauge, Histogram,
Distribution, Timing, TimeInMilliseconds, Event, ServiceCheck
(statsd / dogstatsd shape; Set/Inc/Add deliberately excluded
as too generic).
- error_msg: errors.New, fmt.Errorf, xerrors.New, xerrors.Errorf.
- route: Handle / HandleFunc / Get / Post / Put / Delete / Patch /
Options / Head / Connect / Trace, gated on a path-likeness check
so cache.Get("user:42") doesn't fall in. Accepts net/http 1.22+
pattern syntax ("GET /foo").
New analyzer `analyze kind=string_emitters` groups by
(context, value) with context and name-substring filters; supports
JSON, GCX1 wire format, and compact-text outputs. Long values
(>200 chars) get a 16-char SHA1 suffix in the node ID; short ones
keep the literal text for direct grep.
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.
Per-repo index for string literals that cross an API boundary — Datadog/dogstatsd metric names, errors.New / fmt.Errorf messages, and raw HTTP route paths. Each extractor emits a KindString node and an EdgeEmits from the enclosing function; applyRepoPrefix stamps the repo slug so two repos emitting the same metric stay distinct.
Go extractor whitelist:
New analyzer
analyze kind=string_emittersgroups by (context, value) with context and name-substring filters; supports JSON, GCX1 wire format, and compact-text outputs. Long values (>200 chars) get a 16-char SHA1 suffix in the node ID; short ones keep the literal text for direct grep.