Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change prometheus to not aggregate metrics and only export them. #385

Merged
merged 22 commits into from
Dec 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
a8c5b86
draft using stop aggregating on prometheus client (counters)
paivagustavo Dec 11, 2019
0d1e9cb
remove prometheus client aggregations
paivagustavo Dec 12, 2019
70dce98
make pre commit
paivagustavo Dec 12, 2019
047cfd7
add simple error callback
paivagustavo Dec 13, 2019
844dab5
remove options from collector
paivagustavo Dec 13, 2019
59d7133
refactor exporter to smaller methods
paivagustavo Dec 13, 2019
2d470c3
wording
paivagustavo Dec 13, 2019
cf0c947
change to snapshot
paivagustavo Dec 13, 2019
850d10d
Merge branch 'master' into prometheus-client-export-only
paivagustavo Dec 14, 2019
878c0f4
lock collection and checkpointset read
paivagustavo Dec 17, 2019
c74aeb6
remove histogram options and unexported fields from the Exporter
paivagustavo Dec 18, 2019
cdebea1
documenting why prometheus uses a stateful batcher
paivagustavo Dec 18, 2019
3c43915
add todo for histograms
paivagustavo Dec 18, 2019
2661c94
change summaries objects to summary quantiles
paivagustavo Dec 18, 2019
7ca61b9
remove histogram buckets from tests
paivagustavo Dec 18, 2019
3f8fc4f
wording
paivagustavo Dec 18, 2019
d0946e2
rename 'lockedCheckpoint' to 'syncCheckpointSet'
paivagustavo Dec 18, 2019
0368777
default summary quantiles should be defaulted to no buckets.
paivagustavo Dec 18, 2019
3d18962
add quantiles options
paivagustavo Dec 18, 2019
e735612
refactor test.CheckpointSet and add docs
paivagustavo Dec 19, 2019
8bfbf11
flip aggregators merge
paivagustavo Dec 19, 2019
3104c67
Merge branch 'master' into prometheus-client-export-only
jmacd Dec 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions example/prometheus/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,20 @@ var (

func initMeter() *push.Controller {
selector := simple.NewWithExactMeasure()
exporter, err := prometheus.NewExporter(prometheus.Options{
DefaultHistogramBuckets: []float64{0., 10., 15., 20.},
})
exporter, err := prometheus.NewExporter(prometheus.Options{})

if err != nil {
log.Panicf("failed to initialize metric stdout exporter %v", err)
}
batcher := defaultkeys.New(selector, sdkmetric.NewDefaultLabelEncoder(), false)
// Prometheus needs to use a stateful batcher since counters (and histogram since they are a collection of Counters)
// are cumulative (i.e., monotonically increasing values) and should not be resetted after each export.
//
// Prometheus uses this approach to be resilient to scrape failures.
// If a Prometheus server tries to scrape metrics from a host and fails for some reason,
// it could try again on the next scrape and no data would be lost, only resolution.
//
// Gauges (or LastValues) and Summaries are an exception to this and have different behaviors.
batcher := defaultkeys.New(selector, sdkmetric.NewDefaultLabelEncoder(), true)
jmacd marked this conversation as resolved.
Show resolved Hide resolved
pusher := push.New(batcher, exporter, time.Second)
pusher.Start()

Expand Down
94 changes: 0 additions & 94 deletions exporter/metric/prometheus/counter.go

This file was deleted.

94 changes: 0 additions & 94 deletions exporter/metric/prometheus/gauge.go

This file was deleted.

98 changes: 0 additions & 98 deletions exporter/metric/prometheus/histogram.go

This file was deleted.

Loading