diff --git a/metrics/opsramp.go b/metrics/opsramp.go index abc734cf3c..1e14c2b233 100644 --- a/metrics/opsramp.go +++ b/metrics/opsramp.go @@ -545,51 +545,6 @@ func (p *OpsRampMetrics) Populate() { p.RenewClient() } -func ConvertLabelsToMap(labels []prompb.Label) map[string]string { - labelMap := make(map[string]string) - for _, label := range labels { - labelMap[label.Name] = label.Value - } - return labelMap -} - -func (p *OpsRampMetrics) calculateTraceOperationError(metricFamilySlice []*io_prometheus_client.MetricFamily) { - var labelMap map[string]string - uniqueLabelsMap := make(map[string][]prompb.Label) - uniqueFailedMap := make(map[string]float64) - uniqueSpansMap := make(map[string]float64) - for _, metricFamily := range metricFamilySlice { - if !p.re.MatchString(metricFamily.GetName()) { - continue - } - if metricFamily.GetName() == "trace_operations_failed" { - for _, metric := range metricFamily.GetMetric() { - var labels []prompb.Label - for _, label := range metric.GetLabel() { - labels = append(labels, prompb.Label{ - Name: label.GetName(), - Value: label.GetValue(), - }) - } - key := "trace_operations_failed&" - labelSlice := metric.GetLabel() - sort.Slice(labelSlice, func(i, j int) bool { - return labelSlice[i].GetName()+labelSlice[i].GetValue() > labelSlice[j].GetName()+labelSlice[i].GetValue() - }) - for _, label := range labelSlice { - key += label.GetName() + label.GetValue() - } - uniqueFailedMap[key] = *metric.Counter.Value - uniqueLabelsMap[key] = labels - } - } - } - for key := range uniqueLabelsMap { - labelMap = ConvertLabelsToMap(uniqueLabelsMap[key]) - p.GaugeWithLabels("trace_operations_error", labelMap, uniqueFailedMap[key]/uniqueSpansMap[key]) - } -} - func (p *OpsRampMetrics) Push() (int, error) { metricsConfig := p.Config.GetMetricsConfig() @@ -634,8 +589,6 @@ func (p *OpsRampMetrics) Push() (int, error) { return -1, err } - p.calculateTraceOperationError(metricFamilySlice) - metricFamilySlice, err = p.promRegistry.Gather() if err != nil { return -1, err diff --git a/pkg/libtrace/transmission/transmission.go b/pkg/libtrace/transmission/transmission.go index ee13dcf41e..30f841e16f 100644 --- a/pkg/libtrace/transmission/transmission.go +++ b/pkg/libtrace/transmission/transmission.go @@ -307,6 +307,8 @@ func (h *TraceProxy) tryAdd(ev *Event) bool { h.musterLock.RLock() defer h.musterLock.RUnlock() + h.Logger.Debug().Logf("adding event to transmission; queue length %d", len(h.muster.Work)) + if h.BlockOnSend { h.muster.Work <- ev return true