This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

SPEKTRA Edge Alerting Service API

Understanding the Alerting service API.
  • 1:

Alerting service allows users to:

  • Setup automatic alerting based on time series and logs (Although logs are still not implemented yet).
  • Configure notifications receipt about alert changes
  • Use AI to diagnose & remediate alerts (when possible).

Full API Specifications (with resources):

  • Version v1

It uses data from:

Policy management and alerts

Alerting service is agnostic when it comes to observed resource types. SPEKTRA provides pre-defined templates for devices/pods, but it can be extended to custom services. Alerting usually uses monitoring/logging services, where users can specify relevant descriptors for time series and logs.

Most important resource in Alerting service is Policy: It is a container for conditions focused on specific resource type (like Device or Pod). Policy provides also a common specification regarding alert handling: It tells if AI agent should be enabled automatically, list of additional supporting queries to fetch correlated data, etc.

There are 2 types of generated alerts for time series:

  • THRESHOLD alert types are triggered when metric values exceed allowed range. For example, we can setup alert when CPU usage exceeds 85%. Threshold values can be global (in a project), or be customized per each reporting resource (adaptable, based on historic values).
  • ANOMALY alert types use AI algorithms to detect “unusual” patterns in time series metrics. It should be noted that each resource reporting metrics have its own patterns. It is assumed that each device can run different software, be on different hardware, have different workload. They may be powerful in detecting abnormal situations, but they have limitations.

It should be noted that THRESHOLD alerts are de facto mandatory. ANOMALY alerts can only be generated after sufficient amount of time passes. AI algorithms detecting anomalies require sufficient training data first. Depending on configuration, it may be week, two, four, or maybe more. During training data collection anomalies cant be detected. On top of that, characteristics of time series can change. For example, if software is upgraded, old patterns can be no longer valid. In that case, ANOMALY alerts cease to be meaningful. We need to wait sufficient of time again to collect new training data. Therefore, anomaly type alerts may be not always available. Threshold on the other hand can. Time Series conditions must always specify threshold configuration, while anomaly is optional. This ensures that we will always raise an alert beyond certain range.

Policies can be divided into 2 types, based on processing location:

  • BACKEND: Policy of this type indicates that alert detection is run by the backend itself. It is suitable especially for metrics like device connectivity. When device goes offline, it wont be able to generate “offline” alert on its own. The con of BACKEND based policy is poor support for ANOMALY alert types. AI Algorithms for detecting anomalies can be too heavy computationally if there are too many devices reporting: Remember that each device needs to learn its own patterns. If we have 25 observed metrics per device, and 10000 devices, it means 250000 unique time series that must be learnt separately. 10000 devices is also not very large, if we consider all projects.
  • EDGE: Policy of this type indicates that alert detection is run at the edge. In case of core SPEKTRA services, droplet is capable of monitoring its own metrics for devices.edgelq.com/device and applications.edgelq.com/pod resource types. Policy of this type can handle ANOMALY alerts. Since each device uses its own hardware, there is no risk of “AI workload backlog” growing from thousands of devices. Droplet can use spare free local resources to run anomaly detection. Drawback of EDGE policy is that it cant monitor certain metrics: most notably, connectivity metric. If device goes offline, it wont be able to send an alert that it is offline.

In SPEKTRA, we have two primary resource types that can raise alerts:

  • Device (from devices.edgelq.com service)
  • Pod (from applications.edgelq.com service)

It should be remembered that each Pod has assigned Device, therefore actual reporting happens on Device always.

Project administrator need to decide if they want to have ANOMALY and THRESHOLD alerts, or only THRESHOLD. If they opt for the former, it is advisable to have 4 policies for SPEKTRA core services:

  • BACKEND policy for Device resource (alerting resource is Device, the only resource label is device_id)
  • BACKEND policy for Pod resource (alerting resource is Device, resource labels are device_id and pod_id)
  • EDGE policy for Device resource (alerting resource is Device, the only resource label is device_id)
  • EDGE policy for Pod resource (alerting resource is Device, resource labels are device_id and pod_id)

If anomalies are not desired, administrator can create two BACKEND policies: One for Device, one for Pod.

Policies can be complex, therefore there are pre-defined templates. You can see them using command:

$ cuttle alerting list policy-templates --project public-alerting-templates --filter \
  'specTemplate.resourceIdentity.alertingResource="services/devices.edgelq.com/resources/Device"' \
  --field-mask supportingDocs --field-mask specTemplate -o json

The command above will display policy templates for core SPEKTRA services (applications and devices). Project public-alerting-templates is a public one containing all alerting templates that can be used in other projects. To see templates for core services, we filter specifically by Device resource type. It will return templates for both Device and Pod resource types. While it may look not intuitive first, it has a specific reason: All pod resources are attached to some device. Therefore, its always Device that is alerting.

In order to create a Policy in your project, you need to copy Documents (highly recommended), then create policy. Check field supportingDocs from PolicyTemplate. Get those documents, and copy:

$ cuttle alerting create document <document id> --project <my project ID> --title "<copied title>" \
  --mime-type "<copied type>" --content "<copied content>"

With documents prepared, create policy:

$ cuttle alerting create policy <policy id> --project <my project ID> --display-name "<display name of your choice>" \
  --spec '<copy paste JSON here from specTemplate>' \
  --template-source '{"template": "projects/public-alerting-templates/policyTemplates/<templateId>"}' \
  --supporting-docs '<first document...>' --supporting-docs '<second document...>' ... --supporting-docs '<last document>'

Each document name (supporting docs) must contain full format: projects/<project ID>/documents/<document ID>.

You can refer to PolicySpec for more details about spec.

Time Series Conditions

Once you have Policy resource, you can create TsCondition. It specifies:

  • List of observed time series queries (filters and aggregations, common alignment period and group by fields)
  • Threshold alerting configuration
  • Optional anomaly alerting configuration

Each TsCondition must belong to specific Policy. Group by fields in TsCondition spec must conform to alerting resource specified in Policy. For example, if Policy is for Device resource, then each TsCondition must specify device_id label in group by list. If Policy is for Pod resource (from applications.edgelq.com), then each TsCondition must specify device_id and pod_id labels in group by list. TsCondition can optionally specify extra labels if needed. Remember that each unique combination of group by values across the project is being monitored separately. Each can generate an alert.

Making good TsCondition requires knowledge of available monitoring metrics, labels, and typical values. If we want to use anomaly detection, we also need to specify training params. To simplify this process, we have pre-defined list of ts condition templates as well. Each policy template has its own recommended conditions.

In SPEKTRA core services, we have 4 policy templates in public project (BACKEND and EDGE, for Device and Pod). We know list of policy templates from this query:

$ cuttle alerting list policy-templates --project public-alerting-templates --filter \
  'specTemplate.resourceIdentity.alertingResource="services/devices.edgelq.com/resources/Device"' --view NAME

Now, to see list of recommended conditions for specific policy template, we can execute this query:

$ cuttle alerting list ts-condition-templates --project public-alerting-templates --policy-template backend-device-base-alerts \
  --field-mask supportingDocs --field-mask specTemplate -o json

You should see that:

  • We have standard conditions for temperature, CPU, memory, disk, connectivity…
  • BACKEND based policies contain more condition types - for example connectivity metric is exclusive. It does not make sense to monitor connectivity at the EDGE.
  • EDGE based policies contain anomaly alerting configurations. This is because AI algorithms are much more feasible at the EDGE than at the backend due to sheer amount of devices, each potentially presenting unique patterns.

Regarding alerting for SPEKTRA platform (core services): As a project administrator, you need to decide whether you want to go with THRESHOLD alerting only, or you want to combine with ANOMALY type. In the former case, it is recommended to setup just 2 BACKEND type policies, and deploy all/some TsCondition from underlying templates. If it is desired to have ANOMALY alerting along THRESHOLD, it is recommended to deploy all 4 policy templates (BACKEND and EDGE). Then, deploy TsConditions for EDGE policies - use all or some conditions of your choice (CPU, memory, disk, temperature, etc.). Then, deploy TsCondition for BACKEND policies that are unique for BACKEND (for example connectivity TsCondition for detecting offline devices). It may not make sense to have one TsCondition for CPU on backend, and one for EDGE. While it would work, you will have two conditions observing same metrics and raising duplicated alerts. Usage of templates allows to avoid specifying queries, thresholds, or training params for anomaly detectors. Those things can be complex, although you may learn based on examples.

Creating TsCondition based on template is similar to Policy. First, copy Documents (highly recommended). From TsConditionTemplate, check field supportingDocs. Get those documents, and copy:

$ cuttle alerting create document <document id> --project <my project ID> --title "<copied title>" \
  --mime-type "<copied type>" --content "<copied content>"

With documents prepared, create TsCondition:

$ cuttle alerting create ts-condition <cnd id> --policy <policy ID> --project <my project ID> --display-name "<display name of your choice>" \
  --spec '<copy paste JSON here from specTemplate>' \
  --template-source '{"template": "projects/public-alerting-templates/policyTemplates/<templateId>/tsConditionTemplates/<templateId>"}' \
  --supporting-docs '<first document...>' --supporting-docs '<second document...>' ... --supporting-docs '<last document>'

Each document name (supporting docs) must have of course full format: projects/<project ID>/documents/<document ID>.

You can refer to TsCndSpec for more details about spec.

Alert management

With Policies and TsConditions set, system monitors for abnormal situations and raises Alert resources. You can check on dashboard, or with cuttle:

# To check list of currently firing alerts in specific condition and region ID (you can replace regionId with "-" as wildcard):
$ cuttle alerting list alerts --parent 'projects/<projectId>/policies/<policyId>/tsConditions/<tsConditionId>/regions/<regionId>' \
  --filter 'state.isFiring=true' --order-by 'state.startTime ASC' --view DETAIL -o json
  
# To check list of firing alerts for specific resource (for example, specific Device):
$ cuttle alerting list alerts --project <projectId> --region <regionId> \
  --filter 'state.isFiring=true AND alerting_resource.name="projects/<projectId>/regions/<regionId>/devices/<deviceId>"' \
  --order-by 'state.startTime ASC' --view DETAIL -o json
  
# If you want to see alerts for Pod resource, query may be a bit more specific. Remember, each Pod has an assigned Device,
# and main alerting resource for Pod is still Device. We need to add extra filter condition using pod_id label:
$ cuttle alerting list alerts --project <projectId> --region <regionId> \
  --filter 'state.isFiring=true AND alerting_resource.name="projects/<projectId>/regions/<regionId>/devices/<deviceId>" AND tsInfo.commonResourceLabels.pod_id="<podId>"' \
  --order-by 'state.startTime ASC' --view DETAIL -o json

Alerting, on top of detecting alerts, also provides a way to automatically handle alerts using GenAI. This is enabled on Policy level (field spec.ai_agent.enabled in Policy resource). If the value is true, Alerting will employ LLM to investigate an alert. It will execute following steps:

  • It will fetch Alert data, with violating time series (or logs in the future).
  • It will fetch Document resources defined in Policy and TsCondition resource. This is why it is important to keep those documents in good state. They can contain alert runbook that can be utilized by LLM.
  • It will fetch additional data using field spec.supporting_queries from Policy object. This field contains list of potentially helpful correlated time series/logs/resources. When alert is raised for device, it is helpful to have list of extra data originating from that device. For example, if there is CPU spike on device, LLM will be able to see if there are pod CPU metrics spiking too. Or if logs indicate elevated usage.
  • If field spec.ai_agent.enabled_connectivity is enabled in Policy resource, LLM may also SSH into Device to get more information.
  • Considering all the mentioned context, LLM agent can decide what to do with alert. It will store its findings in field state.ai_agent_diagnosis_notes in the Alert resource.

LLM Agent may:

  • Assume that alert is false positive, and ignore it (for example, if high CPU usage is temporary due to upgrade operation). Alert is ignored and no further action taken.
  • Assume that alert is false positive due to incorrect threshold or incorrect anomaly detector. For example, if new workload is added to a device, CPU usage may increase permanently. This can trigger ANOMALY type alert, but its not actual anomaly. It is a false positive, and anomaly detector needs retraining based on new reality.
  • Escalate to human operator, if it is not clear how to handle the alert.
  • Try to propose remediation (in form SSH script for example) to fix the issue. If field spec.ai_agent.auto_accept_remediation in Policy resource is true, then LLM will be able to execute remediation without involving operator. Otherwise, operator will need to approve first.

This way, Alerting service can be semi-autonomous, with full alert lifecycle.

If AI Agent is not enabled automatically (goes to operator), or if alert has been escalated to operator, they can do similar actions:

  • Mark alert as false positive (to be ignored).
  • Mark alert as false positive and thresholds need to be adapted.
  • Send to AI agent for handling (it is possible even if AI agent is disabled in Policy).
  • Mark as resolved (it is assumed operator executed some remediation).

There are couple of important fields in Alert resource indicating current status:

  • Field state.is_firing is boolean informing if Alert is currently firing.
  • Field state.escalation_level indicates if Alert is being handled by AI Agent or Operator.
  • Field state.ai_agent_handling_state is relevant if state.escalation_level points to AI Agent, and tells what is the last available state (or decision) made by AI. Initial state for new alert is AI_AWAITING_HANDLING.
  • Field state.operator_handling_state is relevant if state.escalation_level points to Operator, and tells what is the last available state (or decision) made by Operator. Initial state for new alert is OP_AWAITING_HANDLING.

Operator can use cuttle or dashboard to execute operations on Alert resource:

# Ignore the alert. Be aware, that field state.operator_handling_state will switch to OP_AWAITING_HANDLING
# on its own, if alert does not stop firing after some time:
$ cuttle alerting update alert 'projects/<>/policies/<>/tsConditions/<>/regions/<>/alerts/<>' \
  --state '{"operatorHandlingState": "OP_IGNORE_AS_TEMPORARY"}' --update-mask 'state.operatorHandlingState'
  
# If operator thinks that alert is raised due to too sensitive threholds, its possible to execute this
# command. System will try to adjust entries on its own:
$ cuttle alerting update alert 'projects/<>/policies/<>/tsConditions/<>/regions/<>/alerts/<>' \
  --state '{"operatorHandlingState": "OP_ADJUST_CND_ENTRY"}' --update-mask 'state.operatorHandlingState'
  
# If operator executed some remediation, they can mark alert as resolved (but this is optional). If successful
# remediation was executed, alert should switch it's firing status to false anyway. This state can be used for filtering
# purposes.
$ cuttle alerting update alert 'projects/<>/policies/<>/tsConditions/<>/regions/<>/alerts/<>' \
  --state '{"operatorHandlingState": "OP_REMEDIATION_APPLIED"}' --update-mask 'state.operatorHandlingState'

# Operator can mark alert as acknowledged. From system point of view, this state has no consequence. This state can be
# used by operator to remember which alerts are new, which were looked at.
$ cuttle alerting update alert 'projects/<>/policies/<>/tsConditions/<>/regions/<>/alerts/<>' \
  --state '{"operatorHandlingState": "OP_ACKNOWLEDGED"}' --update-mask 'state.operatorHandlingState'

# Operator can ask AI Agent to handle this alert manually using this update command:
$ cuttle alerting update alert 'projects/<>/policies/<>/tsConditions/<>/regions/<>/alerts/<>' \
  --state '{"operatorHandlingState": "OP_NOT_INVOLVED", "aiAgentHandlingState": "AI_AWAITING_HANDLING", "escalationLevel": "AI_AGENT"}' \
  --update-mask 'state.operatorHandlingState' --update-mask 'state.aiAgentHandlingState' --update-mask 'state.escalationLevel'

There is also a field state.operator_notes that can be used by operator to store additional data (if they want).

If AI Agent is handling alerts, but automatic remediation approvals are not enabled, it may be necessary to check if there are alerts with pending approval (for example, in specific condition and region):

$ cuttle alerting list alerts --parent 'projects/<projectId>/policies/<policyId>/tsConditions/<tsConditionId>/regions/<regionId>' \
  --filter 'state.isFiring=true AND state.aiAgentHandlingState="AI_REMEDIATION_PROPOSED"' --order-by 'state.startTime ASC' \
  --view DETAIL --field-mask state -o json

State AI_REMEDIATION_PROPOSED indicates that fields state.ai_remediation and state.ai_remediation_arg are populated, and contain proposed remediation. For example, disk alert can contain log rotation command.

Operator must approve this alert using following update:

$ cuttle alerting update alert 'projects/<>/policies/<>/tsConditions/<>/regions/<>/alerts/<>' \
  --state '{"aiAgentHandlingState": "AI_REMEDIATION_APPROVED"}' --update-mask 'state.aiAgentHandlingState'

After this, system will execute remediation.

Notifications

In order to enable notifications about alerts, it is necessary to create NotificationChannel resource. It can be done using cuttle. As of now, there are 3 type of notifications:

$ cuttle alerting create notification-channel --project <projectId> email-example \
  --spec '{"enabled":true, "enabled_kinds": ["NEW_FIRING","STOPPED_FIRING"], "type":"EMAIL", "addresses":["admin@example.com"]}'

$ cuttle alerting create notification-channel --project <projectId> slack-example \
  --spec '{"enabled":true, "enabled_kinds": ["NEW_FIRING","STOPPED_FIRING"], "type":"SLACK", "incomingWebhook": "https://some.url"}'
  
$ cuttle alerting create notification-channel --project <projectId> webhook-example \
  --spec '{"enabled":true, "enabled_kinds": ["NEW_FIRING","STOPPED_FIRING"], "type":"WEBHOOK", "webhook": {"url": "https://some.url", "maxMessageSizeMb": 0.25}}'

Note that using field enabledKinds we can provide notifications for various state changes. We may opt to hide some alerts as well, for example if they can be fully handled by AI.

Created channels may be attached to policies:

$ cuttle alerting update policy 'projects/<projectId>/policies/<policyId>' \
  --notification-channels 'projects/<projectId>/notificationChannels/<channelId>' --update-mask notificationChannels

Naturally policy can be created straight with attached notification channels.

Apart from using notifications, users can also access API to watch alert changes directly in their projects.

Advanced topics - anomaly detection in TsCondition

Testing anomaly detection training

Writing TsCondition can be tricky, especially determining good anomaly detectors. We have helper cuttle commands to facilitate this.

Suppose we want to write TsCondition for temperature metric type. We want to monitor all chips on all devices in a project, but first, we want to test anomaly detector based on example device/chip that we already have. We can create JSON file like below:

{
  "projectId": "device-dev",
  "regionId": "us-west2",
  "tsEntryInfo": {
    "commonResourceLabels": {"device_id": "pp-rak-device-ek4445mkllkk3"},
    "commonMetricLabels": {"chip": "CPU"}
  },
  "queries": [
    {
      "name": "Temperature in celcius",
      "filter": "metric.type = \"devices.edgelq.com/device/hardware/temperature\" AND resource.type=\"devices.edgelq.com/device\"",
      "aligner": "ALIGN_MEAN",
      "reducer": "REDUCE_MAX",
      "maxValue": 120
    }
  ],
  "anomalyAlerting": {
    "analysisWindow": "3600s",
    "stepInterval": "300s",
    "trainStepInterval": "900s",
    "alignmentPeriod": "300s",
    "raiseAfter": "300s",
    "silenceAfter": "300s",
    "lstmAutoencoder": {
      "hiddenSize": 8,
      "learnRate": 0.005,
      "maxTrainingEpochs": 256,
      "minTrainingEpochs": 32,
      "acceptableTrainingError": 0.0005,
      "trainingPeriod": "604800s",
      "checkPeriodFraction": 0.05
    }
  },
  "trainEndTime": "2025-06-18T00:00:00Z",
  "checkInterval": {
    "startTime": "2025-06-18T00:00:00Z",
    "endTime": "2025-06-18T06:00:00Z"
  }
}

We will analyze this JSON file step by step.

Our project is device-dev, and we have some devices in us-west2 region. We have a device with ID pp-rak-device-ek4445mkllkk3, which has chip CPU. We can use monitoring first to verify data presence:

$ cuttle monitoring query time-serie --parent 'projects/device-dev' \
  --filter 'metric.type="devices.edgelq.com/device/hardware/temperature" AND resource.type="devices.edgelq.com/device" \
    AND region="us-west2" AND resource.labels.device_id="pp-rak-device-ek4445mkllkk3" AND metric.labels.chip="CPU"' \
  --aggregation '{"alignmentPeriod":"300s", "perSeriesAligner":"ALIGN_MEAN","crossSeriesReducer":"REDUCE_MAX"}' \
  --interval '{"startTime":"2025-06-11T00:05:00Z", "endTime":"2025-06-18T06:00:00Z"}' -o json

