New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/bonree-smartagent/profiling-go

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/bonree-smartagent/profiling-go

v0.0.0-20250116023715-72785e0647d5
Source
Go
Version published
Created
Source

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
  • 安装smartagent,配置监控应用

FAQs

Package last updated on 16 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts