8000 fix graph node size metric · Issue #8430 · kiali/kiali · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix graph node size metric #8430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jmazzitelli opened this issue May 17, 2025 · 1 comment · Fixed by #8432
Closed

fix graph node size metric #8430

jmazzitelli opened this issue May 17, 2025 · 1 comment · Fixed by #8432
Assignees
Labels
bug Something isn't working

Comments

@jmazzitelli
Copy link
Collaborator
jmazzitelli commented May 17, 2025

The graph node size metric was changed to always be 0 for some reason: 667a887

Let's fix that. We need to set the number of nodes in the graph at these 2 points in the code (lines 40 and 76 here): https://github.com/kiali/kiali/blob/v2.9.0/graph/api/api.go#L40-L76

Instead of "0" we need the size of the graph (i.e. the number of nodes in the graph).

This is part of #8348

@jmazzitelli jmazzitelli added the bug Something isn't working label May 17, 2025
@jmazzitelli
Copy link
Collaborator Author

From @jshaughn:

It's a little bit of a pain because at the point of the metric setting we have an anonymous type. But since we really only have one config vendor [mazz: now that Cytoscape is gone, I assume we only have one now], this should always work:

	numNodes := 0
	if _, ok := graphConfig.(config_common.Config); ok {
		numNodes = len(graphConfig.(config_common.Config).Elements.Nodes)
	}
	internalmetrics.SetGraphNodes(o.GetGraphKind(), o.TelemetryOptions.GraphType, o.InjectServiceNodes, numNodes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

1 participant
0