Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit eb3edc6

Browse files
author
Bogdan Drutu
authored
Fix some of the stats exported. (#437)
1 parent 1ce867d commit eb3edc6

3 files changed

Lines changed: 9 additions & 13 deletions

File tree

internal/collector/processor/nodebatcher/metrics.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,39 +61,39 @@ func MetricViews(level telemetry.Level) []*view.View {
6161
Measure: statNodesAddedToBatches,
6262
Description: statNodesAddedToBatches.Description(),
6363
TagKeys: exporterTagKeys,
64-
Aggregation: view.Count(),
64+
Aggregation: view.Sum(),
6565
}
6666

6767
nodesRemovedFromBatchesView := &view.View{
6868
Name: statNodesRemovedFromBatches.Name(),
6969
Measure: statNodesRemovedFromBatches,
7070
Description: statNodesRemovedFromBatches.Description(),
7171
TagKeys: exporterTagKeys,
72-
Aggregation: view.Count(),
72+
Aggregation: view.Sum(),
7373
}
7474

7575
countBatchSizeTriggerSendView := &view.View{
7676
Name: statBatchSizeTriggerSend.Name(),
7777
Measure: statBatchSizeTriggerSend,
7878
Description: statBatchSizeTriggerSend.Description(),
7979
TagKeys: tagKeys,
80-
Aggregation: view.Count(),
80+
Aggregation: view.Sum(),
8181
}
8282

8383
countTimeoutTriggerSendView := &view.View{
8484
Name: statTimeoutTriggerSend.Name(),
8585
Measure: statTimeoutTriggerSend,
8686
Description: statTimeoutTriggerSend.Description(),
8787
TagKeys: tagKeys,
88-
Aggregation: view.Count(),
88+
Aggregation: view.Sum(),
8989
}
9090

9191
countBatchOnDeadNode := &view.View{
9292
Name: statBatchOnDeadNode.Name(),
9393
Measure: statBatchOnDeadNode,
9494
Description: statBatchOnDeadNode.Description(),
9595
TagKeys: tagKeys,
96-
Aggregation: view.Count(),
96+
Aggregation: view.Sum(),
9797
}
9898

9999
return []*view.View{

internal/collector/processor/queued/queued_processor.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,6 @@ func (sp *queuedSpanProcessor) Stop() {
112112

113113
// ProcessSpans implements the SpanProcessor interface
114114
func (sp *queuedSpanProcessor) ProcessSpans(td data.TraceData, spanFormat string) error {
115-
return sp.enqueueSpanBatch(td, spanFormat)
116-
}
117-
118-
func (sp *queuedSpanProcessor) enqueueSpanBatch(td data.TraceData, spanFormat string) error {
119115
item := &queueItem{
120116
queuedTime: time.Now(),
121117
td: td,
@@ -232,14 +228,14 @@ func MetricViews(level telemetry.Level) []*view.View {
232228
Measure: statSuccessSendOps,
233229
Description: "The number of successful send operations performed by queued exporter",
234230
TagKeys: tagKeys,
235-
Aggregation: view.Count(),
231+
Aggregation: view.Sum(),
236232
}
237233
countFailuresSendView := &view.View{
238234
Name: statFailedSendOps.Name(),
239235
Measure: statFailedSendOps,
240236
Description: "The number of failed send operations performed by queued exporter",
241237
TagKeys: tagKeys,
242-
Aggregation: view.Count(),
238+
Aggregation: view.Sum(),
243239
}
244240

245241
latencyDistributionAggregation := view.Distribution(10, 25, 50, 75, 100, 250, 500, 750, 1000, 2000, 3000, 4000, 5000, 10000, 20000, 30000, 50000)

internal/collector/telemetry/process_telemetry.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var viewTotalAllocMem = &view.View{
3131
Name: mRuntimeTotalAllocMem.Name(),
3232
Description: mRuntimeTotalAllocMem.Description(),
3333
Measure: mRuntimeTotalAllocMem,
34-
Aggregation: view.Count(),
34+
Aggregation: view.LastValue(),
3535
TagKeys: nil,
3636
}
3737

@@ -49,7 +49,7 @@ var viewCPUSeconds = &view.View{
4949
Name: mCPUSeconds.Name(),
5050
Description: mCPUSeconds.Description(),
5151
Measure: mCPUSeconds,
52-
Aggregation: view.Count(),
52+
Aggregation: view.LastValue(),
5353
TagKeys: nil,
5454
}
5555

0 commit comments

Comments
 (0)