Skip to content
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

Fix grafana component to add and remove connections. #13199

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shanukun
Copy link
Contributor

@shanukun shanukun commented Jan 9, 2025

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Copy link

github-actions bot commented Jan 9, 2025

@shanukun shanukun temporarily deployed to staging-playground January 9, 2025 17:42 — with GitHub Actions Inactive
Copy link

github-actions bot commented Jan 9, 2025

END-TO-END TESTS

  • Testing started at: January 9th 2025, 5:48:26 pm

📦 Test Result Summary

  • ✅ 29 passed
  • ❌ 2 failed
  • ⚠️ 9 flaked
  • ⏩ 0 skipped

Duration: 7 minutes and 29 seconds

Overall Result: 👎 Some tests failed.

[Show/Hide] Test Result Details
Test Browser Test Case Tags Result
1 chromium-meshery-provider Compare test of a performance profile with load generator "fortio" and service mesh "None" unstable ⚠️
2 chromium-meshery-provider Delete a performance profile with load generator "fortio" and service mesh "None" unstable ⚠️
3 chromium-local-provider Add a cluster connection by uploading kubeconfig file unstable ⚠️
4 chromium-local-provider Transition to disconnected state and then back to connected state unstable ⚠️
5 chromium-local-provider Transition to ignored state and then back to connected state unstable ⚠️
6 chromium-local-provider Transition to not found state and then back to connected state unstable ⚠️
7 chromium-local-provider Delete Kubernetes cluster connections unstable ⚠️
8 chromium-local-provider View detailed result of a performance profile (Graph Visualiser) with load generator "fortio" and service mesh "None" unstable ⚠️
9 chromium-local-provider Edit the configuration of a performance profile with load generator "fortio" and service mesh "None" unstable ⚠️
10 chromium-local-provider Compare test of a performance profile with load generator "fortio" and service mesh "None" unstable ⚠️
11 chromium-local-provider Delete a performance profile with load generator "fortio" and service mesh "None" unstable ⚠️
12 chromium-local-provider Aggregation Charts are displayed
13 chromium-local-provider Connect to Meshery Istio Adapter and configure it
14 chromium-local-provider Toggle "Send Anonymous Usage Statistics" unstable ⚠️
15 chromium-local-provider Toggle "Send Anonymous Performance Results" unstable ⚠️

Copy link
Contributor

@winkletinkle winkletinkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shanukun, thanks... let's give this a shot...

@leecalcote
Copy link
Member

I don't know why this would fail.

        platform_test.go:27: could not find path: install/deployment_yamls/k8s in the manifest tree

return nil, http.StatusInternalServerError, ErrUnmarshal(err, "connection")
}
return &conn, resp.StatusCode, nil
return connectionPage.Connections[0], resp.StatusCode, nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shanukun ideally, we don't use numeric indexing, unless there's only ever one element in the array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in the method for finding a connection by ID, and should not yield more than one connection. We can additionally check to ensure that there is at least one connection in the list.

Copy link
Member

@sudhanshutech sudhanshutech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shanukun have you tried using a active grafana connection?
Are you able to successfully transition the status of connection and able to view any charts?

};

if (typeof data?.credential_id !== 'undefined') {
getCredentialByID(data?.credential_id).then((res) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shanukun this seems a concern here. Can you verify that?
The ui currently expecting to get the details of api key from the secret value of credentials api but currently we don't have that way to add that secret so you would probably get this value as undefined.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users are to supply the API key, if their Grafana needs it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When creating a new connection, users provide the API key. However, if a connection has already been established, the only option to acquire the API key is to use the getCredentialByID function. The credential_id may be obtained from a grafana config request (/api/telemetry/metrics/grafana/config).

However, after looking into the Board Search textfield and handleChange closely, I think this function needs to be called right after retrieving the connection config.

Copy link
Member

@leecalcote leecalcote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shanukun, will you confirm that which Connection Definition (from which Model) is being used here?

@shanukun
Copy link
Contributor Author

@shanukun have you tried using a active grafana connection? Are you able to successfully transition the status of connection and able to view any charts?

I’m using a local grafana server. I’m able to transition the status.

The Board Search textfield, GrafanaCustomChart component, Add Panel action to some extent, and the endpoint for saving selected boards is still broken, so even if I can see the panels, the charts shouldn't appear yet. I'm working on this, but I'm not sure if I should create a separate PR for these changes.

@shanukun
Copy link
Contributor Author

@shanukun, will you confirm that which Connection Definition (from which Model) is being used here?

The one in connections/connections.go.

@vishalvivekm
Copy link
Contributor

@shanukun
Thank you for your contributions! Let's discuss this today, during Meshery Development call at 9:00 AM CT | 8:30 PM IST. Adding it as an agenda item to the meeting minutes || meeting link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to add Grafana endpoint in Settings > Metrics
5 participants