Skip to content

Commit

Permalink
Merge pull request #34 from cohalz/fix-aggregated-metrics
Browse files Browse the repository at this point in the history
Fix AggregatedMetrics not being posted to Mackerel
  • Loading branch information
fujiwara authored Jan 19, 2024
2 parents 9b1f795 + 17ddb50 commit 2403bf1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package maprobe
type Channels struct {
ServiceMetrics chan ServiceMetric
HostMetrics chan HostMetric
AggregatedMetrics chan ServiceMetric
OtelMetrics chan Metric
Destination *DestinationConfig
}
Expand All @@ -12,7 +11,6 @@ func NewChannels(dst *DestinationConfig) *Channels {
chs := Channels{
ServiceMetrics: make(chan ServiceMetric, PostMetricBufferLength*10),
HostMetrics: make(chan HostMetric, PostMetricBufferLength*10),
AggregatedMetrics: make(chan ServiceMetric, PostMetricBufferLength*10),
OtelMetrics: make(chan Metric, PostMetricBufferLength*10),
Destination: dst,
}
Expand All @@ -39,14 +37,13 @@ func (ch *Channels) SendHostMetric(m HostMetric) {

func (ch *Channels) SendAggregatedMetric(m ServiceMetric) {
if ch.Destination.Mackerel.Enabled {
ch.AggregatedMetrics <- m
ch.ServiceMetrics <- m
}
// TODO: Otel Aggregated Metrics
}

func (ch *Channels) Close() {
close(ch.ServiceMetrics)
close(ch.HostMetrics)
close(ch.AggregatedMetrics)
close(ch.OtelMetrics)
}

0 comments on commit 2403bf1

Please sign in to comment.