基于pinpoint改造的一种方式的思考(3)--javascript/golang agent处理

28 篇文章 1 订阅
3 篇文章 0 订阅

前言

在前一篇文章中,我们探讨了collector 的数据处理,这一篇中我们将讲讲如何构建javascript、golang agent。

golang

golang
如图所示我们将pinpoint的协议进行改造,并生成go语言版本的agent

type TSpan struct {
    AgentId         string `thrift:"agentId,1" json:"agentId"`
    ApplicationName string `thrift:"applicationName,2" json:"applicationName"`
    AgentStartTime  int64  `thrift:"agentStartTime,3" json:"agentStartTime"`
    TransactionId   []byte `thrift:"transactionId,4" json:"transactionId"`
    // unused fields # 5 to 6
    SpanId                int64          `thrift:"spanId,7" json:"spanId"`
    ParentSpanId          int64          `thrift:"parentSpanId,8" json:"parentSpanId"`
    StartTime             int64          `thrift:"startTime,9" json:"startTime"`
    Elapsed               int32          `thrift:"elapsed,10" json:"elapsed"`
    Rpc                   *string        `thrift:"rpc,11" json:"rpc"`
    ServiceType           int16          `thrift:"serviceType,12" json:"serviceType"`
    EndPoint              *string        `thrift:"endPoint,13" json:"endPoint"`
    RemoteAddr            *string        `thrift:"remoteAddr,14" json:"remoteAddr"`
    Annotations           []*TAnnotation `thrift:"annotations,15" json:"annotations"`
    Flag                  int16          `thrift:"flag,16" json:"flag"`
    Err                   *int32         `thrift:"err,17" json:"err"`
    SpanEventList         []*TSpanEvent  `thrift:"spanEventList,18" json:"spanEventList"`
    ParentApplicationName *string        `thrift:"parentApplicationName,19" json:"parentApplicationName"`
    ParentApplicationType *int16         `thrift:"parentApplicationType,20" json:"parentApplicationType"`
    AcceptorHost          *string        `thrift:"acceptorHost,21" json:"acceptorHost"`
    // unused fields # 22 to 24
    ApiId         *int32           `thrift:"apiId,25" json:"apiId"`
    ExceptionInfo *TIntStringValue `thrift:"exceptionInfo,26" json:"exceptionInfo"`
    // unused fields # 27 to 29
    ApplicationServiceType *int16 `thrift:"applicationServiceType,30" json:"applicationServiceType"`
    LoggingTransactionInfo *int8  `thrift:"loggingTransactionInfo,31" json:"loggingTransactionInfo"`
}

我们将Agent发送的数据发送到mecury,mecury再次进行数据解析,数据压缩,发送到collector。

javascript

javascript
javascript 我们将新增 GetWay网关层。我们见agent数据提供websocket发送到高性能GetWay层。GetWay将网页的监控数据链路数据错误信息,进行预处理,压缩发送到collector。自此将全链路数据打通,同时也收集了前端的性能数据。

总结

javascript/golang agent改造到此结束。不过后续还有很多问题需要处理:

1.如何处理离线数据,并能在web端实时高效的展示。
2.如何结合全链路监控和系统监控,做业务监控,服务监控
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值