Documentation ¶
Overview ¶
pprofetheus is a collector for Prometheus that collects CPU profiling data for the current process and exports them as metrics. It can be used to monitor, visualize, and alert on profiling data from any Go process that imports pprofetheus and exports metrics via Prometheus.
In order to use pprofetheus in your Prometheus-enabled Go application, you just need to
go get github.com/travelaudience/pprofetheus
and then import the same package, and set up the collector with Prometheus in your code, e.g. like this:
cpuProfileCollector, err := pprofetheus.NewCPUProfileCollector() if err != nil { /* handle error */ } prometheus.MustRegister(cpuProfileCollector) cpuProfileCollector.Start()
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProfileCollector ¶
type ProfileCollector interface { prometheus.Collector Start() Stop() }
ProfileCollector describes a pprofetheus collector. It can act as a prometheus.Collector plus it can be Start()ed and Stop()ed to limit profiling to only desired time periods.
func NewCPUProfileCollector ¶
func NewCPUProfileCollector() (ProfileCollector, error)
NewCPUProfileCollector creates a new CPU profile collector.
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
bio
Package bio implements common I/O abstractions used within the Go toolchain.
|
Package bio implements common I/O abstractions used within the Go toolchain. |
gcprog
Package gcprog implements an encoder for packed GC pointer bitmaps, known as GC programs.
|
Package gcprog implements an encoder for packed GC pointer bitmaps, known as GC programs. |
goobj
Package goobj implements reading of Go object files and archives.
|
Package goobj implements reading of Go object files and archives. |
objfile
Package objfile implements portable access to OS-specific executable files.
|
Package objfile implements portable access to OS-specific executable files. |
pprof/commands
Package commands defines and manages the basic pprof commands
|
Package commands defines and manages the basic pprof commands |
pprof/driver
Package driver implements the core pprof functionality.
|
Package driver implements the core pprof functionality. |
pprof/fetch
Package fetch provides an extensible mechanism to fetch a profile from a data source.
|
Package fetch provides an extensible mechanism to fetch a profile from a data source. |
pprof/plugin
Package plugin defines the plugin implementations that the main pprof driver requires.
|
Package plugin defines the plugin implementations that the main pprof driver requires. |
pprof/profile
Package profile provides a representation of profile.proto and methods to encode/decode profiles in this format.
|
Package profile provides a representation of profile.proto and methods to encode/decode profiles in this format. |
pprof/report
Package report summarizes a performance profile into a human-readable report.
|
Package report summarizes a performance profile into a human-readable report. |
pprof/svg
Package svg provides tools related to handling of SVG files
|
Package svg provides tools related to handling of SVG files |
pprof/symbolizer
Package symbolizer provides a routine to populate a profile with symbol, file and line number information.
|
Package symbolizer provides a routine to populate a profile with symbol, file and line number information. |
pprof/symbolz
Package symbolz symbolizes a profile using the output from the symbolz service.
|
Package symbolz symbolizes a profile using the output from the symbolz service. |
pprof/tempfile
Package tempfile provides tools to create and delete temporary files
|
Package tempfile provides tools to create and delete temporary files |