| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| type MQEMetric { |
| name: String! |
| results: [MQEValues!]! |
| } |
| |
| type AlarmSnapshot { |
| # The MQE expression of the alarm rule. |
| expression: String! |
| # The metrics snapshot |
| metrics: [MQEMetric!]! |
| } |
| |
| type AlarmMessage { |
| startTime: Long! |
| recoveryTime: Long |
| scope: Scope |
| id: ID! |
| # The entity name of the alarm triggered. |
| name: String! |
| message: String! |
| events: [Event!]! |
| tags: [KeyValue!]! |
| # The snapshot when the alarm triggered. |
| snapshot: AlarmSnapshot! |
| } |
| |
| type Alarms { |
| msgs: [AlarmMessage!]! |
| } |
| |
| input AlarmTag { |
| key: String! |
| value: String |
| } |
| |
| # Filter shape for `queryAlarms`. All fields outside `duration` and `paging` |
| # are optional; within each list-typed field values are OR'd (set union), |
| # across fields the predicates are AND'd. |
| input AlarmQueryCondition { |
| duration: Duration! |
| paging: Pagination! |
| |
| # Pin to specific entities. Each `Entity` (defined in metrics-v3.graphqls) |
| # resolves to one EntityIdConstraint at query time: |
| # * Non-relation scopes (Service / ServiceInstance / Endpoint / Process) |
| # match the alarm record's id0 OR id1 column against the resolved id |
| # — a service appears in either column depending on which side of the |
| # alarm rule fired, so we accept both. |
| # * Relation scopes (`destServiceName` etc.) match exactly |
| # `id0 = sourceId AND id1 = destId` — ordered, NOT "any side". A |
| # ServiceRelation entity `{serviceName: A, destServiceName: B}` only |
| # matches alarms keyed `(A, B)`. To find anything involving A, pass a |
| # non-relation `{serviceName: A}` entity instead, which expands to |
| # `id0 = A OR id1 = A`. |
| # |
| # Across the list, the per-entity constraints are OR'd together. Entity's |
| # own `scope` field is auto-inferred from which name fields are |
| # populated, mirroring its MQE behavior. |
| entities: [Entity!] |
| |
| # Filter on the underlying entity's layer. An alarm record is persisted |
| # with a single layer (the first one in the entity's resolved layer |
| # list); this filter matches that single value exactly. See |
| # https://github.com/apache/skywalking/blob/master/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java |
| # for the canonical layer list. |
| layer: String |
| |
| # Filter by the alarm rule(s) that fired the alarm. |
| ruleNames: [String!] |
| |
| # Phrase match on the alarm message text. Same semantics as |
| # `getAlarm.keyword`. |
| keyword: String |
| |
| # Searchable-tag filter. Tag keys must be in the OAP backend's |
| # `searchableAlarmTags` config; otherwise the query returns no rows. |
| tags: [AlarmTag] |
| } |
| |
| extend type Query { |
| # DEPRECATED in favor of `queryAlarms(condition)`. Kept for backward |
| # compatibility; the OAP backend routes both queries to the same DAO. |
| # `queryAlarms` adds entity (Entity-typed) / rule-name / layer filters |
| # and bundles every filter under a single input type so future additions |
| # land without a method-signature change. |
| getAlarm(duration: Duration!, scope: Scope, keyword: String, paging: Pagination!, tags: [AlarmTag]): Alarms |
| @deprecated(reason: "Use queryAlarms(condition) instead. getAlarm only exposes scope + keyword + tags filters; queryAlarms additionally supports entities (Entity-typed, multi-select) / ruleNames / layer and uses a single input type for future extensibility.") |
| |
| # Query alarm records with the comprehensive filter set. Combine entity |
| # (Entity-typed, multi-select), layer, rule-name, keyword, and tag filters |
| # in one request. Replaces `getAlarm` for any client that needs more than |
| # scope + keyword + tags. |
| queryAlarms(condition: AlarmQueryCondition!): Alarms |
| |
| # Read the list of searchable keys |
| queryAlarmTagAutocompleteKeys(duration: Duration!):[String!] |
| # Search the available value options of the given key. |
| queryAlarmTagAutocompleteValues(tagKey: String! , duration: Duration!):[String!] |
| } |