- 필수 기능
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- 디지털 경험
- 소프트웨어 제공
- 보안
- 로그 관리
- 관리
- 인프라스트럭처
- ci
- containers
- csm
- ndm
- otel_guides
- overview
- slos
- synthetics
- tests
- 워크플로
Starting with [Go 1.21][1], the Go compiler supports profile-guided optimization (PGO).
PGO enables additional optimizations on code identified as hot by CPU profiles of production workloads. This is compatible with [Datadog Go Continuous Profiler][2] and can be used for production builds.
Here are some key points about how PGO works:
default.pgo
and use it to produce a more optimized binary.For more information, see the [Go PGO documentation][4].
PGO is a standard Go compiler option that you can use by manually downloading profiles from Datadog. Datadog built a tool, datadog-pgo
to help you enable PGO on all services, using the latest and most representative profiles.
datadog-pgo
is in public beta.To enable PGO using the datadog-pgo
tool:
Create a dedicated API key and an application key scoped to at least continuous_profiler_pgo_read
as described in [API and Application Keys][5].
Set DD_API_KEY
, DD_APP_KEY
, and DD_SITE
with the environment secret mechanism of your CI provider.
Run datadog-pgo
before your build step.
For example, for a service foo
that runs in prod
and has its main package in ./cmd/foo
, you should add this step:
go run github.com/DataDog/datadog-pgo@latest "service:foo env:prod" ./cmd/foo/default.pgo
The Go toolchain automatically picks up any default.pgo
file in the main package, so you don’t need to modify your go build
step.
See the [datadog-pgo GitHub repository][6] for more details.
To check where PGO is enabled, search for [Go profiles without pgo tag set to true][7].
The pgo
tag was implemented in dd-trace-go 1.61.0, so any profiles prior to this version will not have pgo:false
.
Additional helpful documentation, links, and articles: