diff --git a/entity-types/infra-ocivpn/definition.stg.yml b/entity-types/infra-ocivpn/definition.stg.yml new file mode 100644 index 000000000..10f128e68 --- /dev/null +++ b/entity-types/infra-ocivpn/definition.stg.yml @@ -0,0 +1,50 @@ +domain: INFRA +type: OCIVPN +goldenTags: +- oci.compartmentId +- oci.region +- oci.displayName +- oci.lifecycleState +- oci.cpeId +- oci.drgId +configuration: + entityExpirationTime: DAILY + alertable: true +synthesis: + tags: + newrelic.cloudIntegrations.providerAccountName: + entityTagNames: [newrelic.cloudIntegrations.providerAccountName, providerAccountName] + multiValue: false + rules: + # Metrics path: oci_vpn metrics carry `parentResourceId` (the IPSec connection OCID) + # and `publicIp` (per-tunnel) — there is NO `resourceId` dimension. + # Ref: https://docs.oracle.com/en-us/iaas/Content/Network/Reference/ipsecmetrics.htm + - ruleName: infra_ocivpn_oci_parentResourceId + identifier: oci.parentResourceId + # Raw oci_vpn metrics have no name dimension; fall back to the connection OCID. + # The inventory rule below (same OCID value => same GUID) supplies the friendly name. + name: oci.parentResourceId + legacyFeatures: + overrideGuidType: true + encodeIdentifierInGUID: true + conditions: + - attribute: oci.parentResourceId + prefix: "ocid1.ipsecconnection" + - attribute: oci.namespace + value: "oci_vpn" + # Inventory path: beyond-workers polling feeds `oci.resourceId` (connection OCID) + + # `oci.resourceName`. Same OCID value as parentResourceId above => same entity GUID. + - ruleName: infra_ocivpn_oci_resourceId + identifier: oci.resourceId + name: oci.resourceName + legacyFeatures: + overrideGuidType: true + encodeIdentifierInGUID: true + conditions: + - attribute: oci.resourceId + prefix: "ocid1.ipsecconnection" + - attribute: oci.namespace + value: "oci_vpn" +ownership: + primaryOwner: + teamName: "Cloud Monitoring Platform" diff --git a/entity-types/infra-ocivpn/golden_metrics.stg.yml b/entity-types/infra-ocivpn/golden_metrics.stg.yml new file mode 100644 index 000000000..a48a4ed0e --- /dev/null +++ b/entity-types/infra-ocivpn/golden_metrics.stg.yml @@ -0,0 +1,36 @@ +tunnelState: + title: IPSec Tunnel State (Up=1 / Down=0) + unit: COUNT + queries: + oci: + select: average(oci.vpn.tunnel.state) + from: Metric + eventId: entity.guid + eventName: entity.name +bytesSent: + title: Bytes Sent + unit: BYTES + queries: + oci: + select: sum(oci.vpn.bytes.sent) + from: Metric + eventId: entity.guid + eventName: entity.name +bytesReceived: + title: Bytes Received + unit: BYTES + queries: + oci: + select: sum(oci.vpn.bytes.received) + from: Metric + eventId: entity.guid + eventName: entity.name +packetsError: + title: Packets with Errors + unit: COUNT + queries: + oci: + select: sum(oci.vpn.packets.error) + from: Metric + eventId: entity.guid + eventName: entity.name diff --git a/entity-types/infra-ocivpn/summary_metrics.stg.yml b/entity-types/infra-ocivpn/summary_metrics.stg.yml new file mode 100644 index 000000000..c51a39263 --- /dev/null +++ b/entity-types/infra-ocivpn/summary_metrics.stg.yml @@ -0,0 +1,21 @@ +providerAccountName: + tag: + key: providerAccountName + title: OCI account + unit: STRING +tunnelState: + goldenMetric: tunnelState + unit: COUNT + title: IPSec Tunnel State (Up=1 / Down=0) +bytesSent: + goldenMetric: bytesSent + unit: BYTES + title: Bytes Sent +bytesReceived: + goldenMetric: bytesReceived + unit: BYTES + title: Bytes Received +packetsError: + goldenMetric: packetsError + unit: COUNT + title: Packets with Errors diff --git a/entity-types/infra-ocivpn/tests/Metric.stg.json b/entity-types/infra-ocivpn/tests/Metric.stg.json new file mode 100644 index 000000000..4a5fc9754 --- /dev/null +++ b/entity-types/infra-ocivpn/tests/Metric.stg.json @@ -0,0 +1,30 @@ +[ + { + "oci.compartmentId": "ocid1.compartment.oc1..exampleuniqueID", + "oci.namespace": "oci_vpn", + "oci.region": "us-ashburn-1", + "oci.parentResourceId": "ocid1.ipsecconnection.oc1.us-ashburn-1.exampleuniqueID", + "oci.publicIp": "203.0.113.10", + "collector.name": "oci-metric-streams", + "instrumentation.provider": "oci", + "metricName": "oci.vpn.tunnel.state", + "newrelic.cloudIntegrations.integrationName": "OCI Monitor metrics", + "newrelic.cloudIntegrations.providerAccountName": "oci-dev-all-metrics" + }, + { + "oci.compartmentId": "ocid1.compartment.oc1..exampleuniqueID", + "oci.namespace": "oci_vpn", + "oci.region": "us-ashburn-1", + "oci.resourceId": "ocid1.ipsecconnection.oc1.us-ashburn-1.exampleuniqueID", + "oci.resourceName": "test-vpn", + "oci.displayName": "test-vpn", + "oci.lifecycleState": "AVAILABLE", + "oci.cpeId": "ocid1.cpe.oc1.us-ashburn-1.exampleuniqueCpeID", + "oci.drgId": "ocid1.drg.oc1.us-ashburn-1.exampleuniqueDrgID", + "collector.name": "oci-metric-streams", + "instrumentation.provider": "oci", + "metricName": "oci.vpn.bytes.sent", + "newrelic.cloudIntegrations.integrationName": "OCI Monitor metrics", + "newrelic.cloudIntegrations.providerAccountName": "oci-dev-all-metrics" + } +]