Skip to content

Commit

Permalink
Metrics rename (#346)
Browse files Browse the repository at this point in the history
* metrics: inline all counter references

remove all calls to metrics.Counter
and instead inline using the prometheus/promauto package

* metrics: inject prometheus register dependency

that's used to give more control and therefore
create unique registers per tests
avoiding the "duplicate metrics collector registration attempted" panic
message
see prometheus/client_golang#716 (comment)

* metrics: inline gauge calls

* metrics: inline all gauge calls in debug reporter

couple things:
1 - semantics have changed, ie the metrics are initialized to 0
even if we can't ever generate metrics data

so think in a dashboard a 0 value vs simply nothing showing up

2 - some of the metrics generated were dynamic, for example,
based on files in a directory
that has been hardcoded

* metrics: inline timing calls and remove metrics pkg

* metrics: bring back type assertions

* metrics: create basic playground to compare metrics

* metrics: convert timing metrics to nanoseconds

* metrics: improve metrics-comparison docker-compose

* metrics: fixes /benchmark

* metrics: fix broken test

* dashboard: initial version created with jsonnet

* metrics: add pyroscope_ suffix

* metrics: make missing metrics greppable

* metrics: prepend pyroscope_ to missing metrics

* metrics: refactor storage and cache counters

* metrics: rename pyroscope_disk and pyroscope_cache_size

* metrics: rename _count suffix to _total

* metrics: timers are now histograms

* metrics: refactor cache writes/misses metrics

* metrics: rename a bunch of metrics

* metrics: add dashboard row for go metrics

* metrics: cleanup dashboard

* metrics: add help text to benchmark metrics
  • Loading branch information
eh-am authored Aug 23, 2021
1 parent f3186f4 commit c22739d
Show file tree
Hide file tree
Showing 8 changed files with 1,152 additions and 455 deletions.
12 changes: 8 additions & 4 deletions benchmark/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ func startClientThread(appName string, wg *sync.WaitGroup, appFixtures []*transp
reg := prometheus.NewRegistry()

uploadErrors := promauto.With(reg).NewCounter(prometheus.CounterOpts{
Name: "upload_errors",
Name: "pyroscope_upload_errors",
Help: "",
})
successfulUploads := promauto.With(reg).NewCounter(prometheus.CounterOpts{
Name: "successful_uploads",
Name: "pyroscope_successful_uploads",
Help: "",
})

for i := 0; i < requestsCount; i++ {
Expand Down Expand Up @@ -204,10 +206,12 @@ func main() {
logrus.Info("waiting for other services to load")

benchmark := promauto.NewGauge(prometheus.GaugeOpts{
Name: "benchmark",
Name: "pyroscope_benchmark",
Help: "",
})
runProgress := promauto.NewGauge(prometheus.GaugeOpts{
Name: "run_progress",
Name: "pyroscope_run_progress",
Help: "",
})

benchmark.Set(0)
Expand Down
Loading

0 comments on commit c22739d

Please sign in to comment.