APM常用標簽
更(geng)新時間 2024-11-07 16:09:37
最近更(geng)新時間: 2024-11-07 16:09:37
分(fen)享文章
本節主要介紹(shao)APM常用標(biao)簽
以下為APM常(chang)用的標簽(qian)。
Http
| 字段名 | 類型 | 參數說明 | 例子 |
|---|---|---|---|
| http.url | string | 完整請求地址 | //127.0.0.1:8080/hello |
| http.status_code | int | http 返回狀態碼 | 200 |
| http.method | string | 請求方法 | GET |
| http.scheme | string | URL 協議 | http |
| http.route | string | 請求地址url | /hello |
| http.target | string | 請求路由映射 | /hello?test=abc |
| http.user_agent | string | Http User Agent | Go-http-client/1.1 |
| http.flavor | string | http協議版本 | 1.1 |
數據庫
| 字段名 | 類型 | 參數說明 | 例子 |
|---|---|---|---|
| db.name | string | 數據庫實例名 | testDb |
| db.statement | string | 執行語句 | select * from user |
| db.system | string | 數據庫類型 | mysql |
| db.connection_string | string | 數據庫地址 | 127.0.0.1:3306 |
| db.user | string | 數據庫用戶名 | root |
| db.operation | string | 數據庫操作 | SELECT |
Rpc
| 字段名 | 類型 | 參數說明 | 例子 |
|---|---|---|---|
| rpc.system | string | RPC系統 | grpc |
| rpc.service | string | 被調用的服務名稱 | HelloService |
| rpc.method | string | 接口方法名 | SayHello |
| rpc.grpc.status_code | int | gRPC 調用狀態碼 | 0 |
Messaging
| 字段名 | 類型 | 參數說明 | 例子 |
|---|---|---|---|
| messaging.system | string | 消息系統 | kafka |
| messaging.destination | string | 消息目的 | myTopic |
| messaging.operation | string | 消息操作 | publish |
自定義標簽
用戶可(ke)在上報(bao)數(shu)據時自定義標簽 ,例如在上報(bao) go應(ying)用數(shu)據時自定義標簽,您可(ke)以通過輸入標簽鍵、標簽值 key:value 來(lai)搜索(suo)到該標簽所對應(ying)的Span。
span.Tag("key",?"value")
URL攔截
例子:
curl -X GET \
//127.0.0.1:9999/cluster/getClusterInfo.json?clusterId=osaka-pallas-search.vip.com\
-H 'Authorization: Basic bW9uaXRvcmFkbWluOHT1UjZ2RuUGgyMDIy' \
-H 'Content-Type: application/json'
| 字段名 | 類型 | 參數說明 | 例子 |
|---|---|---|---|
| http.request.header.authorization | string | 請求header的key1.其中key的中劃線要改為下滑線2.首字母大寫改為小寫 | 攔截Content-Type要改為content_type |
| http.request.param.clusterId | string | URL參數1.其中參數的中劃線要改為下滑線2.首字母大寫改為小寫 | //127.0.0.1:9999/cluster/getClusterInfo.json?clusterId=osaka-pallas-search.vip.comclusterId為攔截的url參數 |