cleaner example
Signed-off-by: Eugene <eugene@amberpixels.io>
This commit is contained in:
parent
5d421be191
commit
aa7e203147
|
@ -51,7 +51,7 @@ func ExampleNewCounterVecT_multiple_labels_manual() {
|
||||||
|
|
||||||
c := promsafe.NewCounterVecT(prometheus.CounterOpts{
|
c := promsafe.NewCounterVecT(prometheus.CounterOpts{
|
||||||
Name: "items_counted_detailed",
|
Name: "items_counted_detailed",
|
||||||
}, &MyCounterLabels{})
|
}, new(MyCounterLabels))
|
||||||
|
|
||||||
// Manually register the counter
|
// Manually register the counter
|
||||||
if err := prometheus.Register(c.Unsafe()); err != nil {
|
if err := prometheus.Register(c.Unsafe()); err != nil {
|
||||||
|
@ -86,7 +86,7 @@ func ExampleNewCounterVecT_promauto_migrated() {
|
||||||
EventType string
|
EventType string
|
||||||
Source string
|
Source string
|
||||||
}
|
}
|
||||||
c := promsafe.WithAuto(myReg).NewCounterVecT(counterOpts, &TicketReservationAttemptsLabels{})
|
c := promsafe.WithAuto(myReg).NewCounterVecT(counterOpts, new(TicketReservationAttemptsLabels))
|
||||||
|
|
||||||
c.With(&TicketReservationAttemptsLabels{
|
c.With(&TicketReservationAttemptsLabels{
|
||||||
EventType: "reservation", Source: "source1",
|
EventType: "reservation", Source: "source1",
|
||||||
|
@ -121,7 +121,7 @@ func ExampleNewCounterVecT_promauto_global_migrated() {
|
||||||
Status string
|
Status string
|
||||||
Source string
|
Source string
|
||||||
}
|
}
|
||||||
c := promsafe.NewCounterVecT(counterOpts, &TicketReservationAttemptsLabels{})
|
c := promsafe.NewCounterVecT(counterOpts, new(TicketReservationAttemptsLabels))
|
||||||
|
|
||||||
c.With(&TicketReservationAttemptsLabels{
|
c.With(&TicketReservationAttemptsLabels{
|
||||||
Status: "active", Source: "source1",
|
Status: "active", Source: "source1",
|
||||||
|
|
Loading…
Reference in New Issue