APM常用标签
更新时间 2024-11-07 16:09:37
最近更新时间: 2024-11-07 16:09:37
本节主要介绍APM常用标签
以下为APM常用的标签。
Http
字段名 | 类型 | 参数说明 | 例子 |
---|---|---|---|
http.url | string | 完整请求地址 | http://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 |
自定义标签
用户可在上报数据时自定义标签 ,例如在上报 go应用数据时自定义标签,您可以通过输入标签键、标签值 key:value 来搜索到该标签所对应的Span。
span.Tag("key", "value")
URL拦截
例子:
curl -X GET \
http://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.首字母大写改为小写 | http://127.0.0.1:9999/cluster/getClusterInfo.json?clusterId=osaka-pallas-search.vip.comclusterId为拦截的url参数 |