skywalking es查询语句整理

embedded/2024/11/23 12:15:09/
查找特定时间范围内,与特定服务相关的service_relation_server_side指标
{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"bool": {"should": [{"term": {"source_service_id": {"value": "c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1","boost": 1.0}}},{"term": {"dest_service_id": {"value": c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},{"term": {"metric_table": {"value": "service_relation_server_side","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1000,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"component_ids": {"terms": {"field": "component_ids","size": 10,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"}}}}}
}

对特定时间范围内的服务间关系数据进行聚合分析

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"bool": {"should": [{"term": {"source_service_id": {"value":"c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1","boost": 1.0}}},{"term": {"dest_service_id": {"value":"c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},{"term": {"metric_table": {"value": "service_relation_client_side","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1000,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"component_ids": {"terms": {"field": "component_ids","size": 10,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"}}}}}
}

检索record_tableprofile_task的文档

{"size": 200,"query": {"bool": {"must": [{"term": {"record_table": {"value": "profile_task","boost": 1.0}}},{"range": {"time_bucket": {"from": 202411221137,"to": null,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"range": {"time_bucket": {"from": null,"to": 202411221147,"include_lower": true,"include_upper": true,"boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"sort": [{"start_time": {"order": "desc"}}]
}

检索metric_tablenetwork_address_alias的文档

{"size": 5000,"query": {"bool": {"must": [{"term": {"metric_table": {"value": "network_address_alias","boost": 1.0}}},{"range": {"last_update_time_bucket": {"from": 202411221132,"to": null,"include_lower": true,"include_upper": true,"boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}}
}

检索metric_tableeventsserviceservice::tendata-contact-service的文档

{"from": 0,"size": 20,"query": {"bool": {"must": [{"term": {"metric_table": {"value": "events","boost": 1.0}}},{"term": {"service": {"value": "service::tendata-contact-service","boost": 1.0}}},{"range": {"start_time": {"from": 1732245120000,"to": null,"include_lower": false,"include_upper": true,"boost": 1.0}}},{"range": {"end_time": {"from": null,"to": 1732246980000,"include_lower": true,"include_upper": false,"boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"sort": [{"start_time": {"order": "desc"}}]
}

{"size": 1,"query": {"ids": {"values": ["service_traffic_MTkyLjE2OC4xMS4xMDo1Njcy.15"],"boost": 1.0}}
}

{"size": 12,"query": {"ids": {"values": ["tag_autocomplete_20241122_TRACE_db.instance_[im_moldova-2024, im_moldova-2022, im_moldova-2023, im_moldova-2021]","tag_autocomplete_20241122_TRACE_mq.queue_dcs.task-extract-data.route","tag_autocomplete_20241122_TRACE_db.instance_[im_maritime_silk_bol-2022, im_maritime_silk_bol-2023, im_maritime_silk_bol-2021, im_maritime_silk_bol-2024]"],"boost": 1.0}}
}

{"size": 156,"query": {"ids": {"values": ["endpoint_traffic_c2VydmljZTo6dGVuZGF0YS1nYXRld2F5LXNlcnZpY2U=.1_L2luc2lnaHQtc2VhcmNoL3YxL3Byb2dyYW1tZXMvMjkyNTcvbWFya2V0LWNvdW50ZXJwYXJ0eS1hcmVh","endpoint_traffic_c2VydmljZTo6dGVuZGF0YS1nYXRld2F5LXNlcnZpY2U=.1_L2luc2lnaHQvdjEvYWRtaW4vcHJvZ3JhbW1lcw==","endpoint_traffic_c2VydmljZTo6dGVuZGF0YS10aGlyZC1wYXJ0eS1zZXJ2aWNl.1_UE9TVDovdXNlcnMvNjA5NjMvcHJveHk=","endpoint_traffic_c2VydmljZTo6dGVuZGF0YS1nYXRld2F5LXNlcnZpY2U=.1_L2NvcnAvdjIvY29tcGFuaWVzLzEwYzdkMWVjYTY4NTE0NDQ1NzQ5OWVkZTJkZTQxY2I1L3JlZnJlc2gvcmVzdWx0"],"boost": 1.0}}
}

{"from": 0,"size": 15,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 20241122111200,"to": 20241122114259,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"term": {"service_id": {"value":"c2VydmljZTo6dGVuZGF0YS1tZXNzYWdlLXNlcnZpY2U=.1","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"sort": [{"timestamp": {"order": "desc"}}]
}

检索record_tablespan_attached_event_recordrelated_trace_idab80cf2b85fa4f3e9baabd114f3b909e.98.17322469467401053,且trace_ref_type为0的文档。查询结果将按照start_time_secondstart_time_nanos字段进行升序排序,并且只返回前100个结果

{"size": 100,"query": {"bool": {"must": [{"term": {"record_table": {"value": "span_attached_event_record","boost": 1.0}}},{"terms": {"related_trace_id": ["ab80cf2b85fa4f3e9baabd114f3b909e.98.17322469467401053"],"boost": 1.0}},{"terms": {"trace_ref_type": [0],"boost": 1.0}}],"adjust_pure_negative": true,"boost": 1.0}},"sort": [{"start_time_second": {"order": "asc"}},{"start_time_nanos": {"order": "asc"}}]
}

{"size": 200,"query": {"term": {"trace_id": {"value": "ab80cf2b85fa4f3e9baabd114f3b909e.98.17322469467401053","boost": 1.0}}}
}

检索record_tableebpf_profiling_taskservice_id为特定值、target_type为1或2、trigger_type为1的文档

{"size": 200,"query": {"bool": {"must": [{"term": {"record_table": {"value": "ebpf_profiling_task","boost": 1.0}}},{"term": {"service_id": {"value":"c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1","boost": 1.0}}},{"terms": {"target_type": [1,2],"boost": 1.0}},{"term": {"trigger_type": {"value": 1,"boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"sort": [{"create_time": {"order": "desc"}}]
}

{"size": 10000,"query": {"bool": {"must": [{"term": {"record_table": {"value": "profile_task_log","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"sort": [{"operation_time": {"order": "desc"}}]
}

获取特定时间段内特定服务的事件或日志记录,并按开始时间排序

{"from": 0,"size": 20,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 20241122111200,"to": 20241122114259,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"term": {"service_id": {"value":"c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"sort": [{"start_time": {"order": "desc"}}]
}

{"size": 5000,"query": {"bool": {"must": [{"range": {"last_ping": {"from": 202411221112,"to": null,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"term": {"service_id": {"value":"c2VydmljZTo6dGVuZGF0YS1tZXNzYWdlLXNlcnZpY2U=.1","boost": 1.0}}},{"term": {"metric_table": {"value": "instance_traffic","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}}
}

{"size": 20,"query": {"bool": {"must": [{"term": {"service_id": {"value":"c2VydmljZTo6dGVuZGF0YS1tZXNzYWdlLXNlcnZpY2U=.1","boost": 1.0}}},{"term": {"metric_table": {"value": "endpoint_traffic","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}}
}

{"query": {"bool": {"must": [{"term": {"tag_type": {"value": "TRACE","boost": 1.0}}},{"term": {"metric_table": {"value": "tag_autocomplete","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"tag_key": {"terms": {"field": "tag_key","size": 100,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"order": [{"_count": "desc"},{"_key": "asc"}]}}}
}

{"size": 5000,"query": {"bool": {"must": [{"term": {"layer": {"value": 2,"boost": 1.0}}},{"term": {"metric_table": {"value": "service_traffic","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}}
}

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"terms": {"entity_id": ["MTkyLjE2OC4zMC4xOjkwOTI7MTkyLjE2OC4zMC4zOjkwOTI=.1-c2VydmljZTo6dGVuZGF0YS1jb3JwLXNlcnZpY2U=.1"],"boost": 1.0}},{"term": {"metric_table": {"value": "service_relation_server_cpm","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"value": {"avg": {"field": "value"}}}}}
}

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"terms": {"entity_id": ["c2VydmljZTo6dGVuZGF0YS1iaXpyLXNlcnZpY2U=.1-c2VydmljZTo6dGVuZGF0YS1nbG9jby1zZXJ2aWNl.1"],"boost": 1.0}},{"term": {"metric_table": {"value": "service_relation_server_resp_time","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"value": {"avg": {"field": "value"}}}}}
}

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"terms": {"entity_id": ["c2VydmljZTo6dGVuZGF0YS1tY3Mtc2VydmljZQ==.1-MTkyLjE2OC4zMC4xOjkwOTI7MTkyLjE2OC4zMC4zOjkwOTI=.0"],"boost": 1.0}},{"term": {"metric_table": {"value": "service_relation_client_resp_time","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"value": {"avg": {"field": "value"}}}}}
}

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"terms": {"entity_id": ["c2VydmljZTo6dGVuZGF0YS10cmFuc2xhdGlvbi1zZXJ2aWNl.1-YXBpLnRyYW5zbGF0b3IuYXp1cmUuY246NDQz.1"],"boost": 1.0}},{"term": {"metric_table": {"value": "service_relation_client_cpm","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"value": {"avg": {"field": "value"}}}}}
}

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"terms": {"entity_id": ["c2VydmljZTo6dGVuZGF0YS1tY3Mtc2VydmljZQ==.1"],"boost": 1.0}},{"term": {"metric_table": {"value": "service_resp_time","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"value": {"avg": {"field": "value"}}}}}
}

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"terms": {"entity_id": ["c2VydmljZTo6dGVuZGF0YS1vcGVuYXBpLWdhdGV3YXktc2VydmljZQ==.1"],"boost": 1.0}},{"term": {"metric_table": {"value": "service_sla","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"percentage": {"avg": {"field": "percentage"}}}}}
}

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"terms": {"entity_id": ["c2VydmljZTo6dGVuZGF0YS1kZnMtc2VydmljZQ==.1"],"boost": 1.0}},{"term": {"metric_table": {"value": "service_cpm","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"value": {"avg": {"field": "value"}}}}}
}

{"size": 0,"query": {"bool": {"must": [{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}},{"bool": {"should": [{"terms": {"source_service_id": ["c2VydmljZTo6dGVuZGF0YS10aGlyZC1wYXJ0eS1zZXJ2aWNl.1","c2VydmljZTo6dGVuZGF0YS1tY3Mtc2VydmljZQ==.1"],"boost": 1.0}},{"terms": {"dest_service_id": ["c2VydmljZTo6dGVuZGF0YS10aGlyZC1wYXJ0eS1zZXJ2aWNl.1","c2VydmljZTo6dGVuZGF0YS1pbnNpZ2h0LXNlcnZpY2U=.1","c2VydmljZTo6dGVuZGF0YS1tY3Mtc2VydmljZQ==.1"],"boost": 1.0}}],"adjust_pure_negative": true,"boost": 1.0}},{"term": {"metric_table": {"value": "service_relation_server_side","boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 1000,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"component_ids": {"terms": {"field": "component_ids","size": 10,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"_count": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"}}}}}
}


http://www.ppmy.cn/embedded/139843.html

相关文章

jmeter操作数据库

简介 Apache JMeter 是一个强大的开源工具,用于负载测试和性能测量。除了Web应用外,JMeter还可以用于测试各种数据库系统,包括MySQL。本文将详细介绍如何使用JMeter来测试MySQL数据库的性能。 环境准备 安装Java:确保你已经安装…

Notepad++--在开头快速添加行号

原文网址:Notepad--在开头快速添加行号_IT利刃出鞘的博客-CSDN博客 简介 本文介绍Notepad怎样在开头快速添加行号。 需求 原文件 想要的效果 方法 1.添加点号 Alt鼠标左键,从首行选中首列下拉,选中需要添加序号的所有行的首列&#xff…

数字IC后端笔试面试题库 | 经典时序Timing计算题

今天小编给大家分享下近几年IC后端笔试题目中关于时序计算的典型真题。只要把这些题目搞懂,无论是校招还是社招,时序方面的题都没有问题了。 数字IC芯片设计实现 | 时序Timing Signoff check_timing检查解析 数字IC后端工程师应该如何快速入门提高工作…

垂起固定翼无人机搭载高清三光(4K可见+红外+激光测距)吊舱图像采集技术详解

垂起固定翼无人机搭载高清三光(4K可见红外激光测距)吊舱图像采集技术,是一种结合了无人机技术与先进光学传感技术的综合解决方案。以下是对该技术的详细解析: 一、垂起固定翼无人机 1. 特点: 垂直起降能力&#xff1…

指南: 如何在 MEV 项目中使用 Yul

这对我来说是一个反复出现的故事。我学习了一些 Solidity,发现了一个我想要研究的服务。代码看起来是这样的: Seaport Core: BasicOrderFulfiller.sol Solidity 代码在哪里?人们似乎不再使用普通的 Solidity 代码了 🥲 这种在智能…

后端数据增删改查基于Springboot+mybatis mysql 时间根据当时时间自动填充,数据库连接查询不一致,mysql数据库连接不好用

目录 后端数据增删改查Springboot 实体(entity)类引进添加UserMapper接口 创建对用的UserController注意数据库查询不一致新增数据更新删除postman测试 后端数据增删改查 基于之前构建系统,实现用户数据的CRUD。 打开navicat16,…

初识WGCLOUD - 监测磁盘空间还能使用多久

WGCLOUD是一款免费开源的运维监控软件,性能优秀,部署简单,轻巧使用,支持大部分的Linux和Windows、安卓、MacOS等平台安装部署 最近发布的新版本 v3.5.4,WGCLOUD新增了可以自动计算每个磁盘剩余空间的可使用天数&#x…

Kafka 分区分配及再平衡策略深度解析与消费者事务和数据积压的简单介绍

Kafka:分布式消息系统的核心原理与安装部署-CSDN博客 自定义 Kafka 脚本 kf-use.sh 的解析与功能与应用示例-CSDN博客 Kafka 生产者全面解析:从基础原理到高级实践-CSDN博客 Kafka 生产者优化与数据处理经验-CSDN博客 Kafka 工作流程解析&#xff1a…