Skip to content

fix: use oci.resourceName for OCIMYSQLDATABASE entity synthesis#3031

Closed
aprasad-sketch wants to merge 3 commits into
newrelic:mainfrom
aprasad-sketch:fix/ocimysqldatabase-synthesis-name
Closed

fix: use oci.resourceName for OCIMYSQLDATABASE entity synthesis#3031
aprasad-sketch wants to merge 3 commits into
newrelic:mainfrom
aprasad-sketch:fix/ocimysqldatabase-synthesis-name

Conversation

@aprasad-sketch

@aprasad-sketch aprasad-sketch commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix entity synthesis rule to use oci.resourceName instead of non-existent oci.resourceDisplayName
  • Update goldenTags to only reference attributes present in actual metric data
  • Update test file to match real metric payload from oci-metric-streams collector

Problem

Entities of type OCIMYSQLDATABASE are not appearing in the catalog page. The synthesis rule references oci.resourceDisplayName for the entity name, but the actual metric data from oci-metric-streams only contains oci.resourceName. This causes entity synthesis to fail silently — the entity GUID encodes type NA instead of OCIMYSQLDATABASE.

Verified via OCI CLI and NRQL queries against account 10876283 (staging) that:

  • oci.resourceName exists in all metric data points ✅
  • oci.resourceDisplayName does NOT exist ❌
  • oci.availabilityDomain, oci.displayName, oci.lifecycleState, oci.subscriptionId, oci.mysqlVersion, oci.shapeName do NOT exist in metric data ❌

ARB TICKET: https://new-relic.atlassian.net/browse/NR-577618

Fix

Aligned with existing OCI entity definitions (infra-ociautonomousdatabase, infra-ocipostgresqldatabase) which correctly use name: oci.resourceName.

Test plan

  • Verify synthesis test passes with updated Metric.stg.json
  • After deployment to staging, confirm entity GUID decodes to INFRA|OCIMYSQLDATABASE instead of INFRA|NA
  • Confirm entity appears in catalog page at one.newrelic.com > All Entities

Validation NRQL (post-deploy):

FROM Metric SELECT uniques(entity.guid) WHERE entity.type = 'OCIMYSQLDATABASE' SINCE 1 hour ago

🤖 Generated with Claude Code

The synthesis rule incorrectly referenced oci.resourceDisplayName which
does not exist in the actual metric payload from oci-metric-streams.
This caused entity synthesis to fail silently, resulting in entities
with type NA in the GUID that never appear in the catalog.

Changes:
- definition.stg.yml: name field changed to oci.resourceName (matching
  other OCI entity definitions like autonomousdatabase and postgresql)
- definition.stg.yml: goldenTags updated to only reference attributes
  that actually exist in metric data (oci.compartmentId, oci.region,
  oci.accountName)
- tests/Metric.stg.json: updated to match real metric payload structure
  from oci-metric-streams collector

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
entityBot
entityBot previously approved these changes Jul 9, 2026

@entityBot entityBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't think these changes require an API Review Board (ARB) review, so it is not required to merge this PR. Note that all API changes do require one: if you believe this PR needs an ARB review, please create the ticket and add the ARB:pending label. Reach #api-review-board in case of doubts.

@entityBot entityBot requested a review from a team July 9, 2026 11:21
Keep the original goldenTags as-is — they don't break synthesis and will
get populated when the collector starts sending those attributes from
inventory/API sources.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
entityBot
entityBot previously approved these changes Jul 9, 2026

@entityBot entityBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We don't think these changes require an API Review Board (ARB) review, so it is not required to merge this PR. Note that all API changes do require one: if you believe this PR needs an ARB review, please create the ticket and add the ARB:pending label. Reach #api-review-board in case of doubts.

@entityBot entityBot requested a review from a team July 9, 2026 11:33
Rename .stg.yml/.stg.json files to .yml/.json to deploy the entity
definition to production, enabling catalog visibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@entityBot entityBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

beep boop bop.

I have found some errors processing these changes:

  • No valid, approved ARB ticket found in the PR description. This PR has to be reviewed by the API Review Board, please include a link to the ticket of that review in the PR description. Check how to start the process here or reach #api-review-board channel in case of doubts

@entityBot entityBot requested review from a team and removed request for a team July 9, 2026 12:56
@aprasad-sketch

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants