skywalking es查询整理
索引介绍
sw_records-all
这个索引用于存储所有的采样记录,包括但不限于慢SQL查询、Agent分析得到的数据等。这些记录数据包括Traces、Logs、TopN采样语句和告警信息。它们被用于性能分析和故障排查,帮助开发者和运维团队理解服务的行为和性能特点。
mapping
{"sw_records-all": {"aliases": {"sw_records-all": {}},"mappings": {"_source": {"excludes": ["tags"]},"properties": {"alarm_message": {"type": "keyword","copy_to": ["alarm_message_match"},"alarm_message_match": {"type": "text","analyzer": "oap_analyzer"},"continuous_profiling_json": {"type": "keyword","index": false},"create_time": {"type": "long"},"data_binary": {"type": "binary"},"dump_binary": {"type": "binary"},"dump_period": {"type": "integer"},"dump_time": {"type": "long"},"duration": {"type": "integer"},"end_time_nanos": {"type": "integer"},"end_time_second": {"type": "long"},"endpoint_name": {"type": "keyword"},"entity_id": {"type": "keyword"},"event": {"type": "keyword"},"extension_config_json": {"type": "keyword","index": false},"fixed_trigger_duration": {"type": "long"},"id0": {"type": "keyword","index": false},"id1": {"type": "keyword","index": false},"instance_id": {"type": "keyword"},"last_update_time": {"type": "long"},"latency": {"type": "long"},"logical_id": {"type": "keyword"},"max_sampling_count": {"type": "integer"},"min_duration_threshold": {"type": "integer"},"name": {"type": "keyword","index": false},"operation_time": {"type": "long"},"operation_type": {"type": "integer","index": false},"process_labels_json": {"type": "keyword"},"record_table": {"type": "keyword"},"related_trace_id": {"type": "keyword"},"rule_name": {"type": "keyword"},"schedule_id": {"type": "keyword"},"scope": {"type": "integer"},"segment_id": {"type": "keyword"},"sequence": {"type": "integer"},"service_id": {"type": "keyword"},"stack_binary": {"type": "binary"},"stack_id": {"type": "keyword"},"start_time": {"type": "long"},"start_time_nanos": {"type": "integer"},"start_time_second": {"type": "long"},"statement": {"type": "keyword","index": false},"tags": {"type": "keyword"},"tags_raw_data": {"type": "binary"},"target_type": {"type": "integer"},"task_id": {"type": "keyword"},"time_bucket": {"type": "long"},"timestamp": {"type": "long"},"trace_id": {"type": "keyword","index": false},"trace_ref_type": {"type": "integer"},"trace_segment_id": {"type": "keyword"},"trace_span_id": {"type": "keyword"},"trigger_type": {"type": "integer"},"upload_time": {"type": "long"}}},"settings": {"index": {"routing": {"allocation": {"include": {"_tier_preference": "data_content"}}},"refresh_interval": "30s","number_of_shards": "1","provided_name": "sw_records-all-20241125","creation_date": "1732464023751","analysis": {"analyzer": {"oap_analyzer": {"type": "stop"}}},"number_of_replicas": "1","uuid": "qrRVCMSNSnO90iz9hHWD0Q","version": {"created": "7170799"}}}} } |
sw_metrics-all
这个索引存储服务、服务实例及端点的元数据,即指标信息。这些指标数据包括服务的响应时间、吞吐量、错误率等关键性能指标,以分钟级别存储。这些数据对于监控服务性能至关重要,因为它们提供了实时的性能反馈,使得团队能够快速识别和解决性能问题。
metric_table枚举值
1、endpoint_cpm:端点的每分钟调用次数(CPM)
2、endpoint_percentile:端点的响应时间百分位数
3、endpoint_resp_time:端点的平均响应时间
4、endpoint_sla:服务等级协议(SLA)指标
5、endpoint_sidecar_internal_req_latency_nanos 和 endpoint_sidecar_internal_resp_latency_nanos:端点Sidecar内部请求和响应延迟的纳秒数
6、instance_jvm_xxx:服务实例的JVM相关指标,如类加载数量、CPU使用率、内存使用情况、垃圾回收次数和线程状态等
7、meter_thread_pool:线程池相关的度量
8、service_instance_cpm、service_instance_resp_time、service_instance_sla:服务实例级别的CPM、响应时间和SLA指标
9、service_instance_sidecar_internal_req_latency_nanos 和 service_instance_sidecar_internal_resp_latency_nanos:服务实例级别的Sidecar内部请求和响应延迟的纳秒数
result
{"key": "endpoint_cpm","doc_count": 5763},{"key": "endpoint_percentile","doc_count": 5763},{"key": "endpoint_resp_time","doc_count": 5763},{"key": "endpoint_sla","doc_count": 5763},{"key": "endpoint_sidecar_internal_req_latency_nanos","doc_count": 5754},{"key": "endpoint_sidecar_internal_resp_latency_nanos","doc_count": 5754},{"key": "instance_jvm_class_loaded_class_count","doc_count": 2811},{"key": "instance_jvm_class_total_loaded_class_count","doc_count": 2811},{"key": "instance_jvm_class_total_unloaded_class_count","doc_count": 2811},{"key": "instance_jvm_cpu","doc_count": 2811},{"key": "instance_jvm_memory_heap","doc_count": 2811},{"key": "instance_jvm_memory_heap_max","doc_count": 2811},{"key": "instance_jvm_memory_noheap","doc_count": 2811},{"key": "instance_jvm_memory_noheap_max","doc_count": 2811},{"key": "instance_jvm_old_gc_count","doc_count": 2811},{"key": "instance_jvm_old_gc_time","doc_count": 2811},{"key": "instance_jvm_thread_blocked_state_thread_count","doc_count": 2811},{"key": "instance_jvm_thread_daemon_count","doc_count": 2811},{"key": "instance_jvm_thread_live_count","doc_count": 2811},{"key": "instance_jvm_thread_peak_count","doc_count": 2811},{"key": "instance_jvm_thread_runnable_state_thread_count","doc_count": 2811},{"key": "instance_jvm_thread_timed_waiting_state_thread_count","doc_count": 2811},{"key": "instance_jvm_thread_waiting_state_thread_count","doc_count": 2811},{"key": "instance_jvm_young_gc_count","doc_count": 2811},{"key": "instance_jvm_young_gc_time","doc_count": 2811},{"key": "meter_thread_pool","doc_count": 2811},{"key": "service_instance_cpm","doc_count": 1661},{"key": "service_instance_resp_time","doc_count": 1661},{"key": "service_instance_sla","doc_count": 1661},{"key": "service_instance_sidecar_internal_req_latency_nanos","doc_count": 1659},{"key": "service_instance_sidecar_internal_resp_latency_nanos","doc_count": 1659} |
mapping
{"sw_metrics-all-20241125": {"aliases": {"sw_metrics-all": {}},"mappings": {"properties": {"address": {"type": "keyword"},"agent_id": {"type": "keyword"},"component_id": {"type": "integer","index": false},"component_ids": {"type": "keyword","index": false},"count": {"type": "long","index": false},"dataset": {"type": "text","index": false},"datatable_count": {"type": "text","index": false},"datatable_summation": {"type": "text","index": false},"datatable_value": {"type": "text","index": false},"denominator": {"type": "long"},"dest_endpoint": {"type": "keyword"},"dest_process_id": {"type": "keyword"},"dest_service_id": {"type": "keyword"},"dest_service_instance_id": {"type": "keyword"},"detect_type": {"type": "integer"},"double_summation": {"type": "double","index": false},"double_value": {"type": "double"},"ebpf_profiling_schedule_id": {"type": "keyword"},"end_time": {"type": "long"},"endpoint": {"type": "keyword"},"endpoint_traffic_name": {"type": "keyword","copy_to": ["endpoint_traffic_name_match"]},"endpoint_traffic_name_match": {"type": "text","analyzer": "oap_analyzer"},"entity_id": {"type": "keyword"},"instance_id": {"type": "keyword"},"instance_traffic_name": {"type": "keyword","index": false},"int_value": {"type": "integer"},"label": {"type": "keyword"},"labels_json": {"type": "keyword","index": false},"last_ping": {"type": "long"},"last_update_time_bucket": {"type": "long"},"layer": {"type": "integer"},"match": {"type": "long","index": false},"message": {"type": "keyword"},"metric_table": {"type": "keyword"},"name": {"type": "keyword"},"numerator": {"type": "long"},"parameters": {"type": "keyword","index": false},"percentage": {"type": "integer"},"precision": {"type": "integer","index": false},"process_id": {"type": "keyword"},"profiling_support_status": {"type": "integer"},"properties": {"type": "text","index": false},"ranks": {"type": "text","index": false},"remote_service_name": {"type": "keyword"},"represent_service_id": {"type": "keyword"},"represent_service_instance_id": {"type": "keyword"},"s_num": {"type": "long","index": false},"service": {"type": "keyword"},"service_group": {"type": "keyword"},"service_id": {"type": "keyword"},"service_instance": {"type": "keyword"},"service_instance_id": {"type": "keyword"},"service_name": {"type": "keyword"},"service_traffic_name": {"type": "keyword","copy_to": ["service_traffic_name_match"]},"service_traffic_name_match": {"type": "text","analyzer": "oap_analyzer"},"short_name": {"type": "keyword"},"source_endpoint": {"type": "keyword"},"source_process_id": {"type": "keyword"},"source_service_id": {"type": "keyword"},"source_service_instance_id": {"type": "keyword"},"span_name": {"type": "keyword"},"start_time": {"type": "long"},"summation": {"type": "long","index": false},"t_num": {"type": "long","index": false},"tag_key": {"type": "keyword"},"tag_type": {"type": "keyword"},"tag_value": {"type": "keyword"},"task_id": {"type": "keyword"},"time_bucket": {"type": "long"},"total": {"type": "long","index": false},"total_num": {"type": "long","index": false},"type": {"type": "keyword"},"uuid": {"type": "keyword"},"value": {"type": "long"}}},"settings": {"index": {"routing": {"allocation": {"include": {"_tier_preference": "data_content"}}},"refresh_interval": "30s","number_of_shards": "1","provided_name": "sw_metrics-all-20241125","creation_date": "1732464018472","analysis": {"analyzer": {"oap_analyzer": {"type": "stop"}}},"number_of_replicas": "1","uuid": "WzZSWrHRSKaHFFwbm5D75A","version": {"created": "7170799"}}}} } |
字段解释
address:服务实例的网络地址
agent_id:SkyWalking Agent的唯一标识符
component_id:组件的唯一标识符
component_ids:一个包含多个组件ID的列表,用于标识服务中使用的所有组件
count:计数器,记录调用次数等
dataset:数据集的标识符,用于区分不同类型的监控数据
datatable_count、datatable_summation、datatable_value:与数据表相关的字段,用于存储汇总数据
denominator:用于计算比率的分母值
dest_endpoint:目标端点的名称,用于标识服务调用的目标
dest_process_id、dest_service_id、dest_service_instance_id:目标进程、服务和实例的唯一标识符
detect_type:检测类型的标识符
double_summation:双精度浮点数的总和
double_value:双精度浮点数值
ebpf_profiling_schedule_id:eBPF性能分析任务的标识符
end_time:事件或记录的结束时间戳
endpoint:端点的名称,用于标识服务中的特定操作
endpoint_traffic_name:端点流量的名称,用于标识端点的流量
entity_id:实体的唯一标识符,用于标识服务、端点或实例
instance_id:服务实例的唯一标识符
instance_traffic_name:服务实例流量的名称
int_value:整数值
label:用于分类或标记数据的标签
labels_json:包含多个标签的JSON字符串
last_ping:服务实例最后一次发送心跳的时间戳
last_update_time_bucket:数据最后一次更新的时间桶
layer:服务的层次或层级
match:用于匹配规则的标识符
message:与事件或日志相关的信息
metric_table:度量表的名称,用于标识特定的度量数据
name:实体、服务或端点的名称
numerator:用于计算比率的分子值
parameters:与事件或操作相关的参数
percentage:百分比值
precision:数据的精度
process_id:进程的唯一标识符
profiling_support_status:性能分析支持的状态
properties:实体的属性
ranks:排名或等级
remote_service_name:远程服务的名称
represent_service_id、represent_service_instance_id:表示服务或实例的唯一标识符
s_num:用于统计的数值
service:服务的名称
service_group:服务组的名称
service_id:服务的唯一标识符
service_instance:服务实例的名称
service_instance_id:服务实例的唯一标识符
service_name:服务的名称
service_traffic_name:服务流量的名称
short_name:实体的简称或缩写
source_endpoint:源端点的名称
source_process_id、source_service_id、source_service_instance_id:源进程、服务和实例的唯一标识符
span_name:跨度(Span)的名称,用于分布式追踪
start_time:事件或记录的开始时间戳
summation:数值的总和
t_num:用于统计的数值
tag_key、tag_type、tag_value:标签的键、类型和值
task_id:任务的唯一标识符
time_bucket:时间桶,用于数据的时序聚合
total、total_num:总数和数量
type:数据的类型
uuid:全局唯一标识符
value:度量值
sw_segment
sw_segment索引用于收集链路信息日志。在SkyWalking中,一个Segment代表一个分布式追踪的路径,它由多个Span组成,记录了一次完整的请求处理过程。这些数据对于理解服务之间的调用关系和性能特性非常重要,它们是实现分布式追踪和性能监控的基础。
sw_zipkin_span
sw_zipkin_span索引用于存储Zipkin跟踪的Span数据。SkyWalking可以作为Zipkin的替代服务器,提供高级功能,这个索引就是用来兼容Zipkin格式的追踪数据。
sw_browser_error_log
sw_browser_error_log索引用于收集浏览器日志,特别是错误日志。这些日志对于前端监控和错误分析非常有用,可以帮助开发者了解用户在使用应用时遇到的前端问题。
sw_log
sw_log索引用于收集除浏览器外的日志。这些日志可能来自于后端服务、中间件或其他系统组件,对于整体的系统监控和日志分析非常重要。
sw_continuous_profiling_policy
这个索引用于存储连续性能分析(Continuous Profiling)的策略配置。连续性能分析是SkyWalking的一个特性,它允许基于预设的策略自动触发性能分析任务。这些策略可以定义何时以及如何对特定的目标(如进程或服务)进行性能分析,以便及时发现和诊断性能问题。例如,当eBPF Agent检测到某个进程的指标符合策略规则时,它会立即触发对该进程的性能分析任务,从而减少中间步骤,加快定位性能问题的能力
sw_ui_template
sw_ui_template索引用于存储SkyWalking UI的模板配置。这些模板定义了SkyWalking UI中的仪表板和视图,包括官方提供的默认仪表板以及用户自定义的仪表板。用户可以通过这些模板来创建新的仪表板,添加新的标签/页面/小部件,并根据自己的偏好重新配置仪表板。模板支持层(Layer)和实体类型(Entity Type)的概念,这对于理解和自定义SkyWalking UI中的仪表板至关重要
查询语句整理
查询sw_metrics-all索引
1、查找特定时间范围内,与特定服务相关的服务关系指标
{"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"}}}}} } |
2、对特定时间范围内的服务间关系数据进行聚合分析
{"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"}}}}} } |
3、统计服务下的实例流量
{"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}} } |
4、统计服务下的端点流量
{"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}} } |
5、查询标签数据
{"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"}]}}} } |
6、统计服务流量
{"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}} } |
7、计算服务间的服务每分钟调用次数
{"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"}}}}} } |
8、计算服务间的服务响应时间
{"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"}}}}} } |
9、计算服务间的服务客户端响应时间
{"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"}}}}} } |
10、计算服务间的客户端每分钟调用次数
{"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"}}}}} } |
11、计算服务响应时间service_resp_time
{"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"}}}}} } |
12、计算服务级别协议的成功百分比service_sla
{"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"}}}}} } |
13、计算服务每分钟请求数service_cpm
{"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"}}}}} } |
14、查询网络地址别名
{"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}} } |
15、检索 service为service::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"}}] } |
16、分页获取特定时间段内特定服务指标数据,并按时间戳排序
{"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"}}] } |
17、根据传递的id查询端点信息
{"size": 156,"query": {"ids": {"values": ["endpoint_traffic_c2VydmljZTo6dGVuZGF0YS1nYXRld2F5LXNlcnZpY2U=.1_L2luc2lnaHQtc2VhcmNoL3YxL3Byb2dyYW1tZXMvMjkyNTcvbWFya2V0LWNvdW50ZXJwYXJ0eS1hcmVh","endpoint_traffic_c2VydmljZTo6dGVuZGF0YS1nYXRld2F5LXNlcnZpY2U=.1_L2NvcnAvdjIvY29tcGFuaWVzLzEwYzdkMWVjYTY4NTE0NDQ1NzQ5OWVkZTJkZTQxY2I1L3JlZnJlc2gvcmVzdWx0"],"boost": 1.0}} } |
18、查询某个服务的每分钟请求次数最多的10个接口
{"query": {"bool": {"must": [{"term": {"metric_table": {"value": "endpoint_cpm","boost": 1.0}}},{"terms": {"service_id": ["c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1"],"boost": 1.0}},{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 10,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"value": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"value": {"avg": {"field": "value"}}}}} } |
19、查询某个服务的响应时间最大的10个接口
{"query": {"bool": {"must": [{"term": {"metric_table": {"value": "endpoint_resp_time","boost": 1.0}}},{"terms": {"service_id": ["c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1"],"boost": 1.0}},{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 10,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"value": "desc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"value": {"avg": {"field": "value"}}}}} } |
20、查询某个服务的指定时间范围内成功率最小的10个接口
{"query": {"bool": {"must": [{"term": {"metric_table": {"value": "endpoint_sla","boost": 1.0}}},{"terms": {"service_id": ["c2VydmljZTo6dGVuZGF0YS1jb250YWN0LXNlcnZpY2U=.1"],"boost": 1.0}},{"range": {"time_bucket": {"from": 202411221112,"to": 202411221142,"include_lower": true,"include_upper": true,"boost": 1.0}}}],"adjust_pure_negative": true,"boost": 1.0}},"aggregations": {"entity_id": {"terms": {"field": "entity_id","size": 10,"min_doc_count": 1,"shard_min_doc_count": 0,"show_term_doc_count_error": false,"execution_hint": "map","order": [{"percentage": "asc"},{"_key": "asc"}],"collect_mode": "breadth_first"},"aggregations": {"percentage": {"avg": {"field": "percentage"}}}}} } |
21、查询标签信息
{"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_db.instance_[a04b2a53a6d946ad9fe525cd1ab2646a_alias]","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}} } |
查询sw_records-all索引
1、查询优化任务列表
{"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"}}] } |
2、查询sw_records-all与特定跨度(Span)关联的事件记录
{"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"}}] } |
3、检索ebpf优化任务
{"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"}}] } |
4、查询性能任务日志
{"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"}}] } |
查询sw_segment索引
1、查询某个服务的流量
{"size": 1,"query": {"ids": {"values": ["service_traffic_MTkyLjE2OC4xMS4xMDo1Njcy.15"],"boost": 1.0}} } |
2、查询某个调用链信息
{"size": 200,"query": {"term": {"trace_id": {"value": "ab80cf2b85fa4f3e9baabd114f3b909e.98.17322469467401053","boost": 1.0}}} } |
3、分页获取特定时间段内特定服务调用数据,并按开始时间排序
{"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"}}] } |
相关文章:

