profiling-go

module
v0.0.0-...-72785e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2025 License: Apache-2.0

README

profiling-go

profiling-go 是一个基于 dd-trace-go 的封装,用于采集 Go 应用的持续剖析数据,并将其上报到Bonree One平台中。

使用说明

1. 添加依赖

修改项目的 go.mod 文件

require github.com/bonree-smartagent/profiling-go latest

然后运行:

go mod tidy
2. 修改代码
package main

import (
	"github.com/bonree-smartagent/profiling-go/profiler"
)

func main() {
	profiler.Start()
	defer profiler.Stop()
    // 业务代码
}
3. 编译
# 确保添加环境变量 CGO_ENABLED=1
# 如果go编译环境为:musl,则还需添加编译参数 -ldflags="-linkmode=external"
CGO_ENABLED=1 go build -ldflags="-linkmode=external" main.go
  1. 安装smartagent,配置监控应用

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL