Skip to content

Commit

Permalink
usage stats
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Elliott <[email protected]>
  • Loading branch information
joe-elliott committed Aug 20, 2024
1 parent 6b7342d commit 3d20ce8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/distributor/distributor.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/grafana/tempo/pkg/model"
"github.com/grafana/tempo/pkg/tempopb"
v1 "github.com/grafana/tempo/pkg/tempopb/trace/v1"
"github.com/grafana/tempo/pkg/usagestats"
tempo_util "github.com/grafana/tempo/pkg/util"

"github.com/grafana/tempo/pkg/validation"
Expand Down Expand Up @@ -109,6 +110,9 @@ var (
Name: "distributor_metrics_generator_clients",
Help: "The current number of metrics-generator clients.",
})

statBytesReceived = usagestats.NewCounter("distributor_bytes_received")
statSpansReceived = usagestats.NewCounter("distributor_spans_received")
)

// rebatchedTrace is used to more cleanly pass the set of data
Expand Down Expand Up @@ -353,6 +357,8 @@ func (d *Distributor) PushTraces(ctx context.Context, traces ptrace.Traces) (*te

metricBytesIngested.WithLabelValues(userID).Add(float64(size))
metricSpansIngested.WithLabelValues(userID).Add(float64(spanCount))
statBytesReceived.Inc(int64(size))
statSpansReceived.Inc(int64(spanCount))

keys, rebatchedTraces, err := requestsByTraceID(batches, userID, spanCount)
if err != nil {
Expand Down

0 comments on commit 3d20ce8

Please sign in to comment.