GO Profile

简介

service_go_profile input插件可以采集Golang pprof 性能数据。

配置参数

全局参数

host模式子配置

对于静态host模式,需要指定service标签标明归属服务。

  1. 子配置

  1. Address 配置

kubernetes模式子配置

待采集容器需要先声明ILOGTAIL_PROFILE_PORT={PORT} 环境变量,其后通过下述配置二次过滤。

样例

采集host模式性能数据

  1. 配置样例

    inputs:
      - Type: service_go_profile
        Mode: host
        Labels:
          global: outer
          service: service
        Config:
          Addresses:
            - Host: "127.0.0.1"
              Port: 18689
              InstanceLabels:
                service: inner
  1. 采集结果

2023-04-03 14:04:52 [INF] [flusher_stdout.go:120] [Flush] [1.0#PluginProject_0##Config0,PluginLogstore_0]       {"name":"github.com/denisenkom/go-mssqldb/internal/cp.init /Users/evan/go/pkg/mod/github.com/denisenkom/go-mssqldb@v0.12.2/internal/cp/cp950.go","stack":"runtime.doInit /usr/local/go/src/runtime/proc.go\nruntime.doInit /usr/local/go/src/runtime/proc.go\nruntime.doInit /usr/local/go/src/runtime/proc.go\nruntime.doInit /usr/local/go/src/runtime/proc.go\nruntime.doInit /usr/local/go/src/runtime/proc.go\nruntime.main /usr/local/go/src/runtime/proc.go","stackID":"c4bbfc9dff64151d","language":"go","type":"profile_mem","dataType":"CallStack","durationNs":"0","profileID":"f6a443c0-cca0-45ac-b50a-b1e25a48fb74","labels":"{\"__name__\":\"service\",\"global\":\"outer\",\"instance\":\"inner\",\"job\":\"1_0_pluginproject_0__config0\"}","units":"bytes","valueTypes":"inuse_space","aggTypes":"sum","val":"1615794.00","__time__":"1680501892"}:  

采集kubernets模式性能数据

    inputs:
      - Type: service_go_profile
        Mode: kubernetes
        Config:
          IncludeK8sLabel:
            app: golang-pull
        Labels:
          global: outer
  1. 采集结果

2023-04-03 06:07:13 [INF] [flusher_stdout.go:120] [Flush] [1.0#PluginProject_0##Config0,PluginLogstore_0]       {"name":"runtime.memclrNoHeapPointers /usr/local/go/src/runtime/memclr_amd64.s","stack":"runtime.mallocgc /usr/local/go/src/runtime/malloc.go\nruntime.makeslice /usr/local/go/src/runtime/slice.go\nmain.memNormal /output/main.go\nmain.main.func1 /output/main.go","stackID":"36108813ff189cc4","language":"go","type":"profile_cpu","dataType":"CallStack","durationNs":"10000045532","profileID":"7bb6291c-b358-43fa-888a-dec7676552e4","labels":"{\"__name__\":\"golang-pull\",\"container\":\"golang-pull\",\"instance\":\"10.175.2.230:8080\",\"job\":\"1_0_pluginproject_0__config0\",\"label\":\"outer\",\"namespace\":\"profile\",\"pod\":\"golang-pull-6b946f8f6c-vhv9t\"}","units":"nanoseconds","valueTypes":"cpu","aggTypes":"sum","val":"20000000.00","__time__":"1680502023"}:

Last updated