This is an automated email from the ASF dual-hosted git repository. wusheng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push: new 40f160cf9a Fix query-protocol.md, make it consistent with the GraphQL query protocol. (#11950) 40f160cf9a is described below commit 40f160cf9a516416dd4fe7e65112d73b5c24ca13 Author: Wan Kai <wankai...@foxmail.com> AuthorDate: Wed Feb 28 15:31:05 2024 +0800 Fix query-protocol.md, make it consistent with the GraphQL query protocol. (#11950) --- docs/en/api/query-protocol-deprecated.md | 31 +++++++++++ docs/en/api/query-protocol.md | 92 ++++++++++++++++++++++---------- docs/en/changes/changes.md | 1 + 3 files changed, 96 insertions(+), 28 deletions(-) diff --git a/docs/en/api/query-protocol-deprecated.md b/docs/en/api/query-protocol-deprecated.md index e6a2226a11..025b56ef64 100644 --- a/docs/en/api/query-protocol-deprecated.md +++ b/docs/en/api/query-protocol-deprecated.md @@ -3,6 +3,37 @@ The following query services are deprecated since 9.5.0. All these queries are s Query protocol official repository, https://github.com/apache/skywalking-query-protocol. +### Metadata +Metadata contains concise information on all services and their instances, endpoints, etc. under monitoring. +You may query the metadata in different ways. +#### V1 APIs +V1 APIs were introduced since 6.x. Now they are a shell to V2 APIs since 9.0.0. +```graphql +extend type Query { + # Normal service related meta info + getAllServices(duration: Duration!, group: String): [Service!]! + searchServices(duration: Duration!, keyword: String!): [Service!]! + searchService(serviceCode: String!): Service + + # Fetch all services of Browser type + getAllBrowserServices(duration: Duration!): [Service!]! + searchBrowserServices(duration: Duration!, keyword: String!): [Service!]! + searchBrowserService(serviceCode: String!): Service + + # Service instance query + getServiceInstances(duration: Duration!, serviceId: ID!): [ServiceInstance!]! + + # Endpoint query + # Consider there are huge numbers of endpoint, + # must use endpoint owner's service id, keyword and limit filter to do query. + searchEndpoint(keyword: String!, serviceId: ID!, limit: Int!): [Endpoint!]! + + # Database related meta info. + getAllDatabases(duration: Duration!): [Database!]! +} +``` + + ### Metrics Metrics query targets all objects defined in [OAL script](../concepts-and-designs/oal.md) and [MAL](../concepts-and-designs/mal.md). You may obtain the metrics data in linear or thermodynamic matrix formats based on the aggregation functions in script. diff --git a/docs/en/api/query-protocol.md b/docs/en/api/query-protocol.md index 0328e9f7d6..af84589b5e 100644 --- a/docs/en/api/query-protocol.md +++ b/docs/en/api/query-protocol.md @@ -9,28 +9,33 @@ All deprecated APIs are moved [here](./query-protocol-deprecated.md). ### Metadata Metadata contains concise information on all services and their instances, endpoints, etc. under monitoring. You may query the metadata in different ways. +#### V2 APIs +Provide Metadata V2 query APIs since 9.0.0, including Layer concept. ```graphql extend type Query { - # Normal service related meta info - getAllServices(duration: Duration!, group: String): [Service!]! - searchServices(duration: Duration!, keyword: String!): [Service!]! - searchService(serviceCode: String!): Service - - # Fetch all services of Browser type - getAllBrowserServices(duration: Duration!): [Service!]! - searchBrowserServices(duration: Duration!, keyword: String!): [Service!]! - searchBrowserService(serviceCode: String!): Service - - # Service instance query - getServiceInstances(duration: Duration!, serviceId: ID!): [ServiceInstance!]! - - # Endpoint query - # Consider there are huge numbers of endpoint, - # must use endpoint owner's service id, keyword and limit filter to do query. - searchEndpoint(keyword: String!, serviceId: ID!, limit: Int!): [Endpoint!]! + # Read all available layers + # UI could use this list to determine available dashboards/panels + # The available layers would change with time in the runtime, because new service could be detected in any time. + # This list should be loaded periodically. + listLayers: [String!]! + + # Read the service list according to layer. + listServices(layer: String): [Service!]! + # Find service according to given ID. Return null if not existing. + getService(serviceId: String!): Service + # Search and find service according to given name. Return null if not existing. + findService(serviceName: String!): Service + + # Read service instance list. + listInstances(duration: Duration!, serviceId: ID!): [ServiceInstance!]! + # Search and find service instance according to given ID. Return null if not existing. + getInstance(instanceId: String!): ServiceInstance + + # Search and find matched endpoints according to given service and keyword(optional) + # If no keyword, randomly choose endpoint based on `limit` value. + findEndpoint(keyword: String, serviceId: ID!, limit: Int!): [Endpoint!]! getEndpointInfo(endpointId: ID!): EndpointInfo - # Process query # Read process list. listProcesses(duration: Duration!, instanceId: ID!): [Process!]! # Find process according to given ID. Return null if not existing. @@ -42,8 +47,6 @@ extend type Query { # The return number just gives an abstract of the scale of profiling that would be applied. estimateProcessScale(serviceId: ID!, labels: [String!]!): Long! - # Database related meta info. - getAllDatabases(duration: Duration!): [Database!]! getTimeInfo: TimeInfo } ``` @@ -54,7 +57,8 @@ The topology and dependency graphs among services, instances and endpoints. Incl ```graphql extend type Query { # Query the global topology - getGlobalTopology(duration: Duration!): Topology + # When layer is specified, the topology of this layer would be queried + getGlobalTopology(duration: Duration!, layer: String): Topology # Query the topology, based on the given service getServiceTopology(serviceId: ID!, duration: Duration!): Topology # Query the topology, based on the given services. @@ -66,6 +70,8 @@ extend type Query { getEndpointTopology(endpointId: ID!, duration: Duration!): Topology # v2 of getEndpointTopology getEndpointDependencies(endpointId: ID!, duration: Duration!): EndpointTopology + # Query the topology, based on the given instance + getProcessTopology(serviceInstanceId: ID!, duration: Duration!): ProcessTopology } ``` @@ -123,9 +129,12 @@ extend type Query { # Return true if the current storage implementation supports fuzzy query for logs. supportQueryLogsByKeywords: Boolean! queryLogs(condition: LogQueryCondition): Logs - # Test the logs and get the results of the LAL output. test(requests: LogTestRequest!): LogTestResponse! + # Read the list of searchable keys + queryLogTagAutocompleteKeys(duration: Duration!):[String!] + # Search the available value options of the given key. + queryLogTagAutocompleteValues(tagKey: String! , duration: Duration!):[String!] } ``` @@ -137,8 +146,14 @@ full log text fuzzy queries, while others do not due to considerations related t ### Trace ```graphql extend type Query { + # Search segment list with given conditions queryBasicTraces(condition: TraceQueryCondition): TraceBrief + # Read the specific trace ID with given trace ID queryTrace(traceId: ID!): Trace + # Read the list of searchable keys + queryTraceTagAutocompleteKeys(duration: Duration!):[String!] + # Search the available value options of the given key. + queryTraceTagAutocompleteValues(tagKey: String! , duration: Duration!):[String!] } ``` @@ -179,11 +194,9 @@ extend type Query { # query all task logs getProfileTaskLogs(taskID: String): [ProfileTaskLog!]! # query all task profiled segment list - getProfileTaskSegmentList(taskID: String): [BasicTrace!]! - # query profiled segment - getProfiledSegment(segmentId: String): ProfiledSegment - # analyze profiled segment, start and end time use timestamp(millisecond) - getProfileAnalyze(segmentId: String!, timeRanges: [ProfileAnalyzeTimeRange!]!): ProfileAnalyzation! + getProfileTaskSegments(taskID: ID!): [ProfiledTraceSegments!]! + # analyze multiple profiled segments, start and end time use timestamp(millisecond) + getSegmentsProfileAnalyze(queries: [SegmentProfileAnalyzeQuery!]!): ProfileAnalyzation! } ``` @@ -203,7 +216,8 @@ extend type Query { # query eBPF profiling data for prepare create task queryPrepareCreateEBPFProfilingTaskData(serviceId: ID!): EBPFProfilingTaskPrepare! # query eBPF profiling task list - queryEBPFProfilingTasks(serviceId: ID, serviceInstanceId: ID, targets: [EBPFProfilingTargetType!]): [EBPFProfilingTask!]! + # query `triggerType == FIXED_TIME` when triggerType is absent + queryEBPFProfilingTasks(serviceId: ID, serviceInstanceId: ID, targets: [EBPFProfilingTargetType!], triggerType: EBPFProfilingTriggerType, duration: Duration): [EBPFProfilingTask!]! # query schedules from profiling task queryEBPFProfilingSchedules(taskId: ID!): [EBPFProfilingSchedule!]! # analyze the profiling schedule @@ -212,6 +226,28 @@ extend type Query { } ``` +### On-Demand Pod Logs +Provide APIs to query [on-demand pod logs](../setup/backend/on-demand-pod-log.md) since 9.1.0. +```graphql +extend type Query { + listContainers(condition: OndemandContainergQueryCondition): PodContainers + ondemandPodLogs(condition: OndemandLogQueryCondition): Logs +} +``` + +### Hierarchy +Provide [Hierarchy](../concepts-and-designs/service-hierarchy.md) query APIs since 10.0.0, including service and instance hierarchy. +```graphql +extend type Query { + # Query the service hierarchy, based on the given service. Will recursively return all related layers services in the hierarchy. + getServiceHierarchy(serviceId: ID!, layer: String!): ServiceHierarchy! + # Query the instance hierarchy, based on the given instance. Will return all direct related layers instances in the hierarchy, no recursive. + getInstanceHierarchy(instanceId: ID!, layer: String!): InstanceHierarchy! + # List layer hierarchy levels. The layer levels are defined in the `hierarchy-definition.yml`. + listLayerLevels: [LayerLevel!]! +} +``` + ## Condition ### Duration Duration is a widely used parameter type as the APM data is time-related. See the following for more details. diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md index 9d50a97255..6dd9649837 100644 --- a/docs/en/changes/changes.md +++ b/docs/en/changes/changes.md @@ -107,5 +107,6 @@ * Update nanoid version to 3.3.7. * Update postcss version to 8.4.33. * Fix kafka topic name in exporter doc. +* Fix query-protocol.md, make it consistent with the GraphQL query protocol. All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/202?closed=1)