If we have data, we can use this example to write previously mentioned JSON. Project ID, region ID, ts Entry must specify our example resource. In field queries we provide all relevant queries (temperature in our case).

Configuration in anomalyAlerting can be tricky, but its possible to master it. First that we need to know, is that anomaly detection is running on sliding window. Sliding window is described by 4 parameters:

  • analysisWindow: Describes window size. In our case, it is one hour. We will be running anomaly detector on a window of fixed size always.
  • stepInterval: Describes sliding step, after which we prepare new window. This is 5 minutes in our case. This param is used during normal operation.
  • trainStepInterval: It is like stepInterval, but this one is used during training. It should be same as stepInterval or larger, to reduce number of generated training samples.
  • alignmentPeriod: Informs how large period is covered by single data point (floating number). This is data granularity

Consider this example:

    "analysisWindow": "3600s",
    "stepInterval": "300s",
    "trainStepInterval": "900s",
    "alignmentPeriod": "300s",

Once we finish training, system will be running anomaly detection each 5 minutes (stepInterval). Example windows:

  • Start time inc: 12.05.00, End time inc: 13.00.00. Number of data points: 12 (60 minutes by 5 minutes alignment period).
  • Start time inc: 12.10.00, End time inc: 13.05.00. Number of data points: 12 (60 minutes by 5 minutes alignment period).
  • Start time inc: 12.15.00, End time inc: 13.10.00. Number of data points: 12 (60 minutes by 5 minutes alignment period).
  • Start time inc: 12.20.00, End time inc: 13.15.00. Number of data points: 12 (60 minutes by 5 minutes alignment period).
  • … and so on

Param trainStepInterval decides step during training only. Here, we have 15 minutes. Therefore, if we have one week of training data, with one data point representing 5 minutes (alignment period), we have 2016 continuous data points. This is 24 * 7 * 12 (7 days, 24 hours, 12 data points in one hour). System will generate following training samples:

  • Start time inc: 00.05.00, End time inc: 01.00.00 (first day). Number of data points: 12 (60 minutes by 5 minutes alignment period).
  • Start time inc: 00.20.00, End time inc: 01.15.00 (first day). Number of data points: 12 (60 minutes by 5 minutes alignment period).
  • Start time inc: 00.35.00, End time inc: 01.30.00 (first day). Number of data points: 12 (60 minutes by 5 minutes alignment period).
  • Start time inc: 00.50.00, End time inc: 01.45.00 (first day). Number of data points: 12 (60 minutes by 5 minutes alignment period).
  • … and so on

Number of training samples can be calculated: (2016 - 12) / 3 + 1 = 669 samples with 12 data points each. Number 2016 is just number of data points. We subtract 12, because we want to remove “first” non-sliding window. We divide by 3, because trainStepInterval is 3 times larger than alignmentPeriod. Finally we add “1” as the first window.

Training data set will therefore contain 8028 floating point numbers (669 * 12). Training data will then consume around 64 KiB. During training itself of course this number will need to be proportionally multiplied.

As of now, we support only LSTM Autoencoder, as most flexible and capable of combining multiple ts queries if needed. Trained model size depends on hidden size (HS) and number of time series queries (TSC). Number of floating points is: TSC*(HS+2) + 2*(4HSHS+4HS+4TSC*HS). If HS = 8, and TSC = 1, we have 650 numbers, which is above 5 KiB.

Training requires considerable amount of RAM too -> each training step (number of data points in sequence) generates temporary matrices for back propagation. Approximate value: STEPS_COUNT * (BatchSize + 23*BatchSize*HiddenSize) numbers. If batch size is 669 (samples count), hidden size is 8, steps count 12, then it is around 11 MiB of data. However, it can become large with larger hidden size, steps count or batches count. Number of points in sequence can reach even 60, or 120. If hidden size is raised to 24, and batches count increases 4 times, we may even need 1 GB of data during training for temporary space, not including potential overheads. This is why we may have larger trainStepInterval. We may want to run check every 5 minutes, but it may be useful to have less granular steps during training itself (it may not matter). It is advisable to observe actual usage during test training.

Having decided on sliding window configuration, we need to consider params raiseAfter and silenceAfter. They should be multiplication of alignment period. If they are not, system will round them up to alignment period in practice. Those indicate number of consecutive data points where anomaly must be detected for alert to be raised. In our case, single anomaly point will cause alert to be raised or silenced.

Next, we have configuration for LSTM: lstmAutoencoder. We decide on hidden size, which influences trained model size. Hidden size should be lower than sequence length (number of data points in a window). Usually we use values 8, 16, 24, but we can try different ones. Learn rate is another important param, and it is tricky to catch correct value. Lower value usually extends training time, but may reach better accuracy, but with risk of overtraining. Training stops, when both conditions are met:

  • Number of passed epochs reaches minTrainingEpochs
  • Number of passed epochs reaches maxTrainingEpochs OR maximum error reaches acceptableTrainingError.

Param trainingPeriod indicates how long must be training period. If we dont have sufficient data, training wont take a place. Finally, param checkPeriodFraction indicates fraction (must be lower than 1.0) of training samples that wont be incorporated into training set. Those extra samples will be used to detect how large anomalies are in practice - not on training data. It is important to set this param to something larger than 0. Errors from training are not usually reliable.

It is important to mention at this point, that model training will be considered failed, if anomaly error values will be above certain maximum threshold. As of now, this value is 0.025. It means, that if training samples (from checkPeriodFraction) will give maximum error of 0.015, then model will be accepted. If maximum error will be for example 0.03, then model will be rejected. If model is rejected during actual training (not our testing cuttle training), then system will reschedule training in the future, on different data.

It should be also noted, that in case of failed training, system may actually try different training params than indicates in the specification. Specification is only default suggestion. This means that, if we have some weird devices, models may still be trained successfully. However, this is, as of now, backup option.

Lets come back to original JSON file, and clarify last params:

  • trainEndTime indicates end time from which we want to get training data. Begin time depends on param trainingPeriod.
  • checkInterval indicates extra time range on which trained model will be checked. This param must not be confused with checkPeriodFraction. The latter shows how many training samples are used for determining actual anomaly values. This will determine anomaly sensitivity later on. Time period in checkInterval will be used to generate sliding windows on which we will test anomaly detection. Our cuttle tool will run trained model on all samples within specified interval and display alerts that would have been raised.

Once we have JSON file and we understand it, we can test train & run anomaly detection:

# We can add optional train/check debug flags to have more verbose info during training or checking
$ cuttle alerting test-train-anomaly-detector-model -f <path-to-json-file> \
  --train-debug --check-train

If we are satisfied with the result, we can craft TsCondition resource, for example:

{
  "name": "projects/device-dev/policies/some-policy/tsConditions/temperature",
  "displayName": "Temperature alerting",
  "spec": {
    "queries": [
      {
        "name": "Temperature in celcius",
        "filter": "metric.type = \"devices.edgelq.com/device/hardware/temperature\" AND resource.type=\"devices.edgelq.com/device\"",
        "aligner": "ALIGN_MEAN",
        "reducer": "REDUCE_MAX",
        "maxValue": 120
      }
    ],
    "queryGroupBy": [
      "resource.labels.device_id",
      "metric.labels.chip"
    ],
    "thresholdAlerting": {
      "operator": "OR",
      "alignmentPeriod": "60s",
      "raiseAfter": "120s",
      "silenceAfter": "60s",
      "perQueryThresholds": [{
        "maxUpper": 70.0
      }]
    },
    "anomalyAlerting": [
      {
        "analysisWindow": "3600s",
        "stepInterval": "300s",
        "trainStepInterval": "900s",
        "alignmentPeriod": "300s",
        "raiseAfter": "300s",
        "silenceAfter": "300s",
        "lstmAutoencoder": {
          "hiddenSize": 8,
          "learnRate": 0.005,
          "maxTrainingEpochs": 256,
          "minTrainingEpochs": 32,
          "acceptableTrainingError": 0.0005,
          "trainingPeriod": "604800s",
          "checkPeriodFraction": 0.05
        }
      }
    ]
  }
}

We used tested anomaly detector and incorporated into TsCondition. Note that in field queryGroupBy we provided labels by which unique monitored entries are generated. They will include sample device/chip, but wont be limited by it. This TsCondition is naturally distributed to all regions where project is enabled too.

We need to remember configure threshold alerting, in case anomaly detection is not available, or contained bad training data. We want to raise alert if temperature crosses 70 celcius from above.

Finally, note that in field anomalyAlerting we can provide array of configurations. This can be recommended, if we want to have two models: One for short term windows (1 hour), but also one for long term tendencies (like 1 day). In case of longer windows, it is recommended to have larger alignment period. For example, for analysis window 1 day, we often use alignment period of 30 minutes. This gives 48 data points in one window. Both train/step interval can be set to 30 minutes too.

Checking existing trained anomaly detectors

We may encounter some bad anomaly type alerts from some device and TsCondition. There is a chance that model can be wrong. We can use cuttle to get model and test it on some sample data.

First we need to know, is that trained models are stored in resources called TsEntry. TsEntry is a resource under TsCondition, and represents unique combination of values specified in spec.queryGroupBy field in TsCondition.

Imagine we want to find TsEntry for specific TsCondition and alerting resource. We can use cuttle:

$ cuttle alerting list ts-entries --parent projects/device-dev/policies/device-alerts/tsConditions/temperature/regions/us-west2 \
  --filter 'info.alerting_resource.name="projects/device-dev/regions/us-west2/devices/pp-rak-device-ek4445mkllkk3"' \
  --view DETAIL --field-mask state -o json

If we have extra labels in spec.queryGroupBy in TsCondition, for example metric.labels.chip, then we may receive multiple TsEntries, one per each chip. We can narrow cuttle query for specific TsEntry:

$ cuttle alerting list ts-entries --parent projects/device-dev/policies/device-alerts/tsConditions/temperature/regions/us-west2 \
  --filter 'info.alerting_resource.name="projects/device-dev/regions/us-west2/devices/pp-rak-device-ek4445mkllkk3" AND info.commonMetricLabels.chip="CPU"' \
  --view DETAIL -o json

See TsEntry resource for more details.

TsEntry contains adaptive alerting thresholds and anomaly models. We can fetch this resource and test anomaly detection on some specified period.

# add check-debug flag for more verbose logging
$ cuttle alerting check-anomaly-detector-model --analysis-window '3600s' \
  --ts-entry 'projects/device-dev/policies/device-alerts/tsConditions/temperature/regions/us-west2/tsEntries/<base64-blob>' \
  --check-start-time '2025-07-21T00:01:00Z' --check-end-time '2025-07-22T00:00:00Z' \
  --check-debug

We need to provide TsEntry resource, from which Condition and exact time series queries are deduced. Then, we must provide anomaly window size (TsEntry may contain different models per anomaly window size). Finally, we need to provide time range which will be checked.

Cuttle will print alerts that would be generated for specified period.

We can update field state.models using cuttle, and set some value under train_after field in problematic model. This will enforce new re-training after specified time.

$ cuttle alerting update ts-entry '<full name>' --state '{"models":[<ALL JSONs>]}' --update-mask 'state.models'

Note however, that you must provide full state.models content, with all anomaly models. Any unchanged fields must be repeated. As of now, server does not support updating sub-fields in array elements, and state.models field is an array field.

You can also delete TsEntry all together. It will trigger recreation and retraining using current (latest) data.

1 -

Understanding the alerting.edgelq.com service APIv1, in proto package ntt.alerting.v1.

Service alerting.edgelq.com in version v1, proto package ntt.alerting.v1

Here is the list of resources supported in Alerting service APIv1:

Alert Resource

Alert describes an abnormal situation indicated by TimeSeries or Logs. Alert is always associated with a single resource type, as indicated in Policy object. It contains relevant information: TimeSeries/Logs values that caused the issue, starting time, ending time, if alert stopped, current handling state (by both operator and AI agent). Each Alert belongs to a single TsCondition/LogCondition resource, and is always associated with some unique TsEntry - they share alerting resource reference. Relationship Alert <-> TsEntry is N <-> 1 Relationship Alert <-> TsCondition/LogCondition is N <-> 1

Name patterns:

  • projects/{project}/policies/{policy}/tsConditions/{ts_condition}/regions/{region}/alerts/{alert}
  • projects/{project}/policies/{policy}/logConditions/{log_condition}/regions/{region}/alerts/{alert}

Parent resources:

This section covers the methods and messages to interact with Alert resource.

Alert Methods

Here is the list of Alert resource methods:

GetAlert Method

GetAlert

