Skip to content

Commit

Permalink
feat(meshmetric): restore old flow
Browse files Browse the repository at this point in the history
Signed-off-by: slonka <[email protected]>
  • Loading branch information
slonka committed Apr 2, 2024
1 parent d2e2e03 commit 4f0950d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/kuma-dp/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ func getApplicationsToScrape(kumaSidecarConfiguration *types.KumaSidecarConfigur
IsIPv6: false,
QueryModifier: metrics.AddPrometheusFormat,
Mutator: metrics.AggregatedMetricsMutator(metrics.MergeClustersForPrometheus),
MeshMetricMutator: metrics.AggregatedOtelMutator(metrics.MergeClustersForOpenTelemetry),
MeshMetricMutator: metrics.AggregatedOtelMutator(),
})
return applicationsToScrape
}
Expand Down
2 changes: 1 addition & 1 deletion app/kuma-dp/pkg/dataplane/meshmetrics/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (cf *ConfigFetcher) mapApplicationToApplicationToScrape(applications []xds.
Port: cf.envoyAdminPort,
IsIPv6: false,
QueryModifier: metrics.AggregatedQueryParametersModifier(metrics.AddPrometheusFormat, metrics.AddSidecarParameters(sidecar)),
MeshMetricMutator: metrics.AggregatedOtelMutator(metrics.ProfileMutatorGenerator(sidecar), metrics.MergeClustersForOpenTelemetry),
MeshMetricMutator: metrics.AggregatedOtelMutator(metrics.ProfileMutatorGenerator(sidecar)),
})

return applicationsToScrape
Expand Down
17 changes: 0 additions & 17 deletions app/kuma-dp/pkg/dataplane/metrics/merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,6 @@ func MergeClustersForPrometheus(in map[string]*io_prometheus_client.MetricFamily
return nil
}

func MergeClustersForOpenTelemetry(metricFamilies map[string]*io_prometheus_client.MetricFamily) error {
for _, metricFamily := range metricFamilies {
switch {
case isClusterMetricFamily(metricFamily):
if err := handleClusterMetric(metricFamily); err != nil {
return err
}
case isHttpMetricFamily(metricFamily):
if err := handleHttpMetricFamily(metricFamily); err != nil {
return err
}
}
}

return nil
}

func handleClusterMetric(metricFamily *io_prometheus_client.MetricFamily) error {
// metricsByClusterNames returns the data in the following format:
// 'cluster_name' ->
Expand Down

0 comments on commit 4f0950d

Please sign in to comment.