From 657281caf54099ffe3c202a0ba65ec04135f4633 Mon Sep 17 00:00:00 2001 From: aprasad Date: Tue, 21 Jul 2026 12:37:06 +0530 Subject: [PATCH 1/4] feat: Add OCIDYNAMICROUTINGGATEWAY entity definition (staging) Add OCI Dynamic Routing Gateway entity definition with: - Entity definition with synthesis rules (identifier oci.drgOcid, prefix ocid1.drg) - Golden metrics (bytes to/from DRG, packet drops to/from DRG attachment) - Summary metrics - Test data - Using .stg.yml/.stg.json suffix (staging only) DRG metrics are emitted per DRG attachment; dimension resourceId is the attachment OCID and drgOcid is the DRG. Synthesis keys on oci.drgOcid so the entity represents the DRG. Metric source: https://docs.oracle.com/en-us/iaas/Content/Network/Reference/drgmetrics.htm Co-Authored-By: Claude Opus 4.8 --- .../definition.stg.yml | 34 ++++++++++++++++++ .../golden_metrics.stg.yml | 36 +++++++++++++++++++ .../summary_metrics.stg.yml | 21 +++++++++++ .../tests/Metric.stg.json | 22 ++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 entity-types/infra-ocidynamicroutinggateway/definition.stg.yml create mode 100644 entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml create mode 100644 entity-types/infra-ocidynamicroutinggateway/summary_metrics.stg.yml create mode 100644 entity-types/infra-ocidynamicroutinggateway/tests/Metric.stg.json diff --git a/entity-types/infra-ocidynamicroutinggateway/definition.stg.yml b/entity-types/infra-ocidynamicroutinggateway/definition.stg.yml new file mode 100644 index 000000000..ba0624294 --- /dev/null +++ b/entity-types/infra-ocidynamicroutinggateway/definition.stg.yml @@ -0,0 +1,34 @@ +domain: INFRA +type: OCIDYNAMICROUTINGGATEWAY +goldenTags: +- oci.compartmentId +- oci.displayName +- oci.lifecycleState +- oci.region +configuration: + entityExpirationTime: DAILY + alertable: true +synthesis: + tags: + newrelic.cloudIntegrations.providerAccountName: + entityTagNames: [newrelic.cloudIntegrations.providerAccountName, providerAccountName] + multiValue: false + rules: + # DRG metrics are emitted per DRG attachment: dimension resourceId is the DRG + # attachment OCID (ocid1.drgattachment), while drgOcid is the DRG itself + # (ocid1.drg). The entity represents the DRG, so synthesis keys on oci.drgOcid. + # Ref: https://docs.oracle.com/en-us/iaas/Content/Network/Reference/drgmetrics.htm + - ruleName: infra_ocidynamicroutinggateway_oci_drgOcid + identifier: oci.drgOcid + name: oci.drgOcid + legacyFeatures: + overrideGuidType: true + encodeIdentifierInGUID: true + conditions: + - attribute: oci.drgOcid + prefix: "ocid1.drg" + - attribute: oci.namespace + value: "oci_dynamic_routing_gateway" +ownership: + primaryOwner: + teamName: "Cloud Monitoring Platform" diff --git a/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml b/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml new file mode 100644 index 000000000..d8245d715 --- /dev/null +++ b/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml @@ -0,0 +1,36 @@ +bytesToDrgAttachment: + title: Bytes Sent From DRG + unit: BYTES + queries: + oci: + select: sum(oci.dynamic.routing.gateway.bytes.to.drg.attachment) + from: Metric + eventId: entity.guid + eventName: entity.name +bytesFromDrgAttachment: + title: Bytes Sent To DRG + unit: BYTES + queries: + oci: + select: sum(oci.dynamic.routing.gateway.bytes.from.drg.attachment) + from: Metric + eventId: entity.guid + eventName: entity.name +packetDropsToDrgAttachment: + title: Packet Drops To DRG Attachment + unit: COUNT + queries: + oci: + select: sum(oci.dynamic.routing.gateway.packet.drops.to.drg.attachment) + from: Metric + eventId: entity.guid + eventName: entity.name +packetDropsFromDrgAttachment: + title: Packet Drops From DRG Attachment + unit: COUNT + queries: + oci: + select: sum(oci.dynamic.routing.gateway.packet.drops.from.drg.attachment) + from: Metric + eventId: entity.guid + eventName: entity.name diff --git a/entity-types/infra-ocidynamicroutinggateway/summary_metrics.stg.yml b/entity-types/infra-ocidynamicroutinggateway/summary_metrics.stg.yml new file mode 100644 index 000000000..e9e606107 --- /dev/null +++ b/entity-types/infra-ocidynamicroutinggateway/summary_metrics.stg.yml @@ -0,0 +1,21 @@ +providerAccountName: + tag: + key: providerAccountName + title: OCI account + unit: STRING +bytesToDrgAttachment: + goldenMetric: bytesToDrgAttachment + unit: BYTES + title: Bytes Sent From DRG +bytesFromDrgAttachment: + goldenMetric: bytesFromDrgAttachment + unit: BYTES + title: Bytes Sent To DRG +packetDropsToDrgAttachment: + goldenMetric: packetDropsToDrgAttachment + unit: COUNT + title: Packet Drops To DRG Attachment +packetDropsFromDrgAttachment: + goldenMetric: packetDropsFromDrgAttachment + unit: COUNT + title: Packet Drops From DRG Attachment diff --git a/entity-types/infra-ocidynamicroutinggateway/tests/Metric.stg.json b/entity-types/infra-ocidynamicroutinggateway/tests/Metric.stg.json new file mode 100644 index 000000000..f0e91ee39 --- /dev/null +++ b/entity-types/infra-ocidynamicroutinggateway/tests/Metric.stg.json @@ -0,0 +1,22 @@ +[ + { + "oci.compartmentId": "ocid1.compartment.oc1..aaaaaaaabbbbbbccccccccdddddddeeeeeeefffffffgggggggghhhhhhhhiiiiiiiiijjjjjjjj", + "oci.namespace": "oci_dynamic_routing_gateway", + "oci.region": "us-ashburn-1", + "oci.resourceId": "ocid1.drgattachment.oc1.iad.aaaaaaaabbbbbbccccccccdddddddeeeeeeefffffffgggggggghhhhhhhhiiiiiiiiijjjjjjjj", + "oci.drgOcid": "ocid1.drg.oc1.iad.aaaaaaaabbbbbbccccccccdddddddeeeeeeefffffffgggggggghhhhhhhhiiiiiiiiikkkkkkkk", + "oci.drgRouteTableId": "ocid1.drgroutetable.oc1.iad.aaaaaaaabbbbbbccccccccdddddddeeeeeeefffffffgggggggghhhhhhhhiiiiiiiiillllllll", + "oci.attachmentType": "VCN", + "oci.displayName": "test-drg", + "oci.lifecycleState": "AVAILABLE", + "collector.name": "oci-monitor", + "displayName": "test-drg", + "instrumentation.provider": "oci", + "metricName": "oci.dynamic.routing.gateway.bytes.to.drg.attachment", + "newrelic.cloudIntegrations.integrationName": "OCI Monitor metrics", + "newrelic.cloudIntegrations.providerAccountId": "1", + "newrelic.cloudIntegrations.providerAccountName": "oci-dev-all-metrics", + "newrelic.source": "metricAPI", + "timestamp": 1746680903 + } +] From a92a163cc6ff7aecf1a47be5421f98b358d1e463 Mon Sep 17 00:00:00 2001 From: aprasad-sketch Date: Tue, 21 Jul 2026 14:09:31 +0530 Subject: [PATCH 2/4] fix(ocidrg): correct swapped Bytes To/From DRG golden metric titles --- .../infra-ocidynamicroutinggateway/golden_metrics.stg.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml b/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml index d8245d715..b1420c5e6 100644 --- a/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml +++ b/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml @@ -1,5 +1,5 @@ bytesToDrgAttachment: - title: Bytes Sent From DRG + title: Bytes To DRG Attachment unit: BYTES queries: oci: @@ -8,7 +8,7 @@ bytesToDrgAttachment: eventId: entity.guid eventName: entity.name bytesFromDrgAttachment: - title: Bytes Sent To DRG + title: Bytes From DRG Attachment unit: BYTES queries: oci: From 79d3858e1e18a86bc3d45fec0b9bb9caf8585cf8 Mon Sep 17 00:00:00 2001 From: aprasad-sketch Date: Tue, 21 Jul 2026 14:10:21 +0530 Subject: [PATCH 3/4] fix(ocidrg): correct swapped Bytes To/From DRG summary metric titles --- .../infra-ocidynamicroutinggateway/summary_metrics.stg.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entity-types/infra-ocidynamicroutinggateway/summary_metrics.stg.yml b/entity-types/infra-ocidynamicroutinggateway/summary_metrics.stg.yml index e9e606107..b83c3a0cb 100644 --- a/entity-types/infra-ocidynamicroutinggateway/summary_metrics.stg.yml +++ b/entity-types/infra-ocidynamicroutinggateway/summary_metrics.stg.yml @@ -6,11 +6,11 @@ providerAccountName: bytesToDrgAttachment: goldenMetric: bytesToDrgAttachment unit: BYTES - title: Bytes Sent From DRG + title: Bytes To DRG Attachment bytesFromDrgAttachment: goldenMetric: bytesFromDrgAttachment unit: BYTES - title: Bytes Sent To DRG + title: Bytes From DRG Attachment packetDropsToDrgAttachment: goldenMetric: packetDropsToDrgAttachment unit: COUNT From 623743e714ce254475686c575b48b92000a4681b Mon Sep 17 00:00:00 2001 From: aprasad Date: Thu, 23 Jul 2026 19:10:04 +0530 Subject: [PATCH 4/4] fix: backtick-quote DRG golden metric names (NRQL reserved word 'from') The metric names contain '.from.' (bytes.from / packet.drops.from). 'from' is a reserved NRQL keyword, so the unquoted metric name fails the golden-metrics NRQL validator (DiracParserException). Wrap all four metric names in backticks, matching the existing oci_service_connector_hub golden metrics. Co-Authored-By: Claude Opus 4.8 --- .../infra-ocidynamicroutinggateway/golden_metrics.stg.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml b/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml index b1420c5e6..5856110e7 100644 --- a/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml +++ b/entity-types/infra-ocidynamicroutinggateway/golden_metrics.stg.yml @@ -3,7 +3,7 @@ bytesToDrgAttachment: unit: BYTES queries: oci: - select: sum(oci.dynamic.routing.gateway.bytes.to.drg.attachment) + select: sum(`oci.dynamic.routing.gateway.bytes.to.drg.attachment`) from: Metric eventId: entity.guid eventName: entity.name @@ -12,7 +12,7 @@ bytesFromDrgAttachment: unit: BYTES queries: oci: - select: sum(oci.dynamic.routing.gateway.bytes.from.drg.attachment) + select: sum(`oci.dynamic.routing.gateway.bytes.from.drg.attachment`) from: Metric eventId: entity.guid eventName: entity.name @@ -21,7 +21,7 @@ packetDropsToDrgAttachment: unit: COUNT queries: oci: - select: sum(oci.dynamic.routing.gateway.packet.drops.to.drg.attachment) + select: sum(`oci.dynamic.routing.gateway.packet.drops.to.drg.attachment`) from: Metric eventId: entity.guid eventName: entity.name @@ -30,7 +30,7 @@ packetDropsFromDrgAttachment: unit: COUNT queries: oci: - select: sum(oci.dynamic.routing.gateway.packet.drops.from.drg.attachment) + select: sum(`oci.dynamic.routing.gateway.packet.drops.from.drg.attachment`) from: Metric eventId: entity.guid eventName: entity.name