skywalking es查询整理
索引介绍 sw_records-all 这个索引用于存储所有的采样记录,包括但不限于慢SQL查询、Agent分析得到的数据等。这些记录数据包括Traces、Logs、TopN采样语句和告警信息。它们被用于性能分析和故障排查,帮助开发者和运维团队理解服务的行为和性能特点。 …...

故障排除-------K8s挂载集群外NFS异常
故障排除-------K8s挂载集群外NFS异常 1. 故障现象2. 原因梳理2.1 排查思路2.2 确认yaml内容2.3 创建k8s内的nfs测试2.3.1 创建nfs和svc2.3.2 测试创建pvc2.3.3 测试结果 2.4 NFS服务端故障排除2.4.1 网络阻断排除2.4.2 排除服务状态问题2.4.3 排查NFS权限问题 3. 故障排除 1. …...

Easyexcel(6-单元格合并)
相关文章链接 Easyexcel(1-注解使用)Easyexcel(2-文件读取)Easyexcel(3-文件导出)Easyexcel(4-模板文件)Easyexcel(5-自定义列宽)Easyexcel(6-单…...

解决登录Google账号遇到手机上Google账号无法验证的问题
文章目录 场景小插曲解决方案总结 场景 Google账号在新的设备上登录的时候,会要求在手机的Google上进行确认验证,而如果没有安装Google play就可能出现像我一样没有任何弹框,无法实现验证 小插曲 去年,我在笔记本上登录了Googl…...

【Redis_Day5】String类型
【Redis_Day5】String类型 String操作String的命令set和get:设置、获取键值对mset和mget:批量设置、获取键值对setnx/setex/psetexincr和incrby:对字符串进行加操作decr/decrby:对字符串进行减操作incrbyfloat:浮点数加…...

Python MySQL SQLServer操作
Python MySQL SQLServer操作 Python 可以通过 pymysql 连接 MySQL,通过 pymssql 连接 SQL Server。以下是基础操作和代码实战示例: 一、操作 MySQL:使用 pymysql python 操作数据库流程 1. 安装库 pip install pymysql2. 连接 MySQL 示例 …...

Java技术分享
剖析equals方法 1、对于Object来说,其equals()方法底层实现就是"",都是比较对象的引用是否相等,下为JDK源码。 Object c 1; Object d 1; boolean equals c.equals(d);public boolean equals(Object obj) {return (this obj);…...

CentOS7卸载node
CentOS7卸载node 在 CentOS 7 上卸载 Node.js 可以通过以下步骤进行。具体步骤取决于你是如何安装 Node.js 的。常见的安装方法包括使用包管理器(如 yum 或 nvm)和手动安装。 方法 1:使用 yum 卸载 Node.js 如果你是通过 yum安装的 Node.j…...

LeetCode 2257. Count Unguarded Cells in the Grid
🔗 https://leetcode.com/problems/count-unguarded-cells-in-the-grid 题目 给出一个 m x n 的二维表格,格子上有士兵 guard,有墙 wall士兵可以盯上他上下左右所有的格子,碰到墙的格子就停止返回没有被士兵盯到的格子的数量 思…...

即时通讯服务器被ddos攻击了怎么办?
攻击即时通讯系统的主要手段 击键记录 目前盗取即时通讯工具帐号信息的最主要方法是通过特洛伊木马等恶意软件,例如QQ木马,这类程序能够盗取QQ密码信息,常见的能够盗取最新版本QQ密码的木马程序有十几种之多。几乎所有主要的QQ木马程序都采…...

【大数据学习 | Spark-Core】Spark中的join原理
join是两个结果集之间的链接,需要进行数据的匹配。 演示一下join是否存在shuffle。 1. 如果两个rdd没有分区器,分区个数一致 ,会发生shuffle。但分区数量不变。 scala> val arr Array(("zhangsan",300),("lisi",…...

【代码pycharm】动手学深度学习v2-08 线性回归 + 基础优化算法
课程链接 线性回归的从零开始实现 import random import torch from d2l import torch as d2l# 人造数据集 def synthetic_data(w,b,num_examples):Xtorch.normal(0,1,(num_examples,len(w)))ytorch.matmul(X,w)bytorch.normal(0,0.01,y.shape) # 加入噪声return X,y.reshape…...

李宏毅机器学习课程知识点摘要(1-5集)
前5集 过拟合: 参数太多,导致把数据集刻画的太完整。而一旦测试集和数据集的关联不大,那么预测效果还不如模糊一点的模型 所以找的数据集的量以及准确性也会影响 由于线性函数的拟合一般般,所以用一组函数去分段来拟合 sigmoi…...

React(五)——useContecxt/Reducer/useCallback/useRef/React.memo/useMemo
文章目录 项目地址十六、useContecxt十七、useReducer十八、React.memo以及产生的问题18.1组件嵌套的渲染规律18.2 React.memo18.3 引出问题 十九、useCallback和useMemo19.1 useCallback对函数进行缓存19.2 useMemo19.2.1 基本的使用19.2.2 缓存属性数据 19.2.3 对于更新的理解…...

UE5时间轴节点及其设置
在 Unreal Engine 5 (UE5) 中,时间轴节点 (Timeline) 是一个非常有用的工具,可以在蓝图中实现时间驱动的动画和行为。它允许你在给定的时间范围内执行逐帧的动画或数值变化,广泛应用于动态动画、物体移动、颜色变化、材质变换等场景中。 1. …...

git 命令之只提交文件的部分更改
git 命令之只提交文件的部分更改 有时,我们在一个文件中进行了多个更改,但只想提交其中的一部分更改。这时可以使用 使用 git add -p 命令 Git add -p命令允许我们选择并添加文件中的特定更改。它将会显示一个交互式界面,显示出文件中的每个更…...

算法 差分修改 极简
N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a < b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球被涂过…...

pcb元器件选型与焊接测试时的一些个人经验
元件选型 在嘉立创生成bom表,对照bom表买 1、买电容时有50V或者100V是它的耐压值,注意耐压值 2、在买1117等降压芯片时注意它降压后的固定输出,有那种可调降压比如如下,别买错了 贴片元件焊接 我建议先薄薄的在引脚上涂上锡膏…...

OSG开发笔记(三十三):同时观察物体不同角度的多视图从相机技术
若该文为原创文章,未经允许不得转载 本文章博客地址:https://blog.csdn.net/qq21497936/article/details/143932273 各位读者,知识无穷而人力有穷,要么改需求,要么找专业人士,要么自己研究 长沙红胖子Qt…...

模糊逻辑学习 | 模糊推理 | 模糊逻辑控制
注:本文为几位功夫博主关于 “模糊逻辑学习 / 推理 / 控制” 的相关几篇文章合辑。 初学模糊逻辑控制(Fuzzy Logic Control) ziqian__ 已于 2022-08-19 20:30:25 修改 一、前言 模糊逻辑控制(Fuzzy Logic Control)是…...

【JavaEE】Servlet:表白墙
文章目录 一、前端二、前置知识三、代码1、后端2、前端3、总结 四、存入数据库1、引入 mysql 的依赖,mysql 驱动包2、创建数据库数据表3、调整上述后端代码3.1 封装数据库操作,和数据库建立连接3.2 调整后端代码 一、前端 <!DOCTYPE html> <ht…...

C++特殊类设计(不能被拷贝的类、只能在堆上创建对象的类、不能被继承的类、单例模式)
C特殊类设计 在实际应用中,可能需要设计一些特殊的类对象,如不能被拷贝的类、只能在堆上创建对象的类、只能在栈上创建对象的类、不能被继承的类、只能创建一个对象的类(单例模式)。 1. 不能被拷贝的类 拷贝只会发生在两个场景…...

【小白学机器学习34】用python进行基础的数据统计 mean,var,std,median,mode ,四分位数等
目录 1 用 numpy 快速求数组的各种统计量:mean, var, std 1.1 数据准备 1.2 直接用np的公式求解 1.3 注意问题 1.4 用print() 输出内容,显示效果 2 为了验证公式的后背,下面是详细的展开公式的求法 2.1 均值mean的详细 2.2 方差var的…...

安装 Docker(使用国内源)
一、安装Docker-ce 1、下载阿里云的repo源 [rootlocalhost ~]# yum install yum-utils -y && yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo && yum makecache # 尝试列出 docker-ce 的版本 [rootlocalh…...

Ajax学习笔记,第一节:语法基础
Ajax学习笔记,第一节:语法基础 一、概念 1、什么是Ajax 使用浏览器的 XMLHttpRequest 对象 与服务器通信2、什么是axios Axios是一个基于Promise的JavaScript库,支持在浏览器和Node.js环境中使用。相较于Ajax,Axios提供了更多…...

《用Python画蔡徐坤:艺术与编程的结合》
简介 大家好!今天带来一篇有趣的Python编程项目,用代码画出知名偶像蔡徐坤的形象。这个项目使用了Python的turtle库,通过简单的几何图形和精心设计的代码来展示艺术与编程的结合。 以下是完整的代码和效果介绍,快来试试看吧&…...

Unity中动态生成贴图并保存成png图片实现
实现原理: 要生成长x宽y的贴图,就是生成x*y个像素填充到贴图中,如下图: 如果要改变局部颜色,就是从x1到x2(x1<x2),y1到y2(y1<y2)这个范围做处理, 或者要想做圆形就是计算距某个点(x1,y1&…...

Mac配置maven环境及在IDEA中配置Maven
Mac配置maven环境及在IDEA中配置Maven 1. 介绍 Maven是一款广泛用于Java等JVM语言项目的工具,它以项目对象模型(POM)为基础进行项目管理,通过POM文件来定义项目信息和依赖关系。同时,它也是构建自动化工具࿰…...

Reactor 模式的理论与实践
1. 引言 1.1 什么是 Reactor 模式? Reactor 模式是一种用于处理高性能 I/O 的设计模式,专注于通过非阻塞 I/O 和事件驱动机制实现高并发性能。它的核心思想是将 I/O 操作的事件分离出来,通过事件分发器(Reactor)将事…...

vim 一次注释多行 的几种方法
在 Vim 中一次注释多行是一个常见操作。可以使用以下方法根据你的具体需求选择合适的方式: 方法 1:手动插入注释符 进入正常模式: 按 Esc 确保进入正常模式。 选择需要注释的多行: 移动到第一行,按下 Ctrlv 进入可视块…...