Skip to content
Snippets Groups Projects
Unverified Commit ffe41737 authored by dlorenc's avatar dlorenc Committed by GitHub
Browse files

Add a custom metric to prometheus. (#153)

This works! We can use it to track # of new entries over time.
parent aa0a428b
No related branches found
No related tags found
No related merge requests found
......@@ -108,6 +108,9 @@ func CreateLogEntryHandler(params entries.CreateLogEntryParams) middleware.Respo
}
}
// We made it this far, that means the entry was successfully added.
metricNewEntries.Inc()
queuedLeaf := resp.getAddResult.QueuedLeaf.Leaf
uuid := hex.EncodeToString(queuedLeaf.GetMerkleLeafHash())
......
package api
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
metricNewEntries = promauto.NewCounter(prometheus.CounterOpts{
Name: "rekor_new_entries",
Help: "The total number of new log entries",
})
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment