Add hierarchy for RabbitMQ (#11935)

Co-authored-by: 邵一鸣 <shaoym02@vanke.com>
Co-authored-by: Wan Kai <wankai123@foxmail.com>
This commit is contained in:
peachisai 2024-02-27 12:18:36 +08:00 committed by GitHub
parent f006edd158
commit eb071e49df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 53 additions and 2 deletions

View File

@ -58,6 +58,9 @@
* Add `maxInboundMessageSize (SW_DCS_MAX_INBOUND_MESSAGE_SIZE)` configuration to change the max inbound message size of DCS.
* Fix Service Layer when building Events in the EventHookCallback.
* Add Golang as a supported language for Pulsar.
* Add Service Hierarchy auto matching layer relationships (upper -> lower) as following:
- RABBITMQ -> K8S_SERVICE
- VIRTUAL_MQ -> RABBITMQ
#### UI

View File

@ -26,7 +26,9 @@ If you want to customize it according to your own needs, please refer to [Servic
| NGINX | K8S_SERVICE | [NGINX On K8S_SERVICE](#nginx-on-k8s_service) |
| APISIX | K8S_SERVICE | [APISIX On K8S_SERVICE](#apisix-on-k8s_service) |
| ROCKETMQ | K8S_SERVICE | [ROCKETMQ On K8S_SERVICE](#rocketmq-on-k8s_service) |
| VIRTUAL_MQ | ROCKETMQ | [VIRTUAL_MQ On K8S_SERVICE](#virtual_mq-on-rocketmq) |
| VIRTUAL_MQ | ROCKETMQ | [VIRTUAL_MQ On ROCKETMQ](#virtual_mq-on-rocketmq) |
| RABBITMQ | K8S_SERVICE | [RABBITMQ On K8S_SERVICE](#rabbitmq-on-k8s_service) |
| VIRTUAL_MQ | RABBITMQ | [VIRTUAL_MQ On RABBITMQ](#virtual_mq-on-rabbitmq) |
- The following sections will describe the **default matching rules** in detail and use the `upper-layer On lower-layer` format.
- The example service name are based on SkyWalking [Showcase](https://github.com/apache/skywalking-showcase) default deployment.
@ -144,6 +146,22 @@ If you want to customize it according to your own needs, please refer to [Servic
- VIRTUAL_MQ.service.name: `rocketmq.skywalking-showcase.svc.cluster.local:9876`
- ROCKETMQ.service.name: `rocketmq::rocketmq.skywalking-showcase`
#### RABBITMQ On K8S_SERVICE
- Rule name: `short-name`
- Groovy script: `{ (u, l) -> u.shortName == l.shortName }`
- Description: RABBITMQ.service.shortName == K8S_SERVICE.service.shortName
- Matched Example:
- RABBITMQ.service.name: `rabbitmq::rabbitmq.skywalking-showcase`
- K8S_SERVICE.service.name: `skywalking-showcase::rabbitmq.skywalking-showcase`
#### VIRTUAL_MQ On RABBITMQ
- Rule name: `lower-short-name-with-fqdn`
- Groovy script: `{ (u, l) -> u.shortName.substring(0, u.shortName.lastIndexOf(':')) == l.shortName.concat('.svc.cluster.local') }`
- Description: VIRTUAL_MQ.service.shortName remove port == RABBITMQ.service.shortName with fqdn suffix
- Matched Example:
- VIRTUAL_MQ.service.name: `rabbitmq.skywalking-showcase.svc.cluster.local:5672`
- RABBITMQ.service.name: `rabbitmq::rabbitmq.skywalking-showcase`
### Build Through Specific Agents
Use agent tech involved(such as eBPF) and deployment tools(such as operator and agent injector) detect the service hierarchy relations.

View File

@ -48,12 +48,16 @@ hierarchy:
ROCKETMQ:
K8S_SERVICE: short-name
RABBITMQ:
K8S_SERVICE: short-name
VIRTUAL_DATABASE:
MYSQL: lower-short-name-with-fqdn
POSTGRESQL: lower-short-name-with-fqdn
VIRTUAL_MQ:
ROCKETMQ: lower-short-name-with-fqdn
RABBITMQ: lower-short-name-with-fqdn
# Use Groovy script to define the matching rules, the input parameters are the upper service(u) and the lower service(l) and the return value is a boolean,
# which are used to match the relation between the upper service(u) and the lower service(l) on the different layers.
@ -83,6 +87,7 @@ layer-levels:
APISIX: 2
NGINX: 2
ROCKETMQ: 2
RABBITMQ: 2
MESH_DP: 1

View File

@ -732,7 +732,32 @@
"entity": "Service",
"name": "RabbitMQ-Cluster",
"id": "RabbitMQ-Cluster",
"isRoot": false
"isRoot": false,
"isDefault": true,
"expressions": [
"avg(meter_rabbitmq_messages_published)",
"avg(meter_rabbitmq_messages_unconfirmed)",
"avg(meter_rabbitmq_queues)",
"avg(meter_rabbitmq_channels)",
"avg(meter_rabbitmq_connections)"
],
"expressionsConfig": [
{
"label": "messages published"
},
{
"label": "messages unconfirmed"
},
{
"label": "queues"
},
{
"label": "channels"
},
{
"label": "connections"
}
]
}
}
]