rpc GetAlert(GetAlertRequest) returns (Alert)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/alerts/*} 
GET /v1/{name=projects/*/policies/*/logConditions/*/regions/*/alerts/*} 

BatchGetAlerts Method

BatchGetAlerts

rpc BatchGetAlerts(BatchGetAlertsRequest) returns (BatchGetAlertsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.batchGet

The equivalent REST API is:

GET /v1/alerts:batchGet 

ListAlerts Method

ListAlerts

rpc ListAlerts(ListAlertsRequest) returns (ListAlertsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/alerts 
GET /v1/{parent=projects/*/policies/*/logConditions/*/regions/*}/alerts 

WatchAlert Method

WatchAlert

rpc WatchAlert(WatchAlertRequest) returns (WatchAlertResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/alerts/*}:watch 
POST /v1/{name=projects/*/policies/*/logConditions/*/regions/*/alerts/*}:watch 

WatchAlerts Method

WatchAlerts

rpc WatchAlerts(WatchAlertsRequest) returns (WatchAlertsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/alerts:watch 
POST /v1/{parent=projects/*/policies/*/logConditions/*/regions/*}/alerts:watch 

CreateAlert Method

CreateAlert

rpc CreateAlert(CreateAlertRequest) returns (Alert)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/alerts (BODY: alert)
POST /v1/{parent=projects/*/policies/*/logConditions/*/regions/*}/alerts 

UpdateAlert Method

UpdateAlert

rpc UpdateAlert(UpdateAlertRequest) returns (Alert)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.update

The equivalent REST API is:

PUT /v1/{alert.name=projects/*/policies/*/tsConditions/*/regions/*/alerts/*} (BODY: alert)
PUT /v1/{alert.name=projects/*/policies/*/logConditions/*/regions/*/alerts/*} 

DeleteAlert Method

DeleteAlert

rpc DeleteAlert(DeleteAlertRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/alerts/*} 
DELETE /v1/{name=projects/*/policies/*/logConditions/*/regions/*/alerts/*} 

BulkSaveAlerts Method

BulkSaveAlerts

rpc BulkSaveAlerts(BulkSaveAlertsRequest) returns (BulkSaveAlertsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.bulkSave

The equivalent REST API is:

POST /v1/alerts:bulkSaveAlerts 

BulkMarkAsNotified Method

BulkMarkAsNotified

rpc BulkMarkAsNotified(BulkMarkAsNotifiedRequest) returns (BulkMarkAsNotifiedResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/alerts.bulkMarkAsNotified

The equivalent REST API is:

POST /v1/alerts:bulkMarkAsNotified 

Alert Messages

Here is the list of Alert resource messages:

Alert Message

Name Type Description
name string (name of Alert) Name of Alert When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-zA-Z0-9_.:-]{1,128}
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display name informing about basic params (condition display name and alerting resource)
alerting_resource OwnerReference Alerting resource points to the original resource which generated alert. This meta reference works like dynamic type (any service, any resource). TODO: We could use of “DynamicReference” message type. It can be similar to OwnerReference, except it works more like reference (uses EstablishReferences…). It can support most normal behaviors, like CASCADE DELETE/UNSET.
ts_info Alert.TsInfo Informs about alert based on TimeSeries data.
log_info Alert.LogInfo Informs about alert based on Log data.
state Alert.State State of alert
internal Alert.Internal Internal field.

Alert.TsInfo Message

TsInfo contains Alert data created based on TimeSeries data.

Name Type Description
type Alert.TsInfo.Type Type of TimeSeries alert - based on ANOMALY or THRESHOLD.
anomaly_window_size .google.protobuf.Duration If alert type is ANOMALY, then this field is populated and informs for what window size anomaly was detected.
common_key bytes Binary key describing common metric/resource labels
metric_types repeated string List of metric types used in TsCondition
resource_types repeated string List of resource types used in TsCondition
common_metric_labels map<string, string> Metric labels by which we grouped TimeSeries data.
common_resource_labels map<string, string> Resource labels by which we grouped TimeSeries data.
time_series repeated Alert.TsInfo.TimeSeries All TimeSeries corresponding to each TsCondition.Spec.Query object, according to unique combination of group by fields: resource/metric labels.

Alert.LogInfo Message

LogInfo contains Alert data created based on Log data.

Name Type Description
common_key bytes Binary key describing common labels
log_types repeated string List of log descriptor types specified in parent LogCondition
common_log_labels map<string, string> Log labels by which we grouped Logs data.
violating_log string Content of violating log

Alert.State Message

State is responsible for managing lifecycle of Alert. Each Alert

Name Type Description
is_firing bool Informs if alert is still firing
start_time .google.protobuf.Timestamp Time when alert was raised
end_time .google.protobuf.Timestamp Time when alert was silenced, if no longer firing
notification_statuses repeated Alert.State.Notification Informs where notifications about alert state changes must be sent.
escalation_level Alert.State.EscalationLevel Informs who is handling alert as of now.
ai_agent_handling_state Alert.State.AiHandlingState Informs current state of alert handling by AI Agent if escalation level is AI_AGENT. If alert is on operator side, it will contain last decision made by AI agent.
ai_agent_last_state_change_time .google.protobuf.Timestamp Informs when was the last state change of ai_agent_handling_state field.
ai_agent_diagnosis_notes string Contains AI Agent troubleshooting notes. If agent SSHed to alerting resource, it will also contain history of shell for visibility purposes.
ai_remediation_arg string Optional remediation information from AI Agent. This field may be populated when field ai_agent_handling_state switches to AI_REMEDIATION_PROPOSED, if necessary. For example, if AI Agent wants to SSH and execute some commands, it will contain these commands.
ai_remediation PolicySpec.AIAgentHandling.Remediation Remediation type proposed by AI Agent to fix an alert. This field is populated when field ai_agent_handling_state switches to AI_REMEDIATION_PROPOSED. Informs what kind of remediation AI Agent wants to execute.
operator_handling_state Alert.State.OperatorHandlingState Informs current state of alert handling by Operator if escalation level is OPERATOR. If alert is on AI_AGENT side, it will contain last decision made by operator.
operator_last_state_change_time .google.protobuf.Timestamp Informs when was the last state change of operator_handling_state field.
operator_notes string Optional operator notes.
lifecycle_completed bool Alert has ended and any needed notifications are processed

Alert.Internal Message

Internal data.

Name Type Description
alerting_location PolicySpec.ProcessingLocation

Alert.TsInfo.TimeSeries Message

TimeSeries object matches single TsCondition.Spec.Query object in parent TsCondition. It contains TimeSeries data points at a time of violation, along with relevant information, like thresholds specified in TsEntry.

Name Type Description
query_name string Query name of the matching TsCondition.Spec.Query object
values repeated double TimeSeries data values during violation start. They will be outside of lower/upper thresholds range for THRESHOLD type alerts.
anomalies repeated double Corresponding detected anomaly values (square errors). Populated for ANOMALY type of alerts. They will be larger than anomaly threshold for ANOMALY type of alerts.
upper_threshold AlertingThreshold Upper threshold that was active during violation. Populated for THRESHOLD type of alerts.
lower_threshold AlertingThreshold Lower threshold that was active during violation. Populated for THRESHOLD type of alerts.
anomaly_threshold double Anomaly threshold that was active during violation. Populated for ANOMALY type of alerts.
after_duration .google.protobuf.Duration Informs how long violation was active at the time of raising alert.

Alert.State.Notification Message

Notification informs about pending notifications that must be sent due to changes in Alert state.

Name Type Description
kind NotificationChannelSpec.EventKind Kind informs what type of State has changed, and for which we need to send notifications.
pending_channels repeated string (reference to NotificationChannel) Informs about list of channels to where notification should be sent according to the corresponding kind.

GetAlertRequest Message

A request message of the GetAlert method.

Name Type Description
name string (name of Alert) Name of ntt.alerting.v1.Alert
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetAlertsRequest Message

A request message of the BatchGetAlerts method.

Name Type Description
names repeated string (name of Alert) Names of Alerts
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetAlertsResponse Message

A response message of the BatchGetAlerts method.

Name Type Description
alerts repeated Alert found Alerts
missing repeated string (name of Alert) list of not found Alerts

ListAlertsRequest Message

A request message of the ListAlerts method.

Name Type Description
parent string (parent name of Alert) Parent name of ntt.alerting.v1.Alert
page_size int32 Requested page size. Server may return fewer Alerts than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Alert) A token identifying a page of results the server should return. Typically, this is the value of ListAlertsResponse.next_page_token.
order_by string (orderBy of Alert) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Alert) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListAlertsResponse Message

A response message of the ListAlerts method.

Name Type Description
alerts repeated Alert The list of Alerts
prev_page_token string (cursor of Alert) A token to retrieve previous page of results. Pass this value in the ListAlertsRequest.page_token.
next_page_token string (cursor of Alert) A token to retrieve next page of results. Pass this value in the ListAlertsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total Alerts across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchAlertRequest Message

A request message of the WatchAlert method.

Name Type Description
name string (name of Alert) Name of ntt.alerting.v1.Alert
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchAlertResponse Message

A response message of the WatchAlert method.

Name Type Description
change AlertChange

WatchAlertsRequest Message

A request message of the WatchAlerts method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of Alert) Parent name of ntt.alerting.v1.Alert
page_size int32 Requested page size. Server may return fewer Alerts than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of Alert) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of Alert) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of Alert) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to Alert that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to Alert that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchAlertsResponse Message

A response message of the WatchAlerts method.

Name Type Description
alert_changes repeated AlertChange Changes of Alerts
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All Alerts will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchAlertsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (Alerts will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchAlertsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of Alert) New token to retrieve previous page of results.
next_page_token string (cursor of Alert) New token to retrieve next page of results.

CreateAlertRequest Message

A request message of the CreateAlert method.

Name Type Description
parent string (parent name of Alert) Parent name of ntt.alerting.v1.Alert
alert Alert Alert resource body
response_mask CreateAlertRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateAlertRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateAlertRequest Message

A request message of the UpdateAlert method.

Name Type Description
alert Alert Alert resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateAlertRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateAlertRequest.ResponseMask

UpdateAlertRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state Alert Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateAlertRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteAlertRequest Message

A request message of the DeleteAlert method.

Name Type Description
name string (name of Alert) Name of ntt.alerting.v1.Alert
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

BulkSaveAlertsRequest Message

A request message of the BulkSaveAlerts method.

Name Type Description
project string (name of Project)
alerts repeated Alert
update_mask .google.protobuf.FieldMask

BulkSaveAlertsResponse Message

A response message of the BulkSaveAlerts method.

Name Type Description
alerts repeated Alert

BulkMarkAsNotifiedRequest Message

Name Type Description
project string (name of Project)
alerts repeated string (name of Alert)
channels repeated string (name of NotificationChannel)

BulkMarkAsNotifiedResponse Message

Name Type Description
none none none

Alert Enumerations

Here is the list of Alert resource enumerations:

Alert.TsInfo.Type Enumeration

Type of TimeSeries based alert

Name Description
UNDEFINED
ANOMALY ANOMALY indicates that irregular data pattern was spotted in time series data (anomaly values crossed anomaly thresholds).
THRESHOLD THRESHOLD indicates that time series values crossed specified thresholds (lower or upper threshold).

Alert.State.AiHandlingState Enumeration

AiHandlingState informs what is a handling state of an alert from AI agent point of view. It is active when escalation_level points to AI_AGENT.

Name Description
AI_AGENT_NOT_INVOLVED AI Agent is not involved in handling this alert.
AI_AWAITING_HANDLING Alert is new and awaits handling by AI agent. This is always initial state for AI agent after firing. It can move to AI_ESCALATED_TO_OPERATOR, AI_IGNORE_AS_TEMPORARY, AI_ADJUST_CND_ENTRY, or AI_REMEDIATION_PROPOSED.
AI_ESCALATED_TO_OPERATOR This state is active is AI agent escalated alert to an operator, due to inability to solve it. This is terminal state after which handling is passed to OPERATOR, escalation_level changes.
AI_IGNORE_AS_TEMPORARY AI Agent informed that, while TimeSeries/Logs data indeed contain abnormal values, they are caused by transient and unharmful reason, and it should stop firing soon. This is false positive alert. This is semi-terminal state. It can move to AI_ESCALATED_TO_OPERATOR if alert persist despite being flagged as transient issue.
AI_ADJUST_CND_ENTRY AI Agent informed that this alert is a false positive, and TimeSeries/Logs violating entries in fact should not be classified as a violation. Switching alert to this state will cause corresponding TsEntry to adjust its thresholds, or retrain AI anomaly detection models. This is usually a terminal state, after which alert is silenced and TsEntry tries to assume violating data is normal. However, if thresholds cannot be updated, alert will switch to AI_ESCALATED_TO_OPERATOR.
AI_REMEDIATION_PROPOSED AI Agent identified this is a genuine alert, but for which it is able to fix. Remediation is only proposed, and requires approval from OPERATOR. Note that this is unique situation, where field escalation_level in State object points to AI_AGENT, but OPERATOR is requires to provide an update. Alert is technically still being handled by AI Agent, but waiting for OPERATOR confirmation.
AI_REMEDIATION_APPROVED This state is followed by AI_REMEDIATION_PROPOSED after OPERATOR agrees to execute, or if automatic approval is enabled. AI Agent will then proceed to applying remediation. It will move to AI_REMEDIATION_APPLIED after remediation is applied.
AI_REMEDIATION_APPLIED This state indicates that remediation has been applied. If after some time issue persists, then it switches to AI_ESCALATED_TO_OPERATOR.

Alert.State.OperatorHandlingState Enumeration

AiHandlingState informs what is a handling state of an alert from OPERATOR point of view.

Name Description
OP_NOT_INVOLVED Operator is not involved in handling this alert.
OP_AWAITING_HANDLING Alert waits for Operator to handle it. This is initial state when escalation level switches to OPERATOR. From here, it can switch to any of remaining states. It may be also switched back to AI Agent if operator will it.
OP_ACKNOWLEDGED This can be a first state of Alert after OP_AWAITING_HANDLING, if operator wants to acknowledge alert without informing about final decision.
OP_IGNORE_AS_TEMPORARY Operator informed that, while TimeSeries/Logs data indeed contain abnormal values, they are caused by transient and unharmful reason, and it should stop firing soon. This is false positive alert. This may be terminal state if alert stops firing soon. Otherwise, it will go back to OP_AWAITING_HANDLING.
OP_ADJUST_CND_ENTRY Operator informed that this alert is a false positive, and TimeSeries/Logs violating entries in fact should not be classified as a violation. Switching alert to this state will cause corresponding TsEntry to adjust its thresholds, or retrain AI anomaly detection models, whatever is relevant. This is usually a terminal state, after which alert is silenced and TsEntry tries to assume violating data is normal. However, if thresholds cannot be updated, alert will switch to OP_AWAITING_HANDLING automatically.
OP_REMEDIATION_APPLIED This state indicates that remediation has been applied. If after some time issue persists, then it switches to OP_AWAITING_HANDLING.

Alert.State.EscalationLevel Enumeration

EscalationLevel informs who is handling an alert.

Name Description
NONE None is invalid state.
AI_AGENT Alert is handled by AI Agent now
OPERATOR Alert is handled by OPERATOR now.

Document Resource

Document can be attached to Policy, TsCondition or LogCondition resources. They should contain documentation that can be relevant when diagnosing & resolving alerts. They are especially important for AI Agent handling.

Name patterns:

  • projects/{project}/documents/{document}

Parent resources:

This section covers the methods and messages to interact with Document resource.

Document Methods

Here is the list of Document resource methods:

GetDocument Method

GetDocument

rpc GetDocument(GetDocumentRequest) returns (Document)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.get

The equivalent REST API is:

GET /v1/{name=projects/*/documents/*} 

BatchGetDocuments Method

BatchGetDocuments

rpc BatchGetDocuments(BatchGetDocumentsRequest) returns (BatchGetDocumentsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.batchGet

The equivalent REST API is:

GET /v1/documents:batchGet 

ListDocuments Method

ListDocuments

rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.list

The equivalent REST API is:

GET /v1/{parent=projects/*}/documents 

WatchDocument Method

WatchDocument

rpc WatchDocument(WatchDocumentRequest) returns (WatchDocumentResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.watch

The equivalent REST API is:

POST /v1/{name=projects/*/documents/*}:watch 

WatchDocuments Method

WatchDocuments

rpc WatchDocuments(WatchDocumentsRequest) returns (WatchDocumentsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.watch

The equivalent REST API is:

POST /v1/{parent=projects/*}/documents:watch 

CreateDocument Method

CreateDocument

rpc CreateDocument(CreateDocumentRequest) returns (Document)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.create

The equivalent REST API is:

POST /v1/{parent=projects/*}/documents (BODY: document)

UpdateDocument Method

UpdateDocument

rpc UpdateDocument(UpdateDocumentRequest) returns (Document)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.update

The equivalent REST API is:

PUT /v1/{document.name=projects/*/documents/*} (BODY: document)

DeleteDocument Method

DeleteDocument

rpc DeleteDocument(DeleteDocumentRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/documents/*} 

SearchDocuments Method

SearchDocuments

rpc SearchDocuments(SearchDocumentsRequest) returns (SearchDocumentsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/documents.search

The equivalent REST API is:

GET /v1/{parent=projects/*}/documents:search 

Document Messages

Here is the list of Document resource messages:

Document Message

Name Type Description
name string (name of Document) Name of Document When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
title string Document title
content string Documentation content for operators
mime_type string documentation mime type. Only "text/markdown" is supported.

GetDocumentRequest Message

A request message of the GetDocument method.

Name Type Description
name string (name of Document) Name of ntt.alerting.v1.Document
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetDocumentsRequest Message

A request message of the BatchGetDocuments method.

Name Type Description
names repeated string (name of Document) Names of Documents
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetDocumentsResponse Message

A response message of the BatchGetDocuments method.

Name Type Description
documents repeated Document found Documents
missing repeated string (name of Document) list of not found Documents

ListDocumentsRequest Message

A request message of the ListDocuments method.

Name Type Description
parent string (parent name of Document) Parent name of ntt.alerting.v1.Document
page_size int32 Requested page size. Server may return fewer Documents than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Document) A token identifying a page of results the server should return. Typically, this is the value of ListDocumentsResponse.next_page_token.
order_by string (orderBy of Document) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Document) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListDocumentsResponse Message

A response message of the ListDocuments method.

Name Type Description
documents repeated Document The list of Documents
prev_page_token string (cursor of Document) A token to retrieve previous page of results. Pass this value in the ListDocumentsRequest.page_token.
next_page_token string (cursor of Document) A token to retrieve next page of results. Pass this value in the ListDocumentsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total Documents across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchDocumentRequest Message

A request message of the WatchDocument method.

Name Type Description
name string (name of Document) Name of ntt.alerting.v1.Document
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchDocumentResponse Message

A response message of the WatchDocument method.

Name Type Description
change DocumentChange

WatchDocumentsRequest Message

A request message of the WatchDocuments method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of Document) Parent name of ntt.alerting.v1.Document
page_size int32 Requested page size. Server may return fewer Documents than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of Document) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of Document) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of Document) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to Document that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to Document that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchDocumentsResponse Message

A response message of the WatchDocuments method.

Name Type Description
document_changes repeated DocumentChange Changes of Documents
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All Documents will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchDocumentsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (Documents will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchDocumentsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of Document) New token to retrieve previous page of results.
next_page_token string (cursor of Document) New token to retrieve next page of results.

CreateDocumentRequest Message

A request message of the CreateDocument method.

Name Type Description
parent string (parent name of Document) Parent name of ntt.alerting.v1.Document
document Document Document resource body
response_mask CreateDocumentRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateDocumentRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateDocumentRequest Message

A request message of the UpdateDocument method.

Name Type Description
document Document Document resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateDocumentRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateDocumentRequest.ResponseMask

UpdateDocumentRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state Document Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateDocumentRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteDocumentRequest Message

A request message of the DeleteDocument method.

Name Type Description
name string (name of Document) Name of ntt.alerting.v1.Document
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchDocumentsRequest Message

A request message of the SearchDocuments method.

Name Type Description
parent string (parent name of Document) Parent name of ntt.alerting.v1.Document
page_size int32 Requested page size. Server may return fewer Documents than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Document) A token identifying a page of results the server should return. Typically, this is the value of SearchDocumentsResponse.next_page_token.
order_by string (orderBy of Document) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Document) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchDocumentsResponse Message

A response message of the SearchDocuments method.

Name Type Description
documents repeated Document The list of Documents
prev_page_token string (cursor of Document) A token to retrieve previous page of results. Pass this value in the SearchDocumentsRequest.page_token.
next_page_token string (cursor of Document) A token to retrieve next page of results. Pass this value in the SearchDocumentsRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total Documents across all pages.

LogCondition Resource

LogCondition describes when Alert based on Logs data should be raised.

Name patterns:

  • projects/{project}/policies/{policy}/logConditions/{log_condition}

Parent resources:

This section covers the methods and messages to interact with LogCondition resource.

LogCondition Methods

Here is the list of LogCondition resource methods:

GetLogCondition Method

GetLogCondition

rpc GetLogCondition(GetLogConditionRequest) returns (LogCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*/logConditions/*} 

BatchGetLogConditions Method

BatchGetLogConditions

rpc BatchGetLogConditions(BatchGetLogConditionsRequest) returns (BatchGetLogConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.batchGet

The equivalent REST API is:

GET /v1/logConditions:batchGet 

ListLogConditions Method

ListLogConditions

rpc ListLogConditions(ListLogConditionsRequest) returns (ListLogConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*}/logConditions 

WatchLogCondition Method

WatchLogCondition

rpc WatchLogCondition(WatchLogConditionRequest) returns (WatchLogConditionResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*/logConditions/*}:watch 

WatchLogConditions Method

WatchLogConditions

rpc WatchLogConditions(WatchLogConditionsRequest) returns (WatchLogConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*}/logConditions:watch 

CreateLogCondition Method

CreateLogCondition

rpc CreateLogCondition(CreateLogConditionRequest) returns (LogCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*}/logConditions (BODY: log_condition)

UpdateLogCondition Method

UpdateLogCondition

rpc UpdateLogCondition(UpdateLogConditionRequest) returns (LogCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.update

The equivalent REST API is:

PUT /v1/{log_condition.name=projects/*/policies/*/logConditions/*} (BODY: log_condition)

DeleteLogCondition Method

DeleteLogCondition

rpc DeleteLogCondition(DeleteLogConditionRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*/logConditions/*} 

SearchLogConditions Method

SearchLogConditions

rpc SearchLogConditions(SearchLogConditionsRequest) returns (SearchLogConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditions.search

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*}/logConditions:search 

LogCondition Messages

Here is the list of LogCondition resource messages:

LogCondition Message

Name Type Description
name string (name of LogCondition) Name of LogCondition When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of documents useful for troubleshooting and fixing alerts triggered by this condition.
spec LogCndSpec Defines what query is being monitored, and what content must trigger an Alert.
internal LogCondition.Internal Internal field.
template_source LogCondition.TemplateSource template source for current LogCondition

LogCondition.Internal Message

Internal data.

Name Type Description
alerting_location PolicySpec.ProcessingLocation Informs if log condition is processed at the backend or on edge.

LogCondition.TemplateSource Message

TemplateSource describes where condition is coming from originally.

Name Type Description
template string (reference to LogConditionTemplate) Reference to template
updated_fields .google.protobuf.FieldMask List of modified fields compared to the template. It is a mask of Spec object.

GetLogConditionRequest Message

A request message of the GetLogCondition method.

Name Type Description
name string (name of LogCondition) Name of ntt.alerting.v1.LogCondition
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetLogConditionsRequest Message

A request message of the BatchGetLogConditions method.

Name Type Description
names repeated string (name of LogCondition) Names of LogConditions
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetLogConditionsResponse Message

A response message of the BatchGetLogConditions method.

Name Type Description
log_conditions repeated LogCondition found LogConditions
missing repeated string (name of LogCondition) list of not found LogConditions

ListLogConditionsRequest Message

A request message of the ListLogConditions method.

Name Type Description
parent string (parent name of LogCondition) Parent name of ntt.alerting.v1.LogCondition
page_size int32 Requested page size. Server may return fewer LogConditions than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of LogCondition) A token identifying a page of results the server should return. Typically, this is the value of ListLogConditionsResponse.next_page_token.
order_by string (orderBy of LogCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of LogCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListLogConditionsResponse Message

A response message of the ListLogConditions method.

Name Type Description
log_conditions repeated LogCondition The list of LogConditions
prev_page_token string (cursor of LogCondition) A token to retrieve previous page of results. Pass this value in the ListLogConditionsRequest.page_token.
next_page_token string (cursor of LogCondition) A token to retrieve next page of results. Pass this value in the ListLogConditionsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total LogConditions across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchLogConditionRequest Message

A request message of the WatchLogCondition method.

Name Type Description
name string (name of LogCondition) Name of ntt.alerting.v1.LogCondition
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchLogConditionResponse Message

A response message of the WatchLogCondition method.

Name Type Description
change LogConditionChange

WatchLogConditionsRequest Message

A request message of the WatchLogConditions method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of LogCondition) Parent name of ntt.alerting.v1.LogCondition
page_size int32 Requested page size. Server may return fewer LogConditions than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of LogCondition) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of LogCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of LogCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to LogCondition that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to LogCondition that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchLogConditionsResponse Message

A response message of the WatchLogConditions method.

Name Type Description
log_condition_changes repeated LogConditionChange Changes of LogConditions
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All LogConditions will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchLogConditionsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (LogConditions will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchLogConditionsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of LogCondition) New token to retrieve previous page of results.
next_page_token string (cursor of LogCondition) New token to retrieve next page of results.

CreateLogConditionRequest Message

A request message of the CreateLogCondition method.

Name Type Description
parent string (parent name of LogCondition) Parent name of ntt.alerting.v1.LogCondition
log_condition LogCondition LogCondition resource body
response_mask CreateLogConditionRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateLogConditionRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateLogConditionRequest Message

A request message of the UpdateLogCondition method.

Name Type Description
log_condition LogCondition LogCondition resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateLogConditionRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateLogConditionRequest.ResponseMask

UpdateLogConditionRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state LogCondition Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateLogConditionRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteLogConditionRequest Message

A request message of the DeleteLogCondition method.

Name Type Description
name string (name of LogCondition) Name of ntt.alerting.v1.LogCondition
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchLogConditionsRequest Message

A request message of the SearchLogConditions method.

Name Type Description
parent string (parent name of LogCondition) Parent name of ntt.alerting.v1.LogCondition
page_size int32 Requested page size. Server may return fewer LogConditions than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of LogCondition) A token identifying a page of results the server should return. Typically, this is the value of SearchLogConditionsResponse.next_page_token.
order_by string (orderBy of LogCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of LogCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchLogConditionsResponse Message

A response message of the SearchLogConditions method.

Name Type Description
log_conditions repeated LogCondition The list of LogConditions
prev_page_token string (cursor of LogCondition) A token to retrieve previous page of results. Pass this value in the SearchLogConditionsRequest.page_token.
next_page_token string (cursor of LogCondition) A token to retrieve next page of results. Pass this value in the SearchLogConditionsRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total LogConditions across all pages.

LogConditionTemplate Resource

LogConditionTemplate provides pre-defined templates for LogCondition resources. They may be public ones (available for all projects to be copied), but also can be private and available in selected projects only. They are always provided within Policy template.

Name patterns:

  • projects/{project}/policyTemplates/{policy_template}/logConditionTemplates/{log_condition_template}

Parent resources:

This section covers the methods and messages to interact with LogConditionTemplate resource.

LogConditionTemplate Methods

Here is the list of LogConditionTemplate resource methods:

GetLogConditionTemplate Method

GetLogConditionTemplate

rpc GetLogConditionTemplate(GetLogConditionTemplateRequest) returns (LogConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.get

The equivalent REST API is:

GET /v1/{name=projects/*/policyTemplates/*/logConditionTemplates/*} 

BatchGetLogConditionTemplates Method

BatchGetLogConditionTemplates

rpc BatchGetLogConditionTemplates(BatchGetLogConditionTemplatesRequest) returns (BatchGetLogConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.batchGet

The equivalent REST API is:

GET /v1/logConditionTemplates:batchGet 

ListLogConditionTemplates Method

ListLogConditionTemplates

rpc ListLogConditionTemplates(ListLogConditionTemplatesRequest) returns (ListLogConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policyTemplates/*}/logConditionTemplates 

WatchLogConditionTemplate Method

WatchLogConditionTemplate

rpc WatchLogConditionTemplate(WatchLogConditionTemplateRequest) returns (WatchLogConditionTemplateResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policyTemplates/*/logConditionTemplates/*}:watch 

WatchLogConditionTemplates Method

WatchLogConditionTemplates

rpc WatchLogConditionTemplates(WatchLogConditionTemplatesRequest) returns (WatchLogConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policyTemplates/*}/logConditionTemplates:watch 

CreateLogConditionTemplate Method

CreateLogConditionTemplate

rpc CreateLogConditionTemplate(CreateLogConditionTemplateRequest) returns (LogConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policyTemplates/*}/logConditionTemplates (BODY: log_condition_template)

UpdateLogConditionTemplate Method

UpdateLogConditionTemplate

rpc UpdateLogConditionTemplate(UpdateLogConditionTemplateRequest) returns (LogConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.update

The equivalent REST API is:

PUT /v1/{log_condition_template.name=projects/*/policyTemplates/*/logConditionTemplates/*} (BODY: log_condition_template)

DeleteLogConditionTemplate Method

DeleteLogConditionTemplate

rpc DeleteLogConditionTemplate(DeleteLogConditionTemplateRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policyTemplates/*/logConditionTemplates/*} 

SearchLogConditionTemplates Method

SearchLogConditionTemplates

rpc SearchLogConditionTemplates(SearchLogConditionTemplatesRequest) returns (SearchLogConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/logConditionTemplates.search

The equivalent REST API is:

GET /v1/{parent=projects/*/policyTemplates/*}/logConditionTemplates:search 

LogConditionTemplate Messages

Here is the list of LogConditionTemplate resource messages:

LogConditionTemplate Message

Name Type Description
name string (name of LogConditionTemplate) Name of LogConditionTemplate When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of supporting documents. Pointed documents must be copied if LogCondition is created in different project.
spec_template LogCndSpec Pre defined template for LogCondition.Spec.

GetLogConditionTemplateRequest Message

A request message of the GetLogConditionTemplate method.

Name Type Description
name string (name of LogConditionTemplate) Name of ntt.alerting.v1.LogConditionTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetLogConditionTemplatesRequest Message

A request message of the BatchGetLogConditionTemplates method.

Name Type Description
names repeated string (name of LogConditionTemplate) Names of LogConditionTemplates
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetLogConditionTemplatesResponse Message

A response message of the BatchGetLogConditionTemplates method.

Name Type Description
log_condition_templates repeated LogConditionTemplate found LogConditionTemplates
missing repeated string (name of LogConditionTemplate) list of not found LogConditionTemplates

ListLogConditionTemplatesRequest Message

A request message of the ListLogConditionTemplates method.

Name Type Description
parent string (parent name of LogConditionTemplate) Parent name of ntt.alerting.v1.LogConditionTemplate
page_size int32 Requested page size. Server may return fewer LogConditionTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of LogConditionTemplate) A token identifying a page of results the server should return. Typically, this is the value of ListLogConditionTemplatesResponse.next_page_token.
order_by string (orderBy of LogConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of LogConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListLogConditionTemplatesResponse Message

A response message of the ListLogConditionTemplates method.

Name Type Description
log_condition_templates repeated LogConditionTemplate The list of LogConditionTemplates
prev_page_token string (cursor of LogConditionTemplate) A token to retrieve previous page of results. Pass this value in the ListLogConditionTemplatesRequest.page_token.
next_page_token string (cursor of LogConditionTemplate) A token to retrieve next page of results. Pass this value in the ListLogConditionTemplatesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total LogConditionTemplates across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchLogConditionTemplateRequest Message

A request message of the WatchLogConditionTemplate method.

Name Type Description
name string (name of LogConditionTemplate) Name of ntt.alerting.v1.LogConditionTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchLogConditionTemplateResponse Message

A response message of the WatchLogConditionTemplate method.

Name Type Description
change LogConditionTemplateChange

WatchLogConditionTemplatesRequest Message

A request message of the WatchLogConditionTemplates method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of LogConditionTemplate) Parent name of ntt.alerting.v1.LogConditionTemplate
page_size int32 Requested page size. Server may return fewer LogConditionTemplates than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of LogConditionTemplate) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of LogConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of LogConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to LogConditionTemplate that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to LogConditionTemplate that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchLogConditionTemplatesResponse Message

A response message of the WatchLogConditionTemplates method.

Name Type Description
log_condition_template_changes repeated LogConditionTemplateChange Changes of LogConditionTemplates
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All LogConditionTemplates will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchLogConditionTemplatesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (LogConditionTemplates will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchLogConditionTemplatesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of LogConditionTemplate) New token to retrieve previous page of results.
next_page_token string (cursor of LogConditionTemplate) New token to retrieve next page of results.

CreateLogConditionTemplateRequest Message

A request message of the CreateLogConditionTemplate method.

Name Type Description
parent string (parent name of LogConditionTemplate) Parent name of ntt.alerting.v1.LogConditionTemplate
log_condition_template LogConditionTemplate LogConditionTemplate resource body
response_mask CreateLogConditionTemplateRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateLogConditionTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateLogConditionTemplateRequest Message

A request message of the UpdateLogConditionTemplate method.

Name Type Description
log_condition_template LogConditionTemplate LogConditionTemplate resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateLogConditionTemplateRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateLogConditionTemplateRequest.ResponseMask

UpdateLogConditionTemplateRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state LogConditionTemplate Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateLogConditionTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteLogConditionTemplateRequest Message

A request message of the DeleteLogConditionTemplate method.

Name Type Description
name string (name of LogConditionTemplate) Name of ntt.alerting.v1.LogConditionTemplate
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchLogConditionTemplatesRequest Message

A request message of the SearchLogConditionTemplates method.

Name Type Description
parent string (parent name of LogConditionTemplate) Parent name of ntt.alerting.v1.LogConditionTemplate
page_size int32 Requested page size. Server may return fewer LogConditionTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of LogConditionTemplate) A token identifying a page of results the server should return. Typically, this is the value of SearchLogConditionTemplatesResponse.next_page_token.
order_by string (orderBy of LogConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of LogConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchLogConditionTemplatesResponse Message

A response message of the SearchLogConditionTemplates method.

Name Type Description
log_condition_templates repeated LogConditionTemplate The list of LogConditionTemplates
prev_page_token string (cursor of LogConditionTemplate) A token to retrieve previous page of results. Pass this value in the SearchLogConditionTemplatesRequest.page_token.
next_page_token string (cursor of LogConditionTemplate) A token to retrieve next page of results. Pass this value in the SearchLogConditionTemplatesRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total LogConditionTemplates across all pages.

NotificationChannel Resource

NotificationChannel specifies channel where notifications about alert updates can be sent.

Name patterns:

  • projects/{project}/notificationChannels/{notification_channel}

Parent resources:

This section covers the methods and messages to interact with NotificationChannel resource.

NotificationChannel Methods

Here is the list of NotificationChannel resource methods:

GetNotificationChannel Method

GetNotificationChannel

rpc GetNotificationChannel(GetNotificationChannelRequest) returns (NotificationChannel)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.get

The equivalent REST API is:

GET /v1/{name=projects/*/notificationChannels/*} 

BatchGetNotificationChannels Method

BatchGetNotificationChannels

rpc BatchGetNotificationChannels(BatchGetNotificationChannelsRequest) returns (BatchGetNotificationChannelsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.batchGet

The equivalent REST API is:

GET /v1/notificationChannels:batchGet 

ListNotificationChannels Method

ListNotificationChannels

rpc ListNotificationChannels(ListNotificationChannelsRequest) returns (ListNotificationChannelsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.list

The equivalent REST API is:

GET /v1/{parent=projects/*}/notificationChannels 

WatchNotificationChannel Method

WatchNotificationChannel

rpc WatchNotificationChannel(WatchNotificationChannelRequest) returns (WatchNotificationChannelResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.watch

The equivalent REST API is:

POST /v1/{name=projects/*/notificationChannels/*}:watch 

WatchNotificationChannels Method

WatchNotificationChannels

rpc WatchNotificationChannels(WatchNotificationChannelsRequest) returns (WatchNotificationChannelsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.watch

The equivalent REST API is:

POST /v1/{parent=projects/*}/notificationChannels:watch 

CreateNotificationChannel Method

CreateNotificationChannel

rpc CreateNotificationChannel(CreateNotificationChannelRequest) returns (NotificationChannel)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.create

The equivalent REST API is:

POST /v1/{parent=projects/*}/notificationChannels (BODY: notification_channel)

UpdateNotificationChannel Method

UpdateNotificationChannel

rpc UpdateNotificationChannel(UpdateNotificationChannelRequest) returns (NotificationChannel)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.update

The equivalent REST API is:

PUT /v1/{notification_channel.name=projects/*/notificationChannels/*} (BODY: notification_channel)

DeleteNotificationChannel Method

DeleteNotificationChannel

rpc DeleteNotificationChannel(DeleteNotificationChannelRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/notificationChannels/*} 

TestNotificationChannel Method

TestNotificationChannel

rpc TestNotificationChannel(TestNotificationChannelRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/notificationChannels.test

The equivalent REST API is:

POST /v1/{name=projects/*/notificationChannels/*}:test 

NotificationChannel Messages

Here is the list of NotificationChannel resource messages:

NotificationChannel Message

Name Type Description
name string (name of NotificationChannel) Name of NotificationChannel When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string description
spec NotificationChannelSpec Specification
state NotificationChannel.State State

NotificationChannel.State Message

State of NotificationChannel

Name Type Description
status NotificationChannel.State.Status Status
error NotificationChannel.State.Error Error

NotificationChannel.State.Error Message

Error of NotificationChannel

Name Type Description
time .google.protobuf.Timestamp
message string

GetNotificationChannelRequest Message

A request message of the GetNotificationChannel method.

Name Type Description
name string (name of NotificationChannel) Name of ntt.alerting.v1.NotificationChannel
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetNotificationChannelsRequest Message

A request message of the BatchGetNotificationChannels method.

Name Type Description
names repeated string (name of NotificationChannel) Names of NotificationChannels
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetNotificationChannelsResponse Message

A response message of the BatchGetNotificationChannels method.

Name Type Description
notification_channels repeated NotificationChannel found NotificationChannels
missing repeated string (name of NotificationChannel) list of not found NotificationChannels

ListNotificationChannelsRequest Message

A request message of the ListNotificationChannels method.

Name Type Description
parent string (parent name of NotificationChannel) Parent name of ntt.alerting.v1.NotificationChannel
page_size int32 Requested page size. Server may return fewer NotificationChannels than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of NotificationChannel) A token identifying a page of results the server should return. Typically, this is the value of ListNotificationChannelsResponse.next_page_token.
order_by string (orderBy of NotificationChannel) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of NotificationChannel) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListNotificationChannelsResponse Message

A response message of the ListNotificationChannels method.

Name Type Description
notification_channels repeated NotificationChannel The list of NotificationChannels
prev_page_token string (cursor of NotificationChannel) A token to retrieve previous page of results. Pass this value in the ListNotificationChannelsRequest.page_token.
next_page_token string (cursor of NotificationChannel) A token to retrieve next page of results. Pass this value in the ListNotificationChannelsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total NotificationChannels across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchNotificationChannelRequest Message

A request message of the WatchNotificationChannel method.

Name Type Description
name string (name of NotificationChannel) Name of ntt.alerting.v1.NotificationChannel
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchNotificationChannelResponse Message

A response message of the WatchNotificationChannel method.

Name Type Description
change NotificationChannelChange

WatchNotificationChannelsRequest Message

A request message of the WatchNotificationChannels method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of NotificationChannel) Parent name of ntt.alerting.v1.NotificationChannel
page_size int32 Requested page size. Server may return fewer NotificationChannels than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of NotificationChannel) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of NotificationChannel) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of NotificationChannel) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to NotificationChannel that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to NotificationChannel that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchNotificationChannelsResponse Message

A response message of the WatchNotificationChannels method.

Name Type Description
notification_channel_changes repeated NotificationChannelChange Changes of NotificationChannels
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All NotificationChannels will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchNotificationChannelsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (NotificationChannels will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchNotificationChannelsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of NotificationChannel) New token to retrieve previous page of results.
next_page_token string (cursor of NotificationChannel) New token to retrieve next page of results.

CreateNotificationChannelRequest Message

A request message of the CreateNotificationChannel method.

Name Type Description
parent string (parent name of NotificationChannel) Parent name of ntt.alerting.v1.NotificationChannel
notification_channel NotificationChannel NotificationChannel resource body
response_mask CreateNotificationChannelRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateNotificationChannelRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateNotificationChannelRequest Message

A request message of the UpdateNotificationChannel method.

Name Type Description
notification_channel NotificationChannel NotificationChannel resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateNotificationChannelRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateNotificationChannelRequest.ResponseMask

UpdateNotificationChannelRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state NotificationChannel Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateNotificationChannelRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteNotificationChannelRequest Message

A request message of the DeleteNotificationChannel method.

Name Type Description
name string (name of NotificationChannel) Name of ntt.alerting.v1.NotificationChannel
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

TestNotificationChannelRequest Message

A request message of the TestNotificationChannel method.

Name Type Description
name string (name of NotificationChannel) Name of ntt.alerting.v1.NotificationChannel

NotificationChannel Enumerations

Here is the list of NotificationChannel resource enumerations:

NotificationChannel.State.Status Enumeration

State of NotificationChannel

Name Description
STATE_UNSPECIFIED State is unknown
ACTIVE NotificationChannel is active
DISABLED NotificationChannel is disabled
ERROR Error of NotificationChannel

Policy Resource

Policy groups log or time series based conditions that focus on monitoring same alerting resources. For example, one Policy should be created for alerts triggered by devices, and another for alerts triggered by Pods. Policy also provides common specification parts for all conditions within: It binds them with notification channels, defines processing location (Backend or Edge), instructs if and how AI agent should be investigating issues.

Name patterns:

  • projects/{project}/policies/{policy}

Parent resources:

This section covers the methods and messages to interact with Policy resource.

Policy Methods

Here is the list of Policy resource methods:

GetPolicy Method

GetPolicy

rpc GetPolicy(GetPolicyRequest) returns (Policy)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*} 

BatchGetPolicies Method

BatchGetPolicies

rpc BatchGetPolicies(BatchGetPoliciesRequest) returns (BatchGetPoliciesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.batchGet

The equivalent REST API is:

GET /v1/policies:batchGet 

ListPolicies Method

ListPolicies

rpc ListPolicies(ListPoliciesRequest) returns (ListPoliciesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.list

The equivalent REST API is:

GET /v1/{parent=projects/*}/policies 

WatchPolicy Method

WatchPolicy

rpc WatchPolicy(WatchPolicyRequest) returns (WatchPolicyResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*}:watch 

WatchPolicies Method

WatchPolicies

rpc WatchPolicies(WatchPoliciesRequest) returns (WatchPoliciesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.watch

The equivalent REST API is:

POST /v1/{parent=projects/*}/policies:watch 

CreatePolicy Method

CreatePolicy

rpc CreatePolicy(CreatePolicyRequest) returns (Policy)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.create

The equivalent REST API is:

POST /v1/{parent=projects/*}/policies (BODY: policy)

UpdatePolicy Method

UpdatePolicy

rpc UpdatePolicy(UpdatePolicyRequest) returns (Policy)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.update

The equivalent REST API is:

PUT /v1/{policy.name=projects/*/policies/*} (BODY: policy)

DeletePolicy Method

DeletePolicy

rpc DeletePolicy(DeletePolicyRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*} 

SearchPolicies Method

SearchPolicies

rpc SearchPolicies(SearchPoliciesRequest) returns (SearchPoliciesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policies.search

The equivalent REST API is:

GET /v1/{parent=projects/*}/policies:search 

Policy Messages

Here is the list of Policy resource messages:

Policy Message

Name Type Description
name string (name of Policy) Name of Policy When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string display name
description string Long description
supporting_docs repeated string (reference to Document) List of documents useful for troubleshooting and fixing alerts triggered by conditions in this policy.
spec PolicySpec Policy specification
template_source Policy.TemplateSource template source for current Policy
notification_channels repeated string (reference to NotificationChannel) List of attached notification channels

Policy.TemplateSource Message

TemplateSource describes where policy is coming from originally.

Name Type Description
template string (reference to PolicyTemplate) Reference to template
updated_fields .google.protobuf.FieldMask List of modified fields compared to the template. It is a mask of Spec object.

GetPolicyRequest Message

A request message of the GetPolicy method.

Name Type Description
name string (name of Policy) Name of ntt.alerting.v1.Policy
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetPoliciesRequest Message

A request message of the BatchGetPolicies method.

Name Type Description
names repeated string (name of Policy) Names of Policies
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetPoliciesResponse Message

A response message of the BatchGetPolicies method.

Name Type Description
policies repeated Policy found Policies
missing repeated string (name of Policy) list of not found Policies

ListPoliciesRequest Message

A request message of the ListPolicies method.

Name Type Description
parent string (parent name of Policy) Parent name of ntt.alerting.v1.Policy
page_size int32 Requested page size. Server may return fewer Policies than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Policy) A token identifying a page of results the server should return. Typically, this is the value of ListPoliciesResponse.next_page_token.
order_by string (orderBy of Policy) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Policy) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListPoliciesResponse Message

A response message of the ListPolicies method.

Name Type Description
policies repeated Policy The list of Policies
prev_page_token string (cursor of Policy) A token to retrieve previous page of results. Pass this value in the ListPoliciesRequest.page_token.
next_page_token string (cursor of Policy) A token to retrieve next page of results. Pass this value in the ListPoliciesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total Policies across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchPolicyRequest Message

A request message of the WatchPolicy method.

Name Type Description
name string (name of Policy) Name of ntt.alerting.v1.Policy
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchPolicyResponse Message

A response message of the WatchPolicy method.

Name Type Description
change PolicyChange

WatchPoliciesRequest Message

A request message of the WatchPolicies method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of Policy) Parent name of ntt.alerting.v1.Policy
page_size int32 Requested page size. Server may return fewer Policies than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of Policy) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of Policy) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of Policy) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to Policy that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to Policy that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchPoliciesResponse Message

A response message of the WatchPolicies method.

Name Type Description
policy_changes repeated PolicyChange Changes of Policies
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All Policies will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchPoliciesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (Policies will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchPoliciesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of Policy) New token to retrieve previous page of results.
next_page_token string (cursor of Policy) New token to retrieve next page of results.

CreatePolicyRequest Message

A request message of the CreatePolicy method.

Name Type Description
parent string (parent name of Policy) Parent name of ntt.alerting.v1.Policy
policy Policy Policy resource body
response_mask CreatePolicyRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreatePolicyRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdatePolicyRequest Message

A request message of the UpdatePolicy method.

Name Type Description
policy Policy Policy resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdatePolicyRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdatePolicyRequest.ResponseMask

UpdatePolicyRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state Policy Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdatePolicyRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeletePolicyRequest Message

A request message of the DeletePolicy method.

Name Type Description
name string (name of Policy) Name of ntt.alerting.v1.Policy
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchPoliciesRequest Message

A request message of the SearchPolicies method.

Name Type Description
parent string (parent name of Policy) Parent name of ntt.alerting.v1.Policy
page_size int32 Requested page size. Server may return fewer Policies than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of Policy) A token identifying a page of results the server should return. Typically, this is the value of SearchPoliciesResponse.next_page_token.
order_by string (orderBy of Policy) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of Policy) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchPoliciesResponse Message

A response message of the SearchPolicies method.

Name Type Description
policies repeated Policy The list of Policies
prev_page_token string (cursor of Policy) A token to retrieve previous page of results. Pass this value in the SearchPoliciesRequest.page_token.
next_page_token string (cursor of Policy) A token to retrieve next page of results. Pass this value in the SearchPoliciesRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total Policies across all pages.

PolicyTemplate Resource

PolicyTemplate provides pre-defined templates for Policy resources. They may be public ones (available for all projects to be copied), but also can be private and available in selected projects only.

Name patterns:

  • projects/{project}/policyTemplates/{policy_template}

Parent resources:

This section covers the methods and messages to interact with PolicyTemplate resource.

PolicyTemplate Methods

Here is the list of PolicyTemplate resource methods:

GetPolicyTemplate Method

GetPolicyTemplate

rpc GetPolicyTemplate(GetPolicyTemplateRequest) returns (PolicyTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.get

The equivalent REST API is:

GET /v1/{name=projects/*/policyTemplates/*} 

BatchGetPolicyTemplates Method

BatchGetPolicyTemplates

rpc BatchGetPolicyTemplates(BatchGetPolicyTemplatesRequest) returns (BatchGetPolicyTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.batchGet

The equivalent REST API is:

GET /v1/policyTemplates:batchGet 

ListPolicyTemplates Method

ListPolicyTemplates

rpc ListPolicyTemplates(ListPolicyTemplatesRequest) returns (ListPolicyTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.list

The equivalent REST API is:

GET /v1/{parent=projects/*}/policyTemplates 

WatchPolicyTemplate Method

WatchPolicyTemplate

rpc WatchPolicyTemplate(WatchPolicyTemplateRequest) returns (WatchPolicyTemplateResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policyTemplates/*}:watch 

WatchPolicyTemplates Method

WatchPolicyTemplates

rpc WatchPolicyTemplates(WatchPolicyTemplatesRequest) returns (WatchPolicyTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.watch

The equivalent REST API is:

POST /v1/{parent=projects/*}/policyTemplates:watch 

CreatePolicyTemplate Method

CreatePolicyTemplate

rpc CreatePolicyTemplate(CreatePolicyTemplateRequest) returns (PolicyTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.create

The equivalent REST API is:

POST /v1/{parent=projects/*}/policyTemplates (BODY: policy_template)

UpdatePolicyTemplate Method

UpdatePolicyTemplate

rpc UpdatePolicyTemplate(UpdatePolicyTemplateRequest) returns (PolicyTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.update

The equivalent REST API is:

PUT /v1/{policy_template.name=projects/*/policyTemplates/*} (BODY: policy_template)

DeletePolicyTemplate Method

DeletePolicyTemplate

rpc DeletePolicyTemplate(DeletePolicyTemplateRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policyTemplates/*} 

SearchPolicyTemplates Method

SearchPolicyTemplates

rpc SearchPolicyTemplates(SearchPolicyTemplatesRequest) returns (SearchPolicyTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/policyTemplates.search

The equivalent REST API is:

GET /v1/{parent=projects/*}/policyTemplates:search 

PolicyTemplate Messages

Here is the list of PolicyTemplate resource messages:

PolicyTemplate Message

Name Type Description
name string (name of PolicyTemplate) Name of PolicyTemplate When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of supporting documents. Pointed documents must be copied if Policy is created in different project.
spec_template PolicySpec Spec template

GetPolicyTemplateRequest Message

A request message of the GetPolicyTemplate method.

Name Type Description
name string (name of PolicyTemplate) Name of ntt.alerting.v1.PolicyTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetPolicyTemplatesRequest Message

A request message of the BatchGetPolicyTemplates method.

Name Type Description
names repeated string (name of PolicyTemplate) Names of PolicyTemplates
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetPolicyTemplatesResponse Message

A response message of the BatchGetPolicyTemplates method.

Name Type Description
policy_templates repeated PolicyTemplate found PolicyTemplates
missing repeated string (name of PolicyTemplate) list of not found PolicyTemplates

ListPolicyTemplatesRequest Message

A request message of the ListPolicyTemplates method.

Name Type Description
parent string (parent name of PolicyTemplate) Parent name of ntt.alerting.v1.PolicyTemplate
page_size int32 Requested page size. Server may return fewer PolicyTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of PolicyTemplate) A token identifying a page of results the server should return. Typically, this is the value of ListPolicyTemplatesResponse.next_page_token.
order_by string (orderBy of PolicyTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of PolicyTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListPolicyTemplatesResponse Message

A response message of the ListPolicyTemplates method.

Name Type Description
policy_templates repeated PolicyTemplate The list of PolicyTemplates
prev_page_token string (cursor of PolicyTemplate) A token to retrieve previous page of results. Pass this value in the ListPolicyTemplatesRequest.page_token.
next_page_token string (cursor of PolicyTemplate) A token to retrieve next page of results. Pass this value in the ListPolicyTemplatesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total PolicyTemplates across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchPolicyTemplateRequest Message

A request message of the WatchPolicyTemplate method.

Name Type Description
name string (name of PolicyTemplate) Name of ntt.alerting.v1.PolicyTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchPolicyTemplateResponse Message

A response message of the WatchPolicyTemplate method.

Name Type Description
change PolicyTemplateChange

WatchPolicyTemplatesRequest Message

A request message of the WatchPolicyTemplates method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of PolicyTemplate) Parent name of ntt.alerting.v1.PolicyTemplate
page_size int32 Requested page size. Server may return fewer PolicyTemplates than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of PolicyTemplate) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of PolicyTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of PolicyTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to PolicyTemplate that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to PolicyTemplate that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchPolicyTemplatesResponse Message

A response message of the WatchPolicyTemplates method.

Name Type Description
policy_template_changes repeated PolicyTemplateChange Changes of PolicyTemplates
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All PolicyTemplates will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchPolicyTemplatesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (PolicyTemplates will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchPolicyTemplatesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of PolicyTemplate) New token to retrieve previous page of results.
next_page_token string (cursor of PolicyTemplate) New token to retrieve next page of results.

CreatePolicyTemplateRequest Message

A request message of the CreatePolicyTemplate method.

Name Type Description
parent string (parent name of PolicyTemplate) Parent name of ntt.alerting.v1.PolicyTemplate
policy_template PolicyTemplate PolicyTemplate resource body
response_mask CreatePolicyTemplateRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreatePolicyTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdatePolicyTemplateRequest Message

A request message of the UpdatePolicyTemplate method.

Name Type Description
policy_template PolicyTemplate PolicyTemplate resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdatePolicyTemplateRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdatePolicyTemplateRequest.ResponseMask

UpdatePolicyTemplateRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state PolicyTemplate Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdatePolicyTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeletePolicyTemplateRequest Message

A request message of the DeletePolicyTemplate method.

Name Type Description
name string (name of PolicyTemplate) Name of ntt.alerting.v1.PolicyTemplate
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchPolicyTemplatesRequest Message

A request message of the SearchPolicyTemplates method.

Name Type Description
parent string (parent name of PolicyTemplate) Parent name of ntt.alerting.v1.PolicyTemplate
page_size int32 Requested page size. Server may return fewer PolicyTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of PolicyTemplate) A token identifying a page of results the server should return. Typically, this is the value of SearchPolicyTemplatesResponse.next_page_token.
order_by string (orderBy of PolicyTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of PolicyTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchPolicyTemplatesResponse Message

A response message of the SearchPolicyTemplates method.

Name Type Description
policy_templates repeated PolicyTemplate The list of PolicyTemplates
prev_page_token string (cursor of PolicyTemplate) A token to retrieve previous page of results. Pass this value in the SearchPolicyTemplatesRequest.page_token.
next_page_token string (cursor of PolicyTemplate) A token to retrieve next page of results. Pass this value in the SearchPolicyTemplatesRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total PolicyTemplates across all pages.

TsCondition Resource

TsCondition describes when Alert based on TimeSeries data should be raised.

Name patterns:

  • projects/{project}/policies/{policy}/tsConditions/{ts_condition}

Parent resources:

This section covers the methods and messages to interact with TsCondition resource.

TsCondition Methods

Here is the list of TsCondition resource methods:

GetTsCondition Method

GetTsCondition

rpc GetTsCondition(GetTsConditionRequest) returns (TsCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*/tsConditions/*} 

BatchGetTsConditions Method

BatchGetTsConditions

rpc BatchGetTsConditions(BatchGetTsConditionsRequest) returns (BatchGetTsConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.batchGet

The equivalent REST API is:

GET /v1/tsConditions:batchGet 

ListTsConditions Method

ListTsConditions

rpc ListTsConditions(ListTsConditionsRequest) returns (ListTsConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*}/tsConditions 

WatchTsCondition Method

WatchTsCondition

rpc WatchTsCondition(WatchTsConditionRequest) returns (WatchTsConditionResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*/tsConditions/*}:watch 

WatchTsConditions Method

WatchTsConditions

rpc WatchTsConditions(WatchTsConditionsRequest) returns (WatchTsConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*}/tsConditions:watch 

CreateTsCondition Method

CreateTsCondition

rpc CreateTsCondition(CreateTsConditionRequest) returns (TsCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*}/tsConditions (BODY: ts_condition)

UpdateTsCondition Method

UpdateTsCondition

rpc UpdateTsCondition(UpdateTsConditionRequest) returns (TsCondition)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.update

The equivalent REST API is:

PUT /v1/{ts_condition.name=projects/*/policies/*/tsConditions/*} (BODY: ts_condition)

DeleteTsCondition Method

DeleteTsCondition

rpc DeleteTsCondition(DeleteTsConditionRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*/tsConditions/*} 

SearchTsConditions Method

SearchTsConditions

rpc SearchTsConditions(SearchTsConditionsRequest) returns (SearchTsConditionsResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditions.search

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*}/tsConditions:search 

TsCondition Messages

Here is the list of TsCondition resource messages:

TsCondition Message

Name Type Description
name string (name of TsCondition) Name of TsCondition When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of documents useful for troubleshooting and fixing alerts triggered by this condition.
spec TsCndSpec Spec defines queries, thresholds and anomaly detector specs.
internal TsCondition.Internal Internal field.
filter_selector TsCondition.Selector filter selector simplifies querying TsCondition resources. For example, it allows to make query like: * List TsConditions WHERE filter_selector.metric.types CONTAINS “device/cpu”
template_source TsCondition.TemplateSource template source for current TsCondition

TsCondition.Internal Message

Internal data.

Name Type Description
common_key_kset bytes
entry_spec_generation int32
alerting_location PolicySpec.ProcessingLocation

TsCondition.Selector Message

Selector contains detected metric/resource types and common labels used in filters from all queries. Selector facilitates filtering TsCondition resources. It is generated when TsCondition is saved (on the fly).

Name Type Description
metric_types repeated string
resource_types repeated string
common_metric_labels map<string, TsCondition.Selector.Strings>
common_resource_labels map<string, TsCondition.Selector.Strings>

TsCondition.TemplateSource Message

TemplateSource describes where condition is coming from originally.

Name Type Description
template string (reference to TsConditionTemplate) Reference to template
updated_fields .google.protobuf.FieldMask List of modified fields compared to the template. It is a mask of Spec object.

TsCondition.Selector.Strings Message

Name Type Description
values repeated string

GetTsConditionRequest Message

A request message of the GetTsCondition method.

Name Type Description
name string (name of TsCondition) Name of ntt.alerting.v1.TsCondition
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsConditionsRequest Message

A request message of the BatchGetTsConditions method.

Name Type Description
names repeated string (name of TsCondition) Names of TsConditions
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsConditionsResponse Message

A response message of the BatchGetTsConditions method.

Name Type Description
ts_conditions repeated TsCondition found TsConditions
missing repeated string (name of TsCondition) list of not found TsConditions

ListTsConditionsRequest Message

A request message of the ListTsConditions method.

Name Type Description
parent string (parent name of TsCondition) Parent name of ntt.alerting.v1.TsCondition
page_size int32 Requested page size. Server may return fewer TsConditions than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsCondition) A token identifying a page of results the server should return. Typically, this is the value of ListTsConditionsResponse.next_page_token.
order_by string (orderBy of TsCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListTsConditionsResponse Message

A response message of the ListTsConditions method.

Name Type Description
ts_conditions repeated TsCondition The list of TsConditions
prev_page_token string (cursor of TsCondition) A token to retrieve previous page of results. Pass this value in the ListTsConditionsRequest.page_token.
next_page_token string (cursor of TsCondition) A token to retrieve next page of results. Pass this value in the ListTsConditionsRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total TsConditions across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchTsConditionRequest Message

A request message of the WatchTsCondition method.

Name Type Description
name string (name of TsCondition) Name of ntt.alerting.v1.TsCondition
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchTsConditionResponse Message

A response message of the WatchTsCondition method.

Name Type Description
change TsConditionChange

WatchTsConditionsRequest Message

A request message of the WatchTsConditions method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of TsCondition) Parent name of ntt.alerting.v1.TsCondition
page_size int32 Requested page size. Server may return fewer TsConditions than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of TsCondition) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of TsCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of TsCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to TsCondition that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to TsCondition that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchTsConditionsResponse Message

A response message of the WatchTsConditions method.

Name Type Description
ts_condition_changes repeated TsConditionChange Changes of TsConditions
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All TsConditions will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchTsConditionsResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (TsConditions will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchTsConditionsResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of TsCondition) New token to retrieve previous page of results.
next_page_token string (cursor of TsCondition) New token to retrieve next page of results.

CreateTsConditionRequest Message

A request message of the CreateTsCondition method.

Name Type Description
parent string (parent name of TsCondition) Parent name of ntt.alerting.v1.TsCondition
ts_condition TsCondition TsCondition resource body
response_mask CreateTsConditionRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateTsConditionRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateTsConditionRequest Message

A request message of the UpdateTsCondition method.

Name Type Description
ts_condition TsCondition TsCondition resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateTsConditionRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateTsConditionRequest.ResponseMask

UpdateTsConditionRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state TsCondition Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateTsConditionRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteTsConditionRequest Message

A request message of the DeleteTsCondition method.

Name Type Description
name string (name of TsCondition) Name of ntt.alerting.v1.TsCondition
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchTsConditionsRequest Message

A request message of the SearchTsConditions method.

Name Type Description
parent string (parent name of TsCondition) Parent name of ntt.alerting.v1.TsCondition
page_size int32 Requested page size. Server may return fewer TsConditions than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsCondition) A token identifying a page of results the server should return. Typically, this is the value of SearchTsConditionsResponse.next_page_token.
order_by string (orderBy of TsCondition) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsCondition) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchTsConditionsResponse Message

A response message of the SearchTsConditions method.

Name Type Description
ts_conditions repeated TsCondition The list of TsConditions
prev_page_token string (cursor of TsCondition) A token to retrieve previous page of results. Pass this value in the SearchTsConditionsRequest.page_token.
next_page_token string (cursor of TsCondition) A token to retrieve next page of results. Pass this value in the SearchTsConditionsRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total TsConditions across all pages.

TsConditionTemplate Resource

TsConditionTemplate provides pre-defined templates for TsCondition resources. They may be public ones (available for all projects to be copied), but also can be private and available in selected projects only. They are always provided within Policy template.

Name patterns:

  • projects/{project}/policyTemplates/{policy_template}/tsConditionTemplates/{ts_condition_template}

Parent resources:

This section covers the methods and messages to interact with TsConditionTemplate resource.

TsConditionTemplate Methods

Here is the list of TsConditionTemplate resource methods:

GetTsConditionTemplate Method

GetTsConditionTemplate

rpc GetTsConditionTemplate(GetTsConditionTemplateRequest) returns (TsConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.get

The equivalent REST API is:

GET /v1/{name=projects/*/policyTemplates/*/tsConditionTemplates/*} 

BatchGetTsConditionTemplates Method

BatchGetTsConditionTemplates

rpc BatchGetTsConditionTemplates(BatchGetTsConditionTemplatesRequest) returns (BatchGetTsConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.batchGet

The equivalent REST API is:

GET /v1/tsConditionTemplates:batchGet 

ListTsConditionTemplates Method

ListTsConditionTemplates

rpc ListTsConditionTemplates(ListTsConditionTemplatesRequest) returns (ListTsConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policyTemplates/*}/tsConditionTemplates 

WatchTsConditionTemplate Method

WatchTsConditionTemplate

rpc WatchTsConditionTemplate(WatchTsConditionTemplateRequest) returns (WatchTsConditionTemplateResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policyTemplates/*/tsConditionTemplates/*}:watch 

WatchTsConditionTemplates Method

WatchTsConditionTemplates

rpc WatchTsConditionTemplates(WatchTsConditionTemplatesRequest) returns (WatchTsConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policyTemplates/*}/tsConditionTemplates:watch 

CreateTsConditionTemplate Method

CreateTsConditionTemplate

rpc CreateTsConditionTemplate(CreateTsConditionTemplateRequest) returns (TsConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policyTemplates/*}/tsConditionTemplates (BODY: ts_condition_template)

UpdateTsConditionTemplate Method

UpdateTsConditionTemplate

rpc UpdateTsConditionTemplate(UpdateTsConditionTemplateRequest) returns (TsConditionTemplate)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.update

The equivalent REST API is:

PUT /v1/{ts_condition_template.name=projects/*/policyTemplates/*/tsConditionTemplates/*} (BODY: ts_condition_template)

DeleteTsConditionTemplate Method

DeleteTsConditionTemplate

rpc DeleteTsConditionTemplate(DeleteTsConditionTemplateRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policyTemplates/*/tsConditionTemplates/*} 

SearchTsConditionTemplates Method

SearchTsConditionTemplates

rpc SearchTsConditionTemplates(SearchTsConditionTemplatesRequest) returns (SearchTsConditionTemplatesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsConditionTemplates.search

The equivalent REST API is:

GET /v1/{parent=projects/*/policyTemplates/*}/tsConditionTemplates:search 

TsConditionTemplate Messages

Here is the list of TsConditionTemplate resource messages:

TsConditionTemplate Message

Name Type Description
name string (name of TsConditionTemplate) Name of TsConditionTemplate When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [a-z][a-z0-9\-]{0,28}[a-z0-9]
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
display_name string Display Name
description string Long description
supporting_docs repeated string (reference to Document) List of supporting documents. Pointed documents must be copied if TsCondition is created in different project.
spec_template TsCndSpec Pre defined template for TsCondition.Spec.

GetTsConditionTemplateRequest Message

A request message of the GetTsConditionTemplate method.

Name Type Description
name string (name of TsConditionTemplate) Name of ntt.alerting.v1.TsConditionTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsConditionTemplatesRequest Message

A request message of the BatchGetTsConditionTemplates method.

Name Type Description
names repeated string (name of TsConditionTemplate) Names of TsConditionTemplates
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsConditionTemplatesResponse Message

A response message of the BatchGetTsConditionTemplates method.

Name Type Description
ts_condition_templates repeated TsConditionTemplate found TsConditionTemplates
missing repeated string (name of TsConditionTemplate) list of not found TsConditionTemplates

ListTsConditionTemplatesRequest Message

A request message of the ListTsConditionTemplates method.

Name Type Description
parent string (parent name of TsConditionTemplate) Parent name of ntt.alerting.v1.TsConditionTemplate
page_size int32 Requested page size. Server may return fewer TsConditionTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsConditionTemplate) A token identifying a page of results the server should return. Typically, this is the value of ListTsConditionTemplatesResponse.next_page_token.
order_by string (orderBy of TsConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListTsConditionTemplatesResponse Message

A response message of the ListTsConditionTemplates method.

Name Type Description
ts_condition_templates repeated TsConditionTemplate The list of TsConditionTemplates
prev_page_token string (cursor of TsConditionTemplate) A token to retrieve previous page of results. Pass this value in the ListTsConditionTemplatesRequest.page_token.
next_page_token string (cursor of TsConditionTemplate) A token to retrieve next page of results. Pass this value in the ListTsConditionTemplatesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total TsConditionTemplates across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchTsConditionTemplateRequest Message

A request message of the WatchTsConditionTemplate method.

Name Type Description
name string (name of TsConditionTemplate) Name of ntt.alerting.v1.TsConditionTemplate
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchTsConditionTemplateResponse Message

A response message of the WatchTsConditionTemplate method.

Name Type Description
change TsConditionTemplateChange

WatchTsConditionTemplatesRequest Message

A request message of the WatchTsConditionTemplates method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of TsConditionTemplate) Parent name of ntt.alerting.v1.TsConditionTemplate
page_size int32 Requested page size. Server may return fewer TsConditionTemplates than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of TsConditionTemplate) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of TsConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of TsConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to TsConditionTemplate that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to TsConditionTemplate that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchTsConditionTemplatesResponse Message

A response message of the WatchTsConditionTemplates method.

Name Type Description
ts_condition_template_changes repeated TsConditionTemplateChange Changes of TsConditionTemplates
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All TsConditionTemplates will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchTsConditionTemplatesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (TsConditionTemplates will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchTsConditionTemplatesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of TsConditionTemplate) New token to retrieve previous page of results.
next_page_token string (cursor of TsConditionTemplate) New token to retrieve next page of results.

CreateTsConditionTemplateRequest Message

A request message of the CreateTsConditionTemplate method.

Name Type Description
parent string (parent name of TsConditionTemplate) Parent name of ntt.alerting.v1.TsConditionTemplate
ts_condition_template TsConditionTemplate TsConditionTemplate resource body
response_mask CreateTsConditionTemplateRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateTsConditionTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateTsConditionTemplateRequest Message

A request message of the UpdateTsConditionTemplate method.

Name Type Description
ts_condition_template TsConditionTemplate TsConditionTemplate resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateTsConditionTemplateRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateTsConditionTemplateRequest.ResponseMask

UpdateTsConditionTemplateRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state TsConditionTemplate Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateTsConditionTemplateRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteTsConditionTemplateRequest Message

A request message of the DeleteTsConditionTemplate method.

Name Type Description
name string (name of TsConditionTemplate) Name of ntt.alerting.v1.TsConditionTemplate
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

SearchTsConditionTemplatesRequest Message

A request message of the SearchTsConditionTemplates method.

Name Type Description
parent string (parent name of TsConditionTemplate) Parent name of ntt.alerting.v1.TsConditionTemplate
page_size int32 Requested page size. Server may return fewer TsConditionTemplates than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsConditionTemplate) A token identifying a page of results the server should return. Typically, this is the value of SearchTsConditionTemplatesResponse.next_page_token.
order_by string (orderBy of TsConditionTemplate) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsConditionTemplate) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
phrase string Optional search phrase used to further filter results.

SearchTsConditionTemplatesResponse Message

A response message of the SearchTsConditionTemplates method.

Name Type Description
ts_condition_templates repeated TsConditionTemplate The list of TsConditionTemplates
prev_page_token string (cursor of TsConditionTemplate) A token to retrieve previous page of results. Pass this value in the SearchTsConditionTemplatesRequest.page_token.
next_page_token string (cursor of TsConditionTemplate) A token to retrieve next page of results. Pass this value in the SearchTsConditionTemplatesRequest.page_token.
current_offset int32 Current offset from the first page (0 if no page tokens were given). Page index can be computed from offset and limit provided in a request
total_results_count int32 Number of total TsConditionTemplates across all pages.

TsEntry Resource

TsEntry contains stateful data for each unique Group by fields combination within individual TsCondition resource. Each TsEntry has own set of alerts too. TsEntry contains dynamic thresholds or anomaly detection models.

Name patterns:

  • projects/{project}/policies/{policy}/tsConditions/{ts_condition}/regions/{region}/tsEntries/{ts_entry}

Parent resources:

This section covers the methods and messages to interact with TsEntry resource.

TsEntry Methods

Here is the list of TsEntry resource methods:

GetTsEntry Method

GetTsEntry

rpc GetTsEntry(GetTsEntryRequest) returns (TsEntry)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.get

The equivalent REST API is:

GET /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/tsEntries/*} 

BatchGetTsEntries Method

BatchGetTsEntries

rpc BatchGetTsEntries(BatchGetTsEntriesRequest) returns (BatchGetTsEntriesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.batchGet

The equivalent REST API is:

GET /v1/tsEntries:batchGet 

ListTsEntries Method

ListTsEntries

rpc ListTsEntries(ListTsEntriesRequest) returns (ListTsEntriesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.list

The equivalent REST API is:

GET /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/tsEntries 

WatchTsEntry Method

WatchTsEntry

rpc WatchTsEntry(WatchTsEntryRequest) returns (WatchTsEntryResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.watch

The equivalent REST API is:

POST /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/tsEntries/*}:watch 

WatchTsEntries Method

WatchTsEntries

rpc WatchTsEntries(WatchTsEntriesRequest) returns (WatchTsEntriesResponse)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.watch

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/tsEntries:watch 

CreateTsEntry Method

CreateTsEntry

rpc CreateTsEntry(CreateTsEntryRequest) returns (TsEntry)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.create

The equivalent REST API is:

POST /v1/{parent=projects/*/policies/*/tsConditions/*/regions/*}/tsEntries (BODY: ts_entry)

UpdateTsEntry Method

UpdateTsEntry

rpc UpdateTsEntry(UpdateTsEntryRequest) returns (TsEntry)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.update

The equivalent REST API is:

PUT /v1/{ts_entry.name=projects/*/policies/*/tsConditions/*/regions/*/tsEntries/*} (BODY: ts_entry)

DeleteTsEntry Method

DeleteTsEntry

rpc DeleteTsEntry(DeleteTsEntryRequest) returns (Empty)

with the following messages:

Required Permissions:

  • services/alerting.edgelq.com/permissions/tsEntries.delete

The equivalent REST API is:

DELETE /v1/{name=projects/*/policies/*/tsConditions/*/regions/*/tsEntries/*} 

TsEntry Messages

Here is the list of TsEntry resource messages:

TsEntry Message

Name Type Description
name string (name of TsEntry) Name of TsEntry When creating a new instance, this field is optional and if not provided, it will be generated automatically. Last ID segment must conform to the following regex: [\w+/=]{1,256}
metadata Meta Metadata is an object with information like create, update and delete time (for async deleted resources), has user labels/annotations, sharding information, multi-region syncing information and may have non-schema owners (useful for taking ownership of resources belonging to lower level services by higher ones).
info TsEntry.Info Identification information
state TsEntry.State State with anomaly detection models and dynamic thresholds.
internal TsEntry.Internal Internal field.

TsEntry.Info Message

Info provides unique description of a resource.

Name Type Description
alerting_resource OwnerReference Alerting resource points to the original resource associated with this TsEntry. This meta reference works like dynamic type (any service, any resource). TODO: We could use of “DynamicReference” message type. It can be similar to OwnerReference, except it works more like reference (uses EstablishReferences…). It can support most normal behaviors, like CASCADE DELETE/UNSET.
group_by_key bytes Binary time series key containing labels information.
common_metric_labels map<string, string> Common metric labels
common_resource_labels map<string, string> Common resource labels.

TsEntry.State Message

State contains all stateful data that is necessary for alert detection: Individualised adaptive thresholds and anomaly detection models.

Name Type Description
models repeated TsEntry.State.AnomalyModelData Anomaly detection models for each analysis window.
thresholds repeated TsEntry.State.AdaptiveThresholdInfo Adaptive thresholds (per each query in TsCondition).

TsEntry.Internal Message

Internal data.

Name Type Description
alerting_location PolicySpec.ProcessingLocation
spec_generation int32

TsEntry.State.AnomalyModelData Message

AnomalyModelData contains data for specific analysis window.

Name Type Description
analysis_window .google.protobuf.Duration Analysis window size.
model_data bytes Model binary data.
training_mean_err repeated double Average training errors (one float per each query)
training_max_err repeated double Maximum training errors (one float per each query)
trained_in_epochs int32 Number of epochs used to train model
trained_in .google.protobuf.Duration Informs how long it took to train this model.
train_after .google.protobuf.Timestamp Indicates if another training should be executed, and when.
training_period TimeInterval Training period that was selected for this model.
sensitiveness repeated TsEntry.State.AnomalyModelSensitiveness Sensitiveness (also called anomaly thresholds) per each query in TsCondition. Alert is raised when anomaly is detected for any of time series data.

TsEntry.State.AnomalyModelSensitiveness Message

AnomalyModelSensitiveness defines when anomaly is considered large enough to warrant new alert creation.

Name Type Description
query_name string Name of the matching query in TsCondition
anomaly_threshold double Threshold after which anomaly is considered too big.

TsEntry.State.AdaptiveThresholdInfo Message

AdaptiveThresholdInfo contains dynamic adaptive thresholds.

Name Type Description
query_name string Matching query name in TsCondition
lower AlertingThreshold Lower threshold value. Values below are considered violations.
upper AlertingThreshold Upper threshold value. Values above are considered violations.
next_check .google.protobuf.Timestamp Contains timestamp when thresholds should be adapted and checked after.

GetTsEntryRequest Message

A request message of the GetTsEntry method.

Name Type Description
name string (name of TsEntry) Name of ntt.alerting.v1.TsEntry
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsEntriesRequest Message

A request message of the BatchGetTsEntries method.

Name Type Description
names repeated string (name of TsEntry) Names of TsEntries
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

BatchGetTsEntriesResponse Message

A response message of the BatchGetTsEntries method.

Name Type Description
ts_entries repeated TsEntry found TsEntries
missing repeated string (name of TsEntry) list of not found TsEntries

ListTsEntriesRequest Message

A request message of the ListTsEntries method.

Name Type Description
parent string (parent name of TsEntry) Parent name of ntt.alerting.v1.TsEntry
page_size int32 Requested page size. Server may return fewer TsEntries than requested. If unspecified, server will pick an appropriate default.
page_token string (cursor of TsEntry) A token identifying a page of results the server should return. Typically, this is the value of ListTsEntriesResponse.next_page_token.
order_by string (orderBy of TsEntry) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination list of field path with order directive, either ‘asc’ or ‘desc’. If direction is not provided, ‘asc’ is assumed. e.g. “state.nested_field asc, state.something.else desc, theme”
filter string (filter of TsEntry) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask
include_paging_info bool Indicates if list response should contain total count and offset (fields current_offset and total_results_count).

ListTsEntriesResponse Message

A response message of the ListTsEntries method.

Name Type Description
ts_entries repeated TsEntry The list of TsEntries
prev_page_token string (cursor of TsEntry) A token to retrieve previous page of results. Pass this value in the ListTsEntriesRequest.page_token.
next_page_token string (cursor of TsEntry) A token to retrieve next page of results. Pass this value in the ListTsEntriesRequest.page_token.
current_offset int32 Current offset from the first page or 0 if no page tokens were given, paging info was not requested or there was an error while trying to get it). Page index can be computed from offset and limit provided in a request.
total_results_count int32 Number of total TsEntries across all pages or 0, if there are no items, paging info was not requested or there was an error while trying to get it.

WatchTsEntryRequest Message

A request message of the WatchTsEntry method.

Name Type Description
name string (name of TsEntry) Name of ntt.alerting.v1.TsEntry
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask

WatchTsEntryResponse Message

A response message of the WatchTsEntry method.

Name Type Description
change TsEntryChange

WatchTsEntriesRequest Message

A request message of the WatchTsEntries method.

Name Type Description
type WatchType Type of a watch. Identifies how server stream data to a client, which fields in a request are allowed and which fields in response are relevant.
parent string (parent name of TsEntry) Parent name of ntt.alerting.v1.TsEntry
page_size int32 Requested page size. Server may return fewer TsEntries than requested. If unspecified, server will pick an appropriate default. Can be populated only for stateful watch type.
page_token string (cursor of TsEntry) A token identifying a page of results the server should return. Can be populated only for stateful watch type.
order_by string (orderBy of TsEntry) Order By - https://cloud.google.com/apis/design/design_patterns#list_pagination Can be populated only for stateful watch type.
resume_token string A token identifying watch resume point from previous session. Can be populated only for stateless watch type.
starting_time .google.protobuf.Timestamp Point in the time from which we want to start getting updates. This field can be populated only for stateless watch type and if resume token is not known yet. If specified, initial snapshot will NOT be provided. It is assumed client can obtain it using separate means. Watch responses will contain resume tokens which should be used to resume broken connection.
filter string (filter of TsEntry) Filter - filter results by field criteria. Simplified SQL-like syntax with following operators: <=, >=, =, !=, <, >, LIKE, CONTAINS (aliases CONTAIN, HAS, HAVE), IN, IS [NOT] NULL
field_mask .google.protobuf.FieldMask A list of extra fields to be obtained for each response item on top of fields defined by request field view Changes to TsEntry that don’t affect any of masked fields won’t be sent back.
view View View defines list of standard response fields present in response items. Additional fields can be amended by request field field_mask Changes to TsEntry that don’t affect any of masked fields won’t be sent back.
max_chunk_size int32 Maximum amount of changes in each response message. Query result response is divided on the server side into chunks with size of a specified amount to limit memory footprint of each message. Responses will hold information whether more elements will continue for the actual change. If unspecified, server will pick an appropriate default.

WatchTsEntriesResponse Message

A response message of the WatchTsEntries method.

Name Type Description
ts_entry_changes repeated TsEntryChange Changes of TsEntries
is_current bool If request specified max_chunk_size (or this limit was enforced if stateless watch has been chosen), then responses with “full changeset” will be divided into chunks. Client should keep receiving messages and, once is_current has value true, combine this recent message with all previous ones where is_current is false. If this is the first is_current in a whole watch stream, then it means that client should have, at this moment, contain snapshot of the current situation (or more accurately, snapshot of situation at the moment of request). All TsEntries will be of type Added/Current (depending on watch_type specified in the request). Further responses will be incremental - however messages may still be chunked and is_current logic still applies. is_current is always true for stateful watch if max_chunk_size was left to 0.
page_token_change WatchTsEntriesResponse.PageTokenChange When present, PageTokens used for page navigation should be updated. Present only if is_current is true (last chunk).
resume_token string Token that can be used if current connection drops and client needs to reconnect. Populated only for stateless watch type. Present only if is_current is true (last chunk).
snapshot_size int64 Server may occasionally send information how many resources should client have in its state so far (response message without any changes, but with snapshot_size field specified). If client has different value than the one sent by the server, then it should be treated by a client as an error and should reconnect. If value is smaller then 0, then client should ignore this field as unpopulated. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will be never sent together with is_current, is_soft_reset and is_hard_reset flags.
is_soft_reset bool In case of internal issue server may send response message with this flag. It indicates that client should drop all changes from recent responses where is_current is false only! If last message had is_current set to true, client should do nothing and process normally. Resume token received before is still valid. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_hard_reset or snapshot_size.
is_hard_reset bool In case of internal issue server may send response message with this flag. After receiving, client should clear whole state (drop all changes received so far) as server will send new snapshot (TsEntries will contains changes of type Current only). Any resume tokens should be discarded as well. This field should be checked only for stateless watch. In stateful those kind of errors are handled by the server side. Will never be sent along with is_current, is_soft_reset or snapshot_size.

WatchTsEntriesResponse.PageTokenChange Message

Name Type Description
prev_page_token string (cursor of TsEntry) New token to retrieve previous page of results.
next_page_token string (cursor of TsEntry) New token to retrieve next page of results.

CreateTsEntryRequest Message

A request message of the CreateTsEntry method.

Name Type Description
parent string (parent name of TsEntry) Parent name of ntt.alerting.v1.TsEntry
ts_entry TsEntry TsEntry resource body
response_mask CreateTsEntryRequest.ResponseMask Optional masking applied to response object to reduce message response size.

CreateTsEntryRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields.

UpdateTsEntryRequest Message

A request message of the UpdateTsEntry method.

Name Type Description
ts_entry TsEntry TsEntry resource body
update_mask .google.protobuf.FieldMask FieldMask applied to request - change will be applied only for fields in the mask
cas UpdateTsEntryRequest.CAS Conditional update applied to request if update should be executed only for specific resource state. If this field is populated, then server will fetch existing resource, compare with the one stored in the cas field (after applying field mask) and proceed with update only and only if they match. Otherwise RPC error Aborted will be returned.
allow_missing bool If set to true, and the resource is not found, a new resource will be created. In this situation, ‘field_mask’ is ignored. https://google.aip.dev/134#create-or-update
response_mask UpdateTsEntryRequest.ResponseMask

UpdateTsEntryRequest.CAS Message

CAS - Compare and Swap. This object is used if user wants to make update conditional based upon previous resource version.

Name Type Description
conditional_state TsEntry Conditional desired state of a resource before update.
field_mask .google.protobuf.FieldMask Field paths from conditional state of resource server should check and compare.

UpdateTsEntryRequest.ResponseMask Message

ResponseMask allows client to reduce response message size.

Name Type Description
skip_entire_response_body bool If this flag has value true, then response will contain just empty resource without any fields populated. Field body_mask is ignored if set.
updated_fields_only bool Include all fields that were actually updated during processing. Note this may be larger than update mask if some fields were computed additionally. Name is added as well.
body_mask .google.protobuf.FieldMask If this field is populated, then resource in response will contain only specific fields. If skip_entire_response_body is true, this field is ignored.

DeleteTsEntryRequest Message

A request message of the DeleteTsEntry method.

Name Type Description
name string (name of TsEntry) Name of ntt.alerting.v1.TsEntry
allow_missing bool If set to true, and the resource is not found, method will be successful and will not return NotFound error.

Alerting Service Shared Methods and Messages

Alerting Service Shared Methods

Here is the list of Alerting service shared methods:

WatchAlertData Method

WatchAlertData

rpc WatchAlertData(WatchAlertDataRequest) returns (WatchAlertDataResponse)

Alerting Service Shared Messages

Here is the list of Alerting service shared messages:

AlertChange Message

AlertChange is used by Watch notifications Responses to describe change of single Alert One of Added, Modified, Removed

Name Type Description
added AlertChange.Added Added is returned when watched document is added, either created or enters Query view
modified AlertChange.Modified Modified is returned when watched document is modified
current AlertChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed AlertChange.Removed Removed is returned when Alert is deleted or leaves Query view

AlertChange.Added Message

Alert has been added to query view

Name Type Description
alert Alert
view_index int32 Integer describing index of added Alert in resulting query view.

AlertChange.Current Message

Alert has been added or modified in a query view. Version used for stateless watching

Name Type Description
alert Alert

AlertChange.Modified Message

Alert changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of Alert) Name of modified Alert
alert Alert New version of Alert or masked difference, depending on mask_changes instrumentation of issued [WatchAlertRequest] or [WatchAlertsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified Alert. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying Alert new index in resulting query view.

AlertChange.Removed Message

Removed is returned when Alert is deleted or leaves Query view

Name Type Description
name string (name of Alert)
view_index int32 Integer specifying removed Alert index. Not populated in stateless watch type.

AlertingThreshold Message

AlertingThreshold defines threshold value for alerting.

Name Type Description
value double Value that must not be crossed.
is_inclusive bool If true, then alert is raised when exact specified value is reached. Otherwise, it has to be crossed.

DocumentChange Message

DocumentChange is used by Watch notifications Responses to describe change of single Document One of Added, Modified, Removed

Name Type Description
added DocumentChange.Added Added is returned when watched document is added, either created or enters Query view
modified DocumentChange.Modified Modified is returned when watched document is modified
current DocumentChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed DocumentChange.Removed Removed is returned when Document is deleted or leaves Query view

DocumentChange.Added Message

Document has been added to query view

Name Type Description
document Document
view_index int32 Integer describing index of added Document in resulting query view.

DocumentChange.Current Message

Document has been added or modified in a query view. Version used for stateless watching

Name Type Description
document Document

DocumentChange.Modified Message

Document changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of Document) Name of modified Document
document Document New version of Document or masked difference, depending on mask_changes instrumentation of issued [WatchDocumentRequest] or [WatchDocumentsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified Document. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying Document new index in resulting query view.

DocumentChange.Removed Message

Removed is returned when Document is deleted or leaves Query view

Name Type Description
name string (name of Document)
view_index int32 Integer specifying removed Document index. Not populated in stateless watch type.

LogCndSpec Message

LogCndSpec informs what Logging queries should be monitored for alerting, and what content should be considered as violation.

Name Type Description
query LogCndSpec.Query Specifies logging query
group_by_labels repeated string Group by labels inform how to split monitored Logs stream. Each unique combination of label values is considered separately as own alerting bucket. All labels defined in Policy must be defined here.

LogCndSpec.Query Message

Query specifies what logging query should be monitored.

Name Type Description
filter string (filter of Log) Filter used to continuously observe log query output.
trigger LogCndSpec.Query.TriggerCnd Trigger under which Alert is raised
min_duration .google.protobuf.Duration Informs how long alert should be maintained in firing state since last occurrence.

LogCndSpec.Query.CompositeTrigger Message

CompositeTrigger collects multiple triggers together.

Name Type Description
triggers repeated LogCndSpec.Query.TriggerCnd List of triggers.
operator LogCndSpec.Query.CompositeTrigger.Operator Operator combining triggers

LogCndSpec.Query.LabelTrigger Message

LabelTrigger informs what label Log must have to be considered as a violation.

Name Type Description
key string Label key
values repeated string Triggering label values.

LogCndSpec.Query.StringPayloadTrigger Message

StringPayloadTrigger informs what text content of log is triggering an alert.

Name Type Description
object_selector string Optional selector inside log data field. It should be ignored if log entry is just a string or byte array. It can be used if log is some JSON object, and we search for specific fields.
regex string Regex that log content must satisfy to trigger an alert

LogCndSpec.Query.TriggerCnd Message

TriggerCnd wraps a trigger deciding when to trigger an alert. It inspects each Log individually.

Name Type Description
label LogCndSpec.Query.LabelTrigger Trigger based on label
string_content LogCndSpec.Query.StringPayloadTrigger Trigger based on log textual content
composite LogCndSpec.Query.CompositeTrigger Composite trigger combining multiple smaller ones

LogConditionChange Message

LogConditionChange is used by Watch notifications Responses to describe change of single LogCondition One of Added, Modified, Removed

Name Type Description
added LogConditionChange.Added Added is returned when watched document is added, either created or enters Query view
modified LogConditionChange.Modified Modified is returned when watched document is modified
current LogConditionChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed LogConditionChange.Removed Removed is returned when LogCondition is deleted or leaves Query view

LogConditionChange.Added Message

LogCondition has been added to query view

Name Type Description
log_condition LogCondition
view_index int32 Integer describing index of added LogCondition in resulting query view.

LogConditionChange.Current Message

LogCondition has been added or modified in a query view. Version used for stateless watching

Name Type Description
log_condition LogCondition

LogConditionChange.Modified Message

LogCondition changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of LogCondition) Name of modified LogCondition
log_condition LogCondition New version of LogCondition or masked difference, depending on mask_changes instrumentation of issued [WatchLogConditionRequest] or [WatchLogConditionsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified LogCondition. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying LogCondition new index in resulting query view.

LogConditionChange.Removed Message

Removed is returned when LogCondition is deleted or leaves Query view

Name Type Description
name string (name of LogCondition)
view_index int32 Integer specifying removed LogCondition index. Not populated in stateless watch type.

LogConditionTemplateChange Message

LogConditionTemplateChange is used by Watch notifications Responses to describe change of single LogConditionTemplate One of Added, Modified, Removed

Name Type Description
added LogConditionTemplateChange.Added Added is returned when watched document is added, either created or enters Query view
modified LogConditionTemplateChange.Modified Modified is returned when watched document is modified
current LogConditionTemplateChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed LogConditionTemplateChange.Removed Removed is returned when LogConditionTemplate is deleted or leaves Query view

LogConditionTemplateChange.Added Message

LogConditionTemplate has been added to query view

Name Type Description
log_condition_template LogConditionTemplate
view_index int32 Integer describing index of added LogConditionTemplate in resulting query view.

LogConditionTemplateChange.Current Message

LogConditionTemplate has been added or modified in a query view. Version used for stateless watching

Name Type Description
log_condition_template LogConditionTemplate

LogConditionTemplateChange.Modified Message

LogConditionTemplate changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of LogConditionTemplate) Name of modified LogConditionTemplate
log_condition_template LogConditionTemplate New version of LogConditionTemplate or masked difference, depending on mask_changes instrumentation of issued [WatchLogConditionTemplateRequest] or [WatchLogConditionTemplatesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified LogConditionTemplate. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying LogConditionTemplate new index in resulting query view.

LogConditionTemplateChange.Removed Message

Removed is returned when LogConditionTemplate is deleted or leaves Query view

Name Type Description
name string (name of LogConditionTemplate)
view_index int32 Integer specifying removed LogConditionTemplate index. Not populated in stateless watch type.

NotificationChannelChange Message

NotificationChannelChange is used by Watch notifications Responses to describe change of single NotificationChannel One of Added, Modified, Removed

Name Type Description
added NotificationChannelChange.Added Added is returned when watched document is added, either created or enters Query view
modified NotificationChannelChange.Modified Modified is returned when watched document is modified
current NotificationChannelChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed NotificationChannelChange.Removed Removed is returned when NotificationChannel is deleted or leaves Query view

NotificationChannelChange.Added Message

NotificationChannel has been added to query view

Name Type Description
notification_channel NotificationChannel
view_index int32 Integer describing index of added NotificationChannel in resulting query view.

NotificationChannelChange.Current Message

NotificationChannel has been added or modified in a query view. Version used for stateless watching

Name Type Description
notification_channel NotificationChannel

NotificationChannelChange.Modified Message

NotificationChannel changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of NotificationChannel) Name of modified NotificationChannel
notification_channel NotificationChannel New version of NotificationChannel or masked difference, depending on mask_changes instrumentation of issued [WatchNotificationChannelRequest] or [WatchNotificationChannelsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified NotificationChannel. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying NotificationChannel new index in resulting query view.

NotificationChannelChange.Removed Message

Removed is returned when NotificationChannel is deleted or leaves Query view

Name Type Description
name string (name of NotificationChannel)
view_index int32 Integer specifying removed NotificationChannel index. Not populated in stateless watch type.

NotificationChannelSpec Message

NotificationChannelSpec informs what kind of channel it is, and how to send there messages.

Name Type Description
enabled bool Enabled flag. Whether the NotificationChannel is enabled or not. Disabled channels will not be used for alerting.
type NotificationChannelSpec.Type Type. Corresponding spec should a oneof field.
enabled_kinds repeated NotificationChannelSpec.EventKind List of alert state event kinds when we want to send a notification.
email NotificationChannelSpec.Email Email
slack NotificationChannelSpec.Slack Slack
webhook NotificationChannelSpec.Webhook Webhook endpoint
notification_language_code string Default language for invitation is english (eng) Configuring unsupported language will fallback to english Currently only sendgrid uses this.
notification_mask .google.protobuf.FieldMask Notification mask contains list of fields to include in the message. It must match NotificationMsg
max_alert_bodies_in_msg int32 If bigger than 0, then number of alert bodies in message will be cut to this value.
put_only_alerts_counter_when_overflowing bool This field matters if max_alert_bodies_in_msg is bigger than 0. If this field has value true, then notification message will only inform how many alerts additionally were raised on top of provided in the notification. If false, multiple notifications will be generated.

NotificationChannelSpec.Email Message

Email Spec

Name Type Description
addresses repeated string Email Addresses

NotificationChannelSpec.PagerDuty Message

PagerDuty Spec

Name Type Description
service_key string PagerDuty Service Key

NotificationChannelSpec.Slack Message

Slack Spec

Name Type Description
incoming_webhook string Slack Incoming Webhook URL

NotificationChannelSpec.Webhook Message

Webhook Spec

Name Type Description
url string Webhook URL
headers repeated NotificationChannelSpec.Webhook.Header Headers
max_message_size_mb double default is 0 means all the alerts in a notification are sent in single request. Breaking into multiple messages may be significantly slower than sending a single message. For example, to use 250KB chunks, set 0.25 MB

NotificationChannelSpec.Webhook.Header Message

Header

Name Type Description
key string
value string

NotificationMsg Message

NotificationMsg is a notification message sent to channels, according to NotificationChannel resource.

Name Type Description
project_fqn string (name of Project)
project_display_name string
organization_fqn string (name of Organization)
organization_display_name string
policy_fqn string (name of Policy)
policy_display_name string
new_firing_alerts NotificationMsg.AlertsGroup
alerts_escalated_by_ai_to_operator NotificationMsg.AlertsGroup
alerts_awaiting_for_approval_with_ai_remediation NotificationMsg.AlertsGroup
alerts_flagged_to_ignore_by_ai NotificationMsg.AlertsGroup
alerts_with_condition_marked_for_adjusting_by_ai NotificationMsg.AlertsGroup
alerts_with_ai_remediation_applied NotificationMsg.AlertsGroup
alerts_with_operator_remediation_applied NotificationMsg.AlertsGroup
stopped_alerts NotificationMsg.AlertsGroup

NotificationMsg.AlertsGroup Message

Name Type Description
by_condition repeated NotificationMsg.AlertsGroup.ConditionAlerts

NotificationMsg.AlertsGroup.ConditionAlerts Message

Name Type Description
time_series_condition NotificationMsg.AlertsGroup.ConditionAlerts.TsCndType
log_condition NotificationMsg.AlertsGroup.ConditionAlerts.LogCndType
alerts repeated NotificationMsg.AlertsGroup.ConditionAlerts.Alert
more_alerts_count int32

NotificationMsg.AlertsGroup.ConditionAlerts.Alert Message

Name Type Description
type NotificationMsg.AlertsGroup.ConditionAlerts.Alert.Type
fqn string (name of Alert)
display_name string
is_firing bool
start_time .google.protobuf.Timestamp
stop_time .google.protobuf.Timestamp
identification NotificationMsg.AlertsGroup.ConditionAlerts.Alert.Identification
violation_info NotificationMsg.AlertsGroup.ConditionAlerts.Alert.ViolationInfo
escalation_level Alert.State.EscalationLevel
ai_handling NotificationMsg.AlertsGroup.ConditionAlerts.Alert.AiHandling
operator_handling NotificationMsg.AlertsGroup.ConditionAlerts.Alert.OperatorHandling

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.AiHandling Message

Name Type Description
current_state Alert.State.AiHandlingState
troubleshooting_notes string
ai_remediation PolicySpec.AIAgentHandling.Remediation
remediation_arg string

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.Identification Message

Name Type Description
log_labels map<string, string>
metric_labels map<string, string>
resource_labels map<string, string>

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.OperatorHandling Message

Name Type Description
current_state Alert.State.OperatorHandlingState
notes string

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.ViolationInfo Message

Name Type Description
log_value string
time_series repeated NotificationMsg.AlertsGroup.ConditionAlerts.Alert.ViolationInfo.TimeSeries

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.ViolationInfo.TimeSeries Message

Name Type Description
query string
values repeated double
upper_threshold AlertingThreshold
lower_threshold AlertingThreshold
raised_after .google.protobuf.Duration

NotificationMsg.AlertsGroup.ConditionAlerts.LogCndType Message

Name Type Description
fqn string (name of LogCondition)
display_name string
queries repeated NotificationMsg.AlertsGroup.ConditionAlerts.LogCndType.Query

NotificationMsg.AlertsGroup.ConditionAlerts.LogCndType.Query Message

Name Type Description
description string
filter string

NotificationMsg.AlertsGroup.ConditionAlerts.TsCndType Message

Name Type Description
fqn string (name of TsCondition)
display_name string
queries repeated NotificationMsg.AlertsGroup.ConditionAlerts.TsCndType.Query

NotificationMsg.AlertsGroup.ConditionAlerts.TsCndType.Query Message

Name Type Description
description string
filter string
aggregation Aggregation

PolicyChange Message

PolicyChange is used by Watch notifications Responses to describe change of single Policy One of Added, Modified, Removed

Name Type Description
added PolicyChange.Added Added is returned when watched document is added, either created or enters Query view
modified PolicyChange.Modified Modified is returned when watched document is modified
current PolicyChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed PolicyChange.Removed Removed is returned when Policy is deleted or leaves Query view

PolicyChange.Added Message

Policy has been added to query view

Name Type Description
policy Policy
view_index int32 Integer describing index of added Policy in resulting query view.

PolicyChange.Current Message

Policy has been added or modified in a query view. Version used for stateless watching

Name Type Description
policy Policy

PolicyChange.Modified Message

Policy changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of Policy) Name of modified Policy
policy Policy New version of Policy or masked difference, depending on mask_changes instrumentation of issued [WatchPolicyRequest] or [WatchPoliciesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified Policy. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying Policy new index in resulting query view.

PolicyChange.Removed Message

Removed is returned when Policy is deleted or leaves Query view

Name Type Description
name string (name of Policy)
view_index int32 Integer specifying removed Policy index. Not populated in stateless watch type.

PolicySpec Message

PolicySpec defines common specification parts shared by all conditions within:

  • Enabled flag
  • Processing location
  • Standard troubleshooting queries to be executed for triggered alerts.
  • Shared resource type identity
  • Whether and how AI agent should be handling alerts
Name Type Description
enabled bool Enabled controls whether conditions within are active or not.
processing_location PolicySpec.ProcessingLocation Decides whether alerting is executed in backend or at the edge. This field cannot be modified.
resource_identity PolicySpec.ResourceIdentity Resource identity shared by all conditions/alerts within policy.
supporting_queries repeated PolicySpec.SupportingAlertQuery List of all supporting queries to be executed for alerts within Policy.
ai_agent PolicySpec.AIAgentHandling Defines AI agent handling for alerts within this policy

PolicySpec.AIAgentHandling Message

AIAgentHandling defines instructions for AI agent how to handle alerts generated within current Policy.

Name Type Description
enabled bool Whether AI agent handling is enabled.
enabled_connectivity bool Whether AI agent is allowed to SSH into alerting resource for further investigation outside of defined queries. To have an effect, it is necessary to specify edge_connectivity field.
auto_accept_remediation bool Whether remediation’s proposed by AI agent should be automatically accepted without operator consent (full autonomous mode).
edge_connectivity PolicySpec.AIAgentHandling.EdgeConnectivity Describes how to connect to alerting resource in a context of Alert.
remediation_options repeated PolicySpec.AIAgentHandling.Remediation Specifies list of suggested remediations for AI agent to apply

PolicySpec.AIAgentHandling.EdgeConnectivity Message

EdgeConnectivity describes means of accessing alerting resource for troubleshooting purposes.

Name Type Description
device_ssh PolicySpec.AIAgentHandling.EdgeConnectivity.DeviceSSH Device SSH connectivity
proxies_ssh PolicySpec.AIAgentHandling.EdgeConnectivity.ProxiesSSH Proxies SSH connectivity
pod_ssh PolicySpec.AIAgentHandling.EdgeConnectivity.PodSSH Pod SSH connectivity
allowed_bins repeated string Optional list of allowed binaries that AI agent can use. This can be used to restrict potential errors, or indicate what utils are available.

PolicySpec.AIAgentHandling.EdgeConnectivity.DeviceSSH Message

DeviceSSH informs that AI agent can SSH into alerting resource using standard droplet-exposed SSH tunnel. It is necessary to provide LabelInfo with device_id key in resource identity, but its possible to use DeviceSSH connectivity for non-Device alerts too. It is only necessary that alerting resource runs a droplet process.

Name Type Description
client_name string Client name for self-identification. Can be any unique name like “llm-alerting-agent”.

PolicySpec.AIAgentHandling.EdgeConnectivity.PodSSH Message

PodSSH can be used if application is running as a Pod supported by droplet. TODO: Not implemented

Name Type Description
client_name string Client name for self-identification. Can be any unique name like “llm-alerting-agent”.
username string Username to use.

PolicySpec.AIAgentHandling.EdgeConnectivity.ProxiesSSH Message

ProxiesSSH informs that AI agent can SSH into alerting resource using proxies service, standard SSH connectivity messages. It is assumed that some process on alerting resource is connected to proxies exposing SSH tunnel. Refer to Connect method in Proxies.

Name Type Description
service_domain string Service domain to use in Connect request.
provider_name_tmpl string Provider name template to use in Connect request. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field, plus special <project_id> and <region_id>.
client_name string Client name for self-identification. Can be any unique name like “llm-alerting-agent”.
service_name string Service name to use in Connect request.

PolicySpec.AIAgentHandling.Remediation Message

Remediation indicates option available to AI agent.

Name Type Description
fix_in_ssh PolicySpec.AIAgentHandling.Remediation.FixInSSH FixInSSH remediation type.
reboot PolicySpec.AIAgentHandling.Remediation.Reboot Reboot remediation type. It can be specified only if resource identity points to devices.edgelq.com/Device, and if pod_id is specified as one of the available labels.

PolicySpec.AIAgentHandling.Remediation.FixInSSH Message

FixInSSH declares that issue should be fixed using SSH shell. AI Agent should provide a command to execute in shell. This option can be used only if EdgeConnectivity is specified.

Name Type Description
none none none

PolicySpec.AIAgentHandling.Remediation.Reboot Message

Reboot is a special type of remediation applicable only and only for pods -> it is necessary to provide LabelInfo with pod_id key. Pod will be restarted to remediate an issue.

Name Type Description
none none none

PolicySpec.ResourceIdentity Message

ResourceIdentity informs which MAIN resource type is generating time series/logs on which conditions are built. For core EdgeLQ, ResourceIdentity must point always to devices.edgelq.com/Device resource, even if we are creating policy for applications.edgelq.com/Pod conditions. 3rd party services can pick something else. In EdgeLQ, it will be necessary to create separate Policy objects, if one is for Device conditions, and other for Pod conditions. Both will point to devices.edgelq.com/Device as main resource identity, both will have to specify device_id LabelInfo. Second one will have to specify pod_id LabelInfo.

Name Type Description
alerting_resource string (reference to Resource) Reference to primary alerting resource kind. For EdgeLQ, it is services/devices.edgelq.com/resources/Device resource. Pods belong to device, so everything is device scoped. 3rd party services can provide different resource type.
labels repeated PolicySpec.ResourceIdentity.LabelInfo All interesting labels that can be found in ALL Log/Ts Conditions group by fields within Policy. It is necessary to provide labels to at least satisfy name pattern of main alerting_resource. It is optional to provide more labels, in order to identify auxiliary resources. By default, there are 2 built-in LabelInfo objects: * key: “project_id”, points to project name segment. It is mapped to project of TimeSeries or Log object * key: “region_id”, points to region name segment. It is mapped to region of TimeSeries or Log object.
name_patterns repeated string List of name patterns of main alerting resource kind. Note that all name segments (divided by each even “/” character) must be satisfied within labels.mapped_name_segment fields, with exception of “project” and “region”, which are built-in. TODO: As of now, only one pattern. However, it should be possible to deduce name patterns from meta.goten.com service, so they are not provided here at all. Name pattern must conform to standard goten style name pattern. For example, name pattern of devices.edgelq.com/Device is “projects/{project}/regions/{region}/devices/{device}”.

PolicySpec.ResourceIdentity.LabelInfo Message

LabelInfo binds a label from Log/TimeSeries object into specific name segment of a resource associated with an Alert raised within current Policy. Multiple LabelInfo instances within ResourceIdentity are used to reconstruct full resource names. For example, resource type devices.edgelq.com/Device has a single known name pattern projects/{project}/regions/{region}/devices/{device}. There are 3 name segments: project, region, and device. Segments “project” and “region” are built-in always and dont have to be defined. Policy owner will have to provide single LabelInfo in this case, for device segment only. LabelInfo may be used to point to other auxiliary resources. For example, if Policy focuses on conditions for applications.edgelq.com/Pod resource type, administrator can create Policy with 2 LabelInfo objects: One with device_id as primary key, because it will be Device generating all time series (also for pods), then other LabelInfo must contain object with key equal to pod_id.

Name Type Description
key string Label key that must be present in TsCondition/LogCondition group by fields list. Refer to labels defined in relevant monitoring.edgelq.com/MonitoredResourceDescriptor, monitoring.edgelq.com/MetricDescriptor, or logging.edgelq.com/LogDescriptor resources for which you want to create conditions. Note that “key” must match exactly one of a labels (byte to byte) specified in interesting descriptors. For example, in MonitoredResourceDescriptor of type devices.edgelq.com/Device you may find label with key “device_id”. This must be specified in LabelInfo.key if you want to create Policy focusing on Device resource.
contexts repeated PolicySpec.ResourceIdentity.LabelInfo.UsageContext List of all contexts where label with specified key can be found. It may be more than one position. For example device_id label can be found in LogDescriptor or MonitoredResourceDescriptor. In this case, we need to set 2 values in contexts field: RESOURCE_LABEL and LOG_LABEL.
mapped_name_segment string Name segment value in name pattern. This is always lowerSingularCamelCase resource type name. For example, for LabelInfo with key device_id, if it points to devices.edgelq.com/Device resource type, mapped_name_segment must be equal to “device” value (which is lower camel case).

PolicySpec.SupportingAlertQuery Message

SupportingAlertQuery specifies a common supporting troubleshooting query that can be used to investigate any Alert within current Policy. This is especially important for alerts handling by AI agent. Outputs from these queries can be used by AI agents.

Important: Many query spec string fields have _template suffix. It means that their values may contain variable values that are replaced for each specific Alert instance. Those variables have a format: <$LABEL_KEY>, where $LABEL_KEY must be one of the label keys specified in resource_identity field. For example, if we can have a Policy like this: { “resourceIdentity”: { “alertingResource”: “services/devices.edgelq.com/resources/Device”, “labels”: [ { “key”: “device_id”, “contexts”: [RESOURCE_LABEL, LOG_LABEL], “mappedNameSegment”: “device” } ], “namePatterns”: [“projects/{project}/regions/{region}/devices/{device}”] }, “supportingQueries”: [ { “tsQuery”: { “description”: “…” “filterTemplate”: “metric.type="devices.edgelq.com/Device/connected" AND resource.labels.device_id="<device_id>"” “aggregation”: {…} } } ] } In above example, we define one LabelInfo with device_id field. Therefore, alerting service will find and replace each substring <device_id> with specific value from Alert resource. If we have Alert with label device_id = “test-x”, Alerting service will execute TimeSeries query with filter metric.type="devices.edgelq.com/Device/connected" AND resource.labels.device_id="test-x"" Note that values <project_id> and <region_id> are always built-in, and will expand to project/region indicated by Alert.

Name Type Description
ts_query PolicySpec.SupportingAlertQuery.TsQuery Time Series query
log_query PolicySpec.SupportingAlertQuery.LogQuery Log query
rest_get_query PolicySpec.SupportingAlertQuery.RestGetQuery Rest Get query
rest_list_query PolicySpec.SupportingAlertQuery.RestListQuery Rest List query

PolicySpec.SupportingAlertQuery.LogQuery Message

LogQuery describes Log query to execute for each specific alert. Time interval will be set around alert time.

Name Type Description
description string Query description.
filter_template string Log filter template. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field.

PolicySpec.SupportingAlertQuery.RestGetQuery Message

RestGetQuery allows to fetch specific resource body to be included in investigation data. It is optimized for fetching resources from EdgeLQ style services. It is not possible as of now to use GRPC API, because alerting resource can be used by 3rd party service on top of EdgeLQ platform.

Name Type Description
description string Description of resource we are fetching
endpoint string Endpoint (with scheme) from which we want to fetch resource. For example, it can be https://devices.apis.edgelq.com value, if we want to access a resource from devices.edgelq.com service. Endpoint may differ depending on environment (production or staging). TODO: Replace with reference to meta.goten.com/Service
path_template string Path template to be appended to access specific resource. EdgeLQ based services use standard paths for Get requests. It is: /$API_VERSION/$RESOURCE_NAME. For example, path_template for devices.edgelq.com/Device resource in version v1, path_template must have a format: “/v1/projects/<project_id>/regions/<region_id>/devices/<device_id>”. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field.
view string It must be NAME, BASIC, DETAIL or FULL - like in each standard Get request in EdgeLQ based platform.
field_mask string List of additional fields to obtain on top of those defined within view. Fields must be comma separated, and use lower_snake_case notion.

PolicySpec.SupportingAlertQuery.RestListQuery Message

RestListQuery allows to fetch specific list of resource bodies to be included in investigation data. It is optimized for fetching resources from EdgeLQ style services. It is not possible as of now to use GRPC API, because alerting resource can be used by 3rd party service on top of EdgeLQ platform.

Name Type Description
description string Description of resources we are fetching
endpoint string Endpoint (with scheme) from which we want to fetch resource. For example, it can be https://applications.apis.edgelq.com value, if we want to access a resource from applications.edgelq.com service. Endpoint may differ depending on environment (production or staging). TODO: Replace with reference to meta.goten.com/Service
path_template string Path template to be appended to access specific resource. EdgeLQ based services use standard paths for List requests. It is: /$API_VERSION/$RESOURCE_PARENT_NAME/$PLURAL_RESOURCE_TYPE_NAME. For example, to fetch list of pods (applications.edgelq.com service), we would use path_template like this: “/v1/projects/<project_id>/regions/<region_id>/pods”. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field.
view string It must be NAME, BASIC, DETAIL or FULL - like in each standard List request in EdgeLQ based platform.
field_mask string List of additional fields to obtain on top of those defined within view. Fields must be comma separated, and use lower_snake_case notion.
filter_template string Optional filter template to be used to filter collection. For example, if we want to obtain list of pods running on a device, we should populate it with value: “spec.node="projects/<project_id>/regions/<region_id>/devices/<device_id>"”.

PolicySpec.SupportingAlertQuery.TsQuery Message

TsQuery describes TimeSeries query to execute for each specific alert. Time interval will be set around alert time.

Name Type Description
description string Query description.
filter_template string TimeSeries filter template. All substrings <$LABEL_KEY> will be replaced according to the resource_identity.labels field.
aggregation Aggregation TimeSeries aggregation object.

PolicyTemplateChange Message

PolicyTemplateChange is used by Watch notifications Responses to describe change of single PolicyTemplate One of Added, Modified, Removed

Name Type Description
added PolicyTemplateChange.Added Added is returned when watched document is added, either created or enters Query view
modified PolicyTemplateChange.Modified Modified is returned when watched document is modified
current PolicyTemplateChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed PolicyTemplateChange.Removed Removed is returned when PolicyTemplate is deleted or leaves Query view

PolicyTemplateChange.Added Message

PolicyTemplate has been added to query view

Name Type Description
policy_template PolicyTemplate
view_index int32 Integer describing index of added PolicyTemplate in resulting query view.

PolicyTemplateChange.Current Message

PolicyTemplate has been added or modified in a query view. Version used for stateless watching

Name Type Description
policy_template PolicyTemplate

PolicyTemplateChange.Modified Message

PolicyTemplate changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of PolicyTemplate) Name of modified PolicyTemplate
policy_template PolicyTemplate New version of PolicyTemplate or masked difference, depending on mask_changes instrumentation of issued [WatchPolicyTemplateRequest] or [WatchPolicyTemplatesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified PolicyTemplate. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying PolicyTemplate new index in resulting query view.

PolicyTemplateChange.Removed Message

Removed is returned when PolicyTemplate is deleted or leaves Query view

Name Type Description
name string (name of PolicyTemplate)
view_index int32 Integer specifying removed PolicyTemplate index. Not populated in stateless watch type.

TsCndSpec Message

TsCndSpec defines time series queries and thresholds/anomaly detectors.

Name Type Description
queries repeated TsCndSpec.Query List of observed queries. Each by default can raise alert by threshold. If anomaly detectors are specified, they try to learn all time series together.
query_group_by repeated string List of group by labels applied to all queries. Each unique combination of group_by is tracked separately. It has its own adaptive thresholds, its own anomaly detectors. One such representation has a form of resource TsEntry. Group by fields must define all labels defined in Policy.
threshold_alerting TsCndSpec.ThresholdAlertingCfg Threshold alerting configuration
anomaly_alerting repeated TsCndSpec.AnomalyAlertingCfg All anomaly detectors. Its possible to define multiple detectors with different analysis window. It is advisable to create one detector catching long window (1 day, step interval 15 minutes), followed by small window (15 minutes, step interval 1 minute). This should catch sudden and small anomalies, along with long term unexpected changes. Maintaining long window (1 day) along with small interval (1 minute) would be too costly. Other option detectors may be: 1 day / 30 minutes + 30 minutes / 1 minute.

TsCndSpec.AnomalyAlertingCfg Message

AnomalyDetector defines AI/ML based anomaly detector. It can catch anomalies that are more sophisticated than max/min thresholds.

Name Type Description
analysis_window .google.protobuf.Duration Sliding analysis window observed at once by AI model. For larger windows, it is highly advisable for query_ap to be accordingly larger.
step_interval .google.protobuf.Duration Duration of each time step in sliding analysis window. Anomaly detection is run after each step.
train_step_interval .google.protobuf.Duration It is like step interval, but special used for training only. For example, we may want to run anomaly detection of size 30 minutes each 5 minutes. But in training, to reduce number of batches, we may prefer larger value, like 15 minutes or maybe even 30.
alignment_period .google.protobuf.Duration Granularity of data points within each step.
lstm_autoencoder TsCndSpec.AnomalyAlertingCfg.LstmAutoEncoder
raise_after .google.protobuf.Duration
silence_after .google.protobuf.Duration

TsCndSpec.AnomalyAlertingCfg.LstmAutoEncoder Message

LstmAutoEncoder defines LSTM AutoEncoder model for anomaly detection.

Name Type Description
hidden_size int32 Hidden size. Larger increases model size.
learn_rate double Learn rate used in Adam optimizer. This is suggested value. System may iterate other well known working values for best detection.
max_training_epochs int32 Maximum number of epochs after which training must stop.
min_training_epochs int32 Minimum number of training epochs model must train.
acceptable_training_error double Minimum acceptable error after training stops. When it is achieved, check samples are used to determine actual error rates. Too large value may cause overfit. This is suggested value. System may find other values giving better results.
training_period .google.protobuf.Duration How much time must be obtained for training purposes.
check_period_fraction double Training period, analysis window and training step interval directly influence how many training samples are created. Fraction is then used for detecting practical anomalies and initializing anomaly thresholds.
teacher_force_at_inference bool Enables teacher force mode during inference. It greatly reduces false positives, but may silence some actual small anomalies. It is especially important when time series data can change behavior persistently. For example, new workload was added to CPU.

TsCndSpec.Query Message

Query defines a single TimeSeries query and basic alerting thresholds.

Name Type Description
name string Query description.
filter string (filter of TimeSerie) Time series query filter
aligner Aggregation.Aligner Aligner applied on individual TimeSeries.
reducer Aggregation.Reducer Reducer applied across TimeSeries according to Spec.query_group_by field in the Spec.
max_value double Maximum value (approximated) that time series values will have for this query. It is a soft value: If higher values are detected, thresholds/anomaly models will adjust to them. If set to 0, it will be auto-detected (heuristic). If time series are negative, max_value should indicate maximum value FROM zero: Therefore, it can be a negative value.

TsCndSpec.ThresholdAlertingCfg Message

ThresholdAlertingCfg describes when alerts of THRESHOLD type must be raised.

Name Type Description
operator TsCndSpec.ThresholdAlertingCfg.Operator Operator for threshold-type alerts
alignment_period .google.protobuf.Duration Alignment period for data points used to monitor thresholds.
raise_after .google.protobuf.Duration Violation duration after which alert must be raised.
silence_after .google.protobuf.Duration Duration after which Alert stops firing when violations no longer occur. By default, equals to raise_after.
per_query_thresholds repeated TsCndSpec.ThresholdAlertingCfg.AlertingThresholds Thresholds per each query (in same order).
adaptive_thresholds_detection_period .google.protobuf.Duration This field is recommended to be set if adaptive thresholds are used. For each unique group by fields combination, dynamic thresholds will be detected based on historic data of specified length. One week by default.

TsCndSpec.ThresholdAlertingCfg.AlertingThresholds Message

AlertingThresholds represents all thresholds. When they are crossed by time series values, alert will be raised. Max thresholds are active all the time. Adaptive thresholds are active when anomaly detectors are not available (not defined or in training). It is also possible to set minimal lower/upper thresholds, to avoid adaptive thresholds being to insensitive. Overall, alert is raised when value drops below lower threshold or above upper threshold. Working allowed range is between. Values must always satisfy condition: Upper max > Upper min > Lower min > Lower max

Name Type Description
auto_adapt_upper bool Whether upper threshold should be set and adaptive.
auto_adapt_lower bool Whether lower threshold should be set and adaptive.
max_upper AlertingThreshold Maximum allowed upper threshold. When crossed ABOVE, alert is raised. Can be set to nil, but in that case max_lower is mandatory. Adaptive upper threshold cannot be set below it.
max_lower AlertingThreshold Maximum allowed lower threshold. When crossed BELOW, alert is raised. Can be set to nil, but in that case max_upper is mandatory. Adaptive lower threshold cannot be set below it.
min_upper AlertingThreshold Minimal allowed adaptive upper threshold. It is applicable only if auto_adapt_upper is true. Adaptive upper threshold cannot be set below it. It must be smaller than max_upper.
min_lower AlertingThreshold Minimal allowed adaptive lower threshold. It is applicable only if auto_adapt_lower is true. Adaptive lower threshold cannot be set above it. It must be bigger than max_lower.

TsConditionChange Message

TsConditionChange is used by Watch notifications Responses to describe change of single TsCondition One of Added, Modified, Removed

Name Type Description
added TsConditionChange.Added Added is returned when watched document is added, either created or enters Query view
modified TsConditionChange.Modified Modified is returned when watched document is modified
current TsConditionChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed TsConditionChange.Removed Removed is returned when TsCondition is deleted or leaves Query view

TsConditionChange.Added Message

TsCondition has been added to query view

Name Type Description
ts_condition TsCondition
view_index int32 Integer describing index of added TsCondition in resulting query view.

TsConditionChange.Current Message

TsCondition has been added or modified in a query view. Version used for stateless watching

Name Type Description
ts_condition TsCondition

TsConditionChange.Modified Message

TsCondition changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of TsCondition) Name of modified TsCondition
ts_condition TsCondition New version of TsCondition or masked difference, depending on mask_changes instrumentation of issued [WatchTsConditionRequest] or [WatchTsConditionsRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified TsCondition. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying TsCondition new index in resulting query view.

TsConditionChange.Removed Message

Removed is returned when TsCondition is deleted or leaves Query view

Name Type Description
name string (name of TsCondition)
view_index int32 Integer specifying removed TsCondition index. Not populated in stateless watch type.

TsConditionTemplateChange Message

TsConditionTemplateChange is used by Watch notifications Responses to describe change of single TsConditionTemplate One of Added, Modified, Removed

Name Type Description
added TsConditionTemplateChange.Added Added is returned when watched document is added, either created or enters Query view
modified TsConditionTemplateChange.Modified Modified is returned when watched document is modified
current TsConditionTemplateChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed TsConditionTemplateChange.Removed Removed is returned when TsConditionTemplate is deleted or leaves Query view

TsConditionTemplateChange.Added Message

TsConditionTemplate has been added to query view

Name Type Description
ts_condition_template TsConditionTemplate
view_index int32 Integer describing index of added TsConditionTemplate in resulting query view.

TsConditionTemplateChange.Current Message

TsConditionTemplate has been added or modified in a query view. Version used for stateless watching

Name Type Description
ts_condition_template TsConditionTemplate

TsConditionTemplateChange.Modified Message

TsConditionTemplate changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of TsConditionTemplate) Name of modified TsConditionTemplate
ts_condition_template TsConditionTemplate New version of TsConditionTemplate or masked difference, depending on mask_changes instrumentation of issued [WatchTsConditionTemplateRequest] or [WatchTsConditionTemplatesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified TsConditionTemplate. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying TsConditionTemplate new index in resulting query view.

TsConditionTemplateChange.Removed Message

Removed is returned when TsConditionTemplate is deleted or leaves Query view

Name Type Description
name string (name of TsConditionTemplate)
view_index int32 Integer specifying removed TsConditionTemplate index. Not populated in stateless watch type.

TsEntryChange Message

TsEntryChange is used by Watch notifications Responses to describe change of single TsEntry One of Added, Modified, Removed

Name Type Description
added TsEntryChange.Added Added is returned when watched document is added, either created or enters Query view
modified TsEntryChange.Modified Modified is returned when watched document is modified
current TsEntryChange.Current Current is returned in stateless watch when document enters query view or is modified within.
removed TsEntryChange.Removed Removed is returned when TsEntry is deleted or leaves Query view

TsEntryChange.Added Message

TsEntry has been added to query view

Name Type Description
ts_entry TsEntry
view_index int32 Integer describing index of added TsEntry in resulting query view.

TsEntryChange.Current Message

TsEntry has been added or modified in a query view. Version used for stateless watching

Name Type Description
ts_entry TsEntry

TsEntryChange.Modified Message

TsEntry changed some of it’s fields - contains either full document or masked change

Name Type Description
name string (name of TsEntry) Name of modified TsEntry
ts_entry TsEntry New version of TsEntry or masked difference, depending on mask_changes instrumentation of issued [WatchTsEntryRequest] or [WatchTsEntriesRequest]
field_mask .google.protobuf.FieldMask Used when mask_changes is set, contains field paths of modified properties.
previous_view_index int32 Previous view index specifies previous position of modified TsEntry. When modification doesn’t affect sorted order, value will remain identical to [view_index].
view_index int32 Integer specifying TsEntry new index in resulting query view.

TsEntryChange.Removed Message

Removed is returned when TsEntry is deleted or leaves Query view

Name Type Description
name string (name of TsEntry)
view_index int32 Integer specifying removed TsEntry index. Not populated in stateless watch type.

WatchAlertDataRequest Message

A request message of the WatchAlertData method. This is special combined watch of 5 streams dedicated specifically for edge alerter component. It reduces number of watch streams and therefore connections maintained by server (and slightly agent).

Name Type Description
project string (name of Project)
alerting_resource_name string
alerting_resource_kind string

WatchAlertDataResponse Message

A response message of the WatchAlertData method.

Name Type Description
alerts_to_add repeated Alert
ts_entries_to_add repeated TsEntry
policies_to_add repeated Policy
ts_cnds_to_add repeated TsCondition
log_cnds_to_add repeated LogCondition
alert_names_to_remove repeated string (name of Alert)
ts_entry_names_to_remove repeated string (name of TsEntry)
policy_names_to_remove repeated string (name of Policy)
ts_cnd_names_to_remove repeated string (name of TsCondition)
log_cnd_names_to_remove repeated string (name of LogCondition)
reset_alerts bool
reset_ts_entries bool
reset_policies bool
reset_ts_cnds bool
reset_log_cnds bool

Alerting Service Shared Enumerations

Here is the list of Alerting service shared enumerations:

LogCndSpec.Query.CompositeTrigger.Operator Enumeration

Operator informs if only one trigger must be satisfied to trigger an Alert, or all.

Name Description
UNDEFINED UNDEFINED is not allowed
AND AND tells that all triggers must be on for Alert to be created
OR OR tells that Alert should be raised based on any trigger condition.

NotificationChannelSpec.EventKind Enumeration

EventKind specifies interesting alert state change which may trigger a notification generation.

Name Description
UNDEFINED Undefined is not allowed
NEW_FIRING This kind must be used if we want to generate a notification for a new firing alert.
AI_ESCALATED_TO_OPERATOR This kind must be used if we want to generate a notification for an alert that has been pushed to Operator (escalated by AI Agent).
AI_REMEDIATION_AWAITING_APPROVAL This kind must be used if we want to generate a notification for an alert which received remediation recommendation by AI Agent, and which requires operator approval.
AI_IGNORED_AS_TMP This kind must be used if we want to generate a notification for an alert which has been considered as a temporary violation by AI Agent.
AI_ADJUSTED_ENTRIES This kind must be used if we want to generate a notification for an alert which has been considered as a false positive, and for which alerting thresholds should be adjusted.
AI_REMEDIATION_APPLIED This kind must be used if we want to generate a notification for an alert for which AI agent applied recommendation.
OP_REMEDIATION_APPLIED This kind must be used if we want to generate a notification for an alert for which operator applied recommendation.
STOPPED_FIRING This kind must be used if we want to generate a notification for an alert that stopped firing.

NotificationChannelSpec.Type Enumeration

Type of NotificationChannel

Name Description
TYPE_UNSPECIFIED Type is unknown
EMAIL Email NotificationChannel
SLACK Slack NotificationChannel
WEBHOOK Webhook NotificationChannel

NotificationMsg.AlertsGroup.ConditionAlerts.Alert.Type Enumeration

Name Description
UNDEFINED
TS_BASED_ANOMALY
TS_BASED_THRESHOLD
LOG_BASED

PolicySpec.ProcessingLocation Enumeration

ProcessingLocation indicates if alerts should be detected on Edge or in backend. Edge may be preferred for various reasons:

  • Alerts can be raised closer to the source.
  • Conditions can use more sophisticated methods, like local small AI anomaly detector models. In backend, performance may not be guaranteed, if there are a lot of pending trainings. Backend is preferred when:
  • We want to alert based on metrics that dont make sense on edge (like connectivity).
  • Alerting resoucrce is not “edge” type. For example, we monitor some network targets monitored by multiple distributed probes.
Name Description
UNDEFINED UNDEFINED is invalid
BACKEND Alerts will be detected and generated in the backend.
EDGE Alerts will be detected and generated on the edge.

PolicySpec.ResourceIdentity.LabelInfo.UsageContext Enumeration

UsageContext exact descriptor type where label key can be found.

Name Description
UNDEFINED UNDEFINED - not allowed
METRIC_LABEL Indicates that label of given key can be found in monitoring.edgelq.com/MetricDescriptor resource.
RESOURCE_LABEL Indicates that label of given key can be found in monitoring.edgelq.com/MonitoredResourceDescriptor resource.
LOG_LABEL Indicates that label of given key can be found in logging.edgelq.com/LogDescriptor resource.

TsCndSpec.ThresholdAlertingCfg.Operator Enumeration

Operator informs if whether all or one of queries must be crossed for alert to be generated.

Name Description
UNDEFINED UNDEFINED is not allowed
AND AND indicates that all thresholds must be crossed for alert ti be triggered.
OR OR indicates that Alert should be raised if any of queries violates threshold.