GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — improvement(new-relic): validate integration against NerdGraph docs, surface more entity fields by waleedlatif1 · Pull Request #5443 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Validated all 4 New Relic tools (nrql_query, search_entities, get_entity, create_deployment_event) and the block against live NerdGraph API docs — auth, region endpoints, request/response shapes, and GraphQL injection handling all confirmed correct
  • Added domain, reporting, alertSeverity, and tags to get_entity/search_entities outputs — stable New Relic Entity schema fields we weren't surfacing. Purely additive, no existing fields changed or renamed
  • Considered NerdGraph's aiIssues/incidents API but skipped it — New Relic marks it "unsafe experimental," requires an opt-in header, and can break without notice

Type of Change

  • Enhancement / validation pass

Testing

Tested manually: typecheck (bun run type-check) and lint (bun run lint) both pass clean. Ran 5 independent audits (one per tool + one for block/registry wiring) against live New Relic docs to confirm alignment and backwards compatibility.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@waleedlatif1
improvement(new-relic): validate integration against NerdGraph docs, …
89ab39a
…surface more entity fields

- Audited all 4 New Relic tools (nrql_query, search_entities, get_entity,
  create_deployment_event) plus the block against live NerdGraph API docs;
  request/response shapes, auth, region endpoints, and GraphQL injection
  handling all confirmed correct.
- Added domain, reporting, alertSeverity, and tags to get_entity and
  search_entities outputs — stable Entity schema fields we weren't
  surfacing. Purely additive, no existing fields changed.
- Skipped NerdGraph's aiIssues/incidents API; New Relic marks it "unsafe
  experimental" and requires an opt-in header, not worth the fragility.
@vercel

vercel Bot commented Jul 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 6, 2026 10:16pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Jul 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Low Risk
Additive NerdGraph fields and response mapping only; no auth, request parameters, or existing output fields were removed or renamed.

Overview
Search Entities and Get Entity now return richer NerdGraph entity payloads: domain, reporting, alertSeverity, and tags (in addition to guid, name, and entityType). The tools’ GraphQL queries request those fields via AlertableEntity / AlertableEntityOutline fragments, and responses are shaped through a shared normalizeNewRelicEntity helper and updated NewRelicEntity types.

The New Relic block’s entities and entity output descriptions are updated so workflows document the expanded shape. Existing fields are unchanged; this is additive for consumers that only used the prior three fields.

Reviewed by Cursor Bugbot for commit 7729599. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 6, 2026
View reviewed changes
Comment thread apps/sim/tools/new_relic/search_entities.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Jul 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the New Relic integration by surfacing four additional entity fields (domain, reporting, alertSeverity, tags) across the get_entity and search_entities tools, and introduces a shared normalizeNewRelicEntity utility that consistently null-coalesces every field in a single place.

  • Adds NewRelicRawEntity type and normalizeNewRelicEntity to utils.ts, replacing ad-hoc inline normalization with a single reusable function used by both tools.
  • Updates both GraphQL queries to select the new fields (domain, reporting, ... on AlertableEntity/AlertableEntityOutline { alertSeverity }, tags { key values }), and updates output schemas and block descriptions accordingly.
  • The change is purely additive: existing fields (guid, name, entityType) and their semantics are unchanged, and backward compatibility is maintained.

Confidence Score: 5/5

Safe to merge — changes are purely additive, all new fields are null-coalesced, and both tools now share the same normalization path.

