Socket
Socket
Sign inDemoInstall

github.com/travelaudience/pprofetheus

Package Overview
Dependencies
0
Maintainers
0
Alerts
File Explorer

Install Socket

Protect your apps from supply chain attacks

Install

github.com/travelaudience/pprofetheus

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 and then import the same package, and set up the collector with Prometheus in your code, e.g. like this:

    v0.0.0-20161130120234-4252102f4c0d

Version published
Maintainers
0

Readme

# pprofetheus

[![GoDoc](https://godoc.org/github.com/travelaudience/pprofetheus?status.svg)](https://godoc.org/github.com/travelaudience/pprofetheus)
[![Go Report Card](https://goreportcard.com/badge/github.com/travelaudience/pprofetheus)](https://goreportcard.com/report/github.com/travelaudience/pprofetheus)

pprofetheus is a collector for [Prometheus](https://prometheus.io/) 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.

## Quick start

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()

After these changes, your application will export the Prometheus metrics 
`pprof_cpu_time_used_ms`, `pprof_cpu_time_used_cum_ms`, `pprof_cpu_started` and 
`pprof_cpu_stopped`.

`pprof_cpu_time_used_ms` contains the amount of milliseconds the program spent 
in the function provided in the label `function`.

`pprof_cpu_time_used_cum_ms` contains the _cumulated_ amount of milliseconds 
the program spent in the function provided in the label `function`. This means 
that the amount of time spent in a function is accounted both for the function 
that spent the time and all functions up the call stack. The cumulated time 
thus includes the total time that a function spent, including all other 
functions that were called by that function.

`pprof_cpu_started` counts how often the `Start` method has been called on the 
collector, while `pprof_cpu_stopped` counts how often the `Stop` method has 
been called on the collector.

## License

Please see the file [LICENSE](LICENSE) for licensing information.

The files in the subdirectory `internal` are subject to a separate license. See
[internal/LICENSE](internal/LICENSE) for licensing information.

FAQs

Last updated on 30 Nov 2016

Did you know?

Socket installs a GitHub app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc