Skip to content

add the newrelic plugin - #131

Merged
brandonphelps1212 merged 2 commits into
mainfrom
newrelic-plugin
Nov 19, 2026
Merged

brandonphelps1212 merged 2 commits into
mainfrom
newrelic-plugin

Conversation

@brandonphelps1212

Copy link
Copy Markdown
Contributor

What this changes

Adds newrelic, an entry for the removedmembers format plugin. Part of #85 (I12.7 · Watch New Relic), under #15.

  • Source: New Relic's Python agent 11.0.0 release note, python-agent-110000.mdx in newrelic/docs-website at commit f0b4f817 (the repo has no tags). It reads the ## Removed features table, | Legacy API | Replacement API |.
  • 7 package_release events for PyPI newrelic, version 11.0.0 (a package version: the client's package gate handles it). 11.0.0 is yanked on PyPI; 11.0.1 has the same public API (agent.py and api/log.py are identical).
    • renamed_symbol, 2: agent.add_custom_parameter → agent.add_custom_attribute, and agent.add_custom_parameters → agent.add_custom_attributes. At 10.17.0 each just warns and calls its replacement with the same parameter names, so the client's automatic rename is right on both sides of the upgrade.
    • removed_symbol, 5: agent.accept_distributed_trace_payload, agent.create_distributed_trace_payload, agent.get_browser_timing_footer, agent.record_exception and api.log.NewRelicLogHandler. Their replacements take different arguments or behave differently (the footer returns "" at 10.17.0), so a rename would break code. Each replacement is in the hint.
    • Dropped and logged: the lambda_handler & LambdaHandlerWrapper row (moved to another package; a known gap).
  • Symbol paths are as code reaches them after import newrelic. The six functions were re-exported by newrelic/agent.py at 10.17.0. NewRelicLogHandler was only ever in newrelic.api.log.
  • Shared, all with zero values keeping today's behavior (NumPy's and PostHog's goldens are byte-identical):
    • new Guide.DropIns: only these become renames;
    • new Guide.Doc: the source's name in the hint;
    • new Guide.LinkBase: makes the source's site-relative links absolute in the hint, since the hint appears in GitHub issues;
    • soleName reads a [name](url) cell;
    • Paths also maps the replacement.

⚠️ For the maintainers: the test data's license

New Relic's docs content is CC BY-NC-SA 4.0, which is non-commercial and share-alike. The plugin reads the public page at runtime. For the rule that requires a saved copy, the test data is a 33-line excerpt: the section's two tables, which are mostly API and setting names, every line unchanged. It's marked "Excerpt for testing; © New Relic, CC BY-NC-SA 4.0", with what was left out stated, the way vendor documentation pages are handled here. Please confirm that's acceptable in this Apache-2.0 repo. If it isn't, the plugin can stay and the excerpt can be replaced or dropped.

Checklist

  • Added to docs/plugins.md: new row (Layer SDK, status live), docs/plugins.json regenerated, README badge now 24. I compared the registered plugins with the table.
  • Every commit is signed off (DCO)
  • Golden test over the saved excerpt (plugins/removedmembers/testdata/golden/newrelic-11.0.0.json). The excerpt gives the same events as the full 136-line file.
  • testdata/README.md row: the raw URL at the commit, date, license, quote, what was left out.
  • Pinned drop test: the lambda row and the settings tables produce no event, and each is shown to be read (not vacuous). Plus tests for the link-cell parsing and for LinkBase.
  • providers/newrelic.md from the template. Why this source covers the alternatives:
    • REST API v2 spec: live-only, 0 deprecated flags, and "deprecated after" descriptions that New Relic's own end-of-life notice contradicts for 10 of 12;
    • NerdGraph: GraphQL, outside the event contract;
    • end-of-life notices: dates edited after publication in 4 of 29, and only 1 names REST operations;
    • Node agent: 1 removed public method across 8 majors.
  • Fetches only through env.Get.
  • make check passes.
  • Nothing private.

Notes for the reviewer

An independent review checked every symbol against newrelic-python-agent at v10.17.0, v11.0.0 and v11.0.1.

  • It found no wrong event and nothing under-reported.
  • It confirmed the two renames are drop-ins with identical parameter names.
  • It mutation-tested each new mechanism: every deliberate break made tests fail.
  • Its fixes are included: absolute links in hints, and three provider-page wording corrections.

🤖 Generated with Claude Code

brandonphelps1212 and others added 2 commits November 19, 2026 18:32
Members removed from New Relic's Python agent 11.0.0, read from the
release note's "Legacy API" table at a docs-website commit. Only the two
drop-in replacements are renames (a new Guide field, DropIns); a replacement
written as a Markdown link around a code span is read as its name. The
numpy and posthog goldens are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: brandonphelps1212 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: brandonphelps1212 <[email protected]>
@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Claude finished @brandonphelps1212's task in 1m 49s —— View job


✅ Ready to merge. The code and tests follow every repo rule and I found no bugs. Before merging, a maintainer still needs to decide whether the CC BY-NC-SA test excerpt is acceptable (see below).

Rules

Rule Status Evidence
Plugin list (Rule 1) ✅ The newrelic row is inside the plugins:start/end markers and uses absolute links. docs/plugins.json is regenerated (count 24) and so is the README badge. The pinned-release sentence names newrelic 11.0.0. The registry has NumPy2, PostHog8 and NewRelic11 for removedmembers, and each has a row. go test passes, which means plugins.json is up to date.
Provider page ✅ providers/newrelic.md follows the template. Its Why this source has the link and commit, the date checked (2026-11-19), why this source is the best one, four alternatives with concrete reasons (REST v2 spec, NerdGraph, EOL notices, Node agent) and a quote. It is also listed in providers/README.md.
Golden test + dated quote ✅ testdata/golden/newrelic-11.0.0.json has 7 events. The testdata/README.md row gives the raw URL at the commit, the date, the license, what was left out, and a quote. The NumPy and PostHog goldens are unchanged.
Drop test ✅ TestNewRelicDropsWhatIsNotARemovedMember pins the lambda row and the settings table. For each one it also shows that the input would be read as names if its rule were off, so the test isn't vacuous.
Source on every event ✅ Each event has source_url (the raw URL at the commit) and a source_excerpt holding the section heading, the table header and the row.
Fetch only via env ✅ The new code only adds a Guide value and parsing. The fetch still goes through the existing Run with env.Get. There's no net/http, and file I/O happens only in tests (t.TempDir, testdata/).
Precision over recall ✅ Only the two drop-ins listed in DropIns become renamed_symbol. The other five are removed_symbol with the replacement in the hint. The & row and the settings table are dropped. DropIns == nil keeps today's behavior for NumPy and PostHog.
Nothing private (Rule 2) ✅ I found no credentials, internal names or session links in the code, docs, commits or PR body. The leak guard passes.
DCO ✅ Both commits have Signed-off-by.

Bugs

None found.

For the maintainers: the test data's license

The excerpt is CC BY-NC-SA 4.0. The license terms already in this repo's testdata are less restrictive:

  • the GitHub feed: "Excerpt for testing; © GitHub, Inc.";
  • Google Cloud and Cloudflare: CC BY 4.0;
  • GitLab: CC BY-SA 4.0.

The NC (non-commercial) clause is new here. The author flagged it in the PR body. Someone with authority over licensing should sign off on it. If it isn't acceptable, the plugin can stay as it is, and only the 33-line .mdx and the golden/drop tests that use it would need replacing.

Verified

  • go build ./...: ok
  • go vet ./...: no output
  • gofmt -l .: printed nothing
  • go test -race ./...: all packages ok, including plugins/removedmembers, plugins/all and internal/pluginlist
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"
  • TODO(new-plugin): only in docs and tooling, none in the new files
  • I did not run make check (the runner required approval for it). The individual checks above cover most of it; I didn't separately run make tidy, make imports or make nethttp.

Non-blocking

  • absoluteLinks (removedmembers.go:307) would turn a protocol-relative ](//host/…) into https://docs.newrelic.com//host/…. This page has no such link; details are in the inline comment.
  • Paths now also applies to the replacement. A future guide whose Paths maps a member but not its replacement would emit a rename whose two sides use different prefixes (agent.x → y). One option is to have TestNewRelicEachRowOfTheTable-style checks, or a general one, assert that every renamed replacement has a Paths entry whenever its member does.

Thanks for the thorough source comparison and for testing that the drop test actually reads its input.

if g.LinkBase == "" {
return s
}
return strings.ReplaceAll(s, "](/", "]("+strings.TrimSuffix(g.LinkBase, "/")+"/")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: a protocol-relative link (](//cdn.example/x)) would also match ](/ and become https://docs.newrelic.com//cdn.example/x. New Relic's release note has no such link today, so nothing breaks now. If another guide sets LinkBase later, one way to rule it out is to skip targets that start with //.

@brandonphelps1212
brandonphelps1212 merged commit 6264918 into main Nov 19, 2026
7 checks passed
@brandonphelps1212
brandonphelps1212 deleted the newrelic-plugin branch November 19, 2026 23:44
@brandonphelps1212 brandonphelps1212 mentioned this pull request Nov 19, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant