Custom Data Check

Custom data check is a flexible check that can query by any relation in configure8 system and custom data pushed via Data Flexibility schemas. This page contains logic and samples for it.

Description: This check compares a service's existing or dynamically calculated property against the specified value.

Learn more about calculated properties and custom data checks on that section in Data Flexibility docs here.

Property Type: Custom-calculated property, existing property

Existing property: All properties from System Inherited Data Model and Data Model JSON the Service schema.

Custom calculated property: You can create your own calculated property using relation in the Service schema or data in details property in the service entity.

The key info to navigate through the schemas relation is the relation name from the service side. You can check those relation names by going to Settings -> Add Schema -> Select service schema. Or entering your service schema in the list if already extended before.

Comparison Type: Number, version, text, boolean

Threshold: Integer number, text, boolean

Example 1: Find the count of Snyk issues for service:

{
   "type": "FUNCTION",
   "aggregation": "COUNT",
   "path": "resources.snykIssues.id",
   "filter": []
}

Example 2: Query by path in service entity details property. Find count open incidents in PagerDuty for service:

{
   "type": "PATH",
   "path": "details.incidents.openedIncidents.PagerDuty"
}

Example 3: Find count resources filtering by type AWS:EKS:Cluster:

{
   "type": "FUNCTION",
   "aggregation": "COUNT",
   "path": "resources.id",
   "filter": [
     {
        "type": "compare",
        "field": "resources.providerResourceType",
        "value": "AWS:EKS:Cluster",
        "compare": "eq"
      }
   ]
}

Example 4: Find count resources in all environments that have the "app" Tag

{
  "type": "FUNCTION",
  "aggregation": "COUNT",
  "path": "resources.id",
  "filter": [
    {
      "type": "compare",
      "field": "resources.details.Tags",
      "value": "%app%",
      "compare": "like"
    }
  ]
}

Example 5: Do the average number of applications and environments of a service

You cannot nest Aggregations, so in this case we're making the average by dividing the count of applications and environments by 2

{
  "type": "MATH",
  "condition": "/",
  "values": [
    {
      "type": "MATH",
      "condition": "+",
      "values": [{
        "type": "FUNCTION",
        "aggregation": "COUNT",
        "path": "applications.id"
      },
      {
        "type": "FUNCTION",
        "aggregation": "COUNT",
        "path": "environments.id"
      }]
    },
    {
      "type": "NUMBER",
      "value": 2
    }
  ]
}
{
  "type": "MATH",
  "condition": "*",
  "values": [
    {
      "type": "MATH",
      "condition": "/",
      "values": [
        {
          "type": "FUNCTION",
          "aggregation": "COUNT",
          "path": "IncidentsServices.id"
        },
        {
          "type": "FUNCTION",
          "aggregation": "COUNT",
          "path": "DeploysServices.id"
        }
      ]
    },
    {
      "type": "NUMBER",
      "value": 100
    }
  ]
}

Example 7: Get Name of Latest Deploy by Stop time

{
  "type": "FUNCTION",
  "aggregation": "MAX_BY",
  "values": [
    {
      "type": "PATH",
      "path": "DeploysServices.name"
    },
    {
      "type": "PATH",
      "path": "DeploysServices.Stop"
    }
  ]
}

Example 8: Get latest (by stop time) Deploy Duration filtered by Environment and Branch

{
  "type": "FUNCTION",
  "aggregation": "MAX_BY",
  "values": [
    {
      "type": "PATH",
      "path": "DeploysServices.Duration"
    },
    {
      "type": "PATH",
      "path": "DeploysServices.Stop"
    }
  ],
  "filter": [
    {
      "type": "and",
      "conditions": [
        {
          "type": "compare",
          "field": "DeploysServices.Environment",
          "value": "prod",
          "compare": "eq"
        },
        {
          "type": "compare",
          "field": "DeploysServices.Branch",
          "value": "main",
          "compare": "eq"
        }
      ]
    }
  ]
}

Last updated

Copyright © 2023 configure8, Inc. All rights reserved.