The raw-entity passthrough concern raised in the previous review has been fully addressed: search_entities now maps every entity through normalizeNewRelicEntity before returning it, matching what get_entity already did. The new normalizeNewRelicEntity utility handles every nullable field consistently, the inline fragment names (AlertableEntityOutline vs AlertableEntity) are correct for their respective query contexts, and gqlString (backed by JSON.stringify) prevents GraphQL injection in the get_entity query. No existing fields or response shapes were changed.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/tools/new_relic/utils.ts Adds NewRelicRawEntity interface and normalizeNewRelicEntity helper; normalization is thorough with null-coalescing on every field and safe tag iteration.
apps/sim/tools/new_relic/get_entity.ts Adopts NewRelicRawEntity and normalizeNewRelicEntity; guid is correctly injected from params after spread; inline fragment uses the right AlertableEntity (full entity, not outline).
apps/sim/tools/new_relic/search_entities.ts Now correctly maps raw entities through normalizeNewRelicEntity, resolving the previous raw-passthrough issue; uses AlertableEntityOutline correctly for entity search results.
apps/sim/tools/new_relic/types.ts NewRelicEntity extended with domain, reporting, alertSeverity, and tags; new NewRelicEntityTag interface added; all nullable types are consistent with normalization logic.
apps/sim/blocks/blocks/new_relic.ts Block output descriptions updated to reflect new entity fields; change is cosmetic/documentation-only, correctly aligned with tool output schemas.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Caller
    participant Tool as get_entity / search_entities
    participant Utils as utils.ts
    participant NerdGraph as New Relic NerdGraph

    Caller->>Tool: invoke(params)
    Tool->>NerdGraph: POST /graphql (guid/query/cursor, new fields: domain, reporting, alertSeverity, tags)
    NerdGraph-->>Tool: "GraphQLResponse<RawEntity[]>"
    Tool->>Utils: parseNerdGraphResponse()
    Utils-->>Tool: typed payload
    Tool->>Utils: normalizeNewRelicEntity(rawEntity)
    Note over Utils: null-coalesces guid, name, entityType,<br/>domain, reporting, alertSeverity, tags
    Utils-->>Tool: NewRelicEntity (fully normalized)
    Tool-->>Caller: "{ success, output: { entity / entities } }"
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Caller
    participant Tool as get_entity / search_entities
    participant Utils as utils.ts
    participant NerdGraph as New Relic NerdGraph

    Caller->>Tool: invoke(params)
    Tool->>NerdGraph: POST /graphql (guid/query/cursor, new fields: domain, reporting, alertSeverity, tags)
    NerdGraph-->>Tool: "GraphQLResponse<RawEntity[]>"
    Tool->>Utils: parseNerdGraphResponse()
    Utils-->>Tool: typed payload
    Tool->>Utils: normalizeNewRelicEntity(rawEntity)
    Note over Utils: null-coalesces guid, name, entityType,<br/>domain, reporting, alertSeverity, tags
    Utils-->>Tool: NewRelicEntity (fully normalized)
    Tool-->>Caller: "{ success, output: { entity / entities } }"
Loading

Reviews (3): Last reviewed commit: "fix(new-relic): gate alertSeverity behin..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
fix(new-relic): normalize search_entities output, share entity normal…
bf5beaa
…ization

search_entities passed raw NerdGraph entities straight through, so tags/
domain/reporting/alertSeverity could arrive as null/undefined at runtime
despite the non-nullable NewRelicEntity type contract — a .map() on a
null tags array would throw. get_entity already normalized these fields
correctly.

Extracted the normalization into a shared normalizeNewRelicEntity() in
utils.ts and reuse it from both tools, so the two can't drift again.
@vercel
vercel Bot temporarily deployed to Preview July 6, 2026 21:49 Inactive
@waleedlatif1

waleedlatif1 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed — extracted a shared normalizeNewRelicEntity() helper in utils.ts and now use it in both get_entity.ts and search_entities.ts, so entities/tags/scalars are always normalized to the typed null/[] shape regardless of what NerdGraph omits. Pushed in bf5beaa.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile review

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 6, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit bf5beaa. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1
fix(new-relic): gate alertSeverity behind required GraphQL interface …
7729599
…fragments

alertSeverity isn't a direct field on New Relic's Entity/EntityOutline
types — it only exists on the AlertableEntity/AlertableEntityOutline
sub-interfaces, and NerdGraph rejects the query outright without the
inline fragment. get_entity.ts (entity(guid), returns Entity) now uses
`... on AlertableEntity { alertSeverity }`; search_entities.ts
(entitySearch, returns EntityOutline) now uses
`... on AlertableEntityOutline { alertSeverity }`. Confirmed against
New Relic's live NerdGraph entities API docs.
@vercel
vercel Bot temporarily deployed to Preview July 6, 2026 22:16 Inactive
@waleedlatif1

waleedlatif1 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up from an additional independent verification pass (re-checked every field against New Relic's live NerdGraph docs from scratch, including backwards-compat diffing against origin/staging): found that alertSeverity isn't a direct field on the Entity/EntityOutline types — it only exists on the AlertableEntity/AlertableEntityOutline sub-interfaces, so NerdGraph would reject both queries outright without an inline fragment. Fixed in 7729599: get_entity.ts now uses ... on AlertableEntity { alertSeverity }, search_entities.ts uses ... on AlertableEntityOutline { alertSeverity }. Everything else (domain/reporting/tags) is fine as direct fields per the docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile review

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed Jul 6, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7729599. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1
waleedlatif1 merged commit 0363451 into staging Jul 6, 2026
18 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the validate/new-relic-integration branch July 6, 2026 22:33
@waleedlatif1 waleedlatif1 mentioned this pull request Jul 7, 2026
v0.7.24: frontend perf improvements, md editor fixes, mailer fix, tools audit #5458
Merged

This branch was previously deployed

1 inactive deployment
Preview — 77295994 Deployed Jul 6, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@waleedlatif1
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.