mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-24 09:50:00 +08:00
feat: group metrics with instance uuid
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/olekukonko/tablewriter"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/push"
|
||||
@@ -366,8 +367,9 @@ var (
|
||||
|
||||
// NewPrometheusPusherOutput returns a PrometheusPusherOutput.
|
||||
func NewPrometheusPusherOutput(gatewayURL, jobName string) *PrometheusPusherOutput {
|
||||
nodeUUID, _ := uuid.NewUUID()
|
||||
return &PrometheusPusherOutput{
|
||||
pusher: push.New(gatewayURL, jobName),
|
||||
pusher: push.New(gatewayURL, jobName).Grouping("instance", nodeUUID.String()),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user