After updating the new version of Lens, the cluster metric displacement disappeared

After updating the new version of Lens, the cluster metric displacement disappeared.
Metrics not available at the moment.
Describe the bug
After updating the new version, the cluster metric display was missing.

To Reproduce
Steps to reproduce the behavior:

  1. Go to update Lens in application.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
image

Environment (please complete the following information):

  • Lens Version: Lens: 2023.3.21022-latest Extension API: 6.4.0
  • OS: macOS 13.2.1 (22D68)

The prometheus-server is installed in a cluster. I tried to ask it with my hands in the settings, the result is the same. Metrics are displayed in grafana. When connected to prometheus, data is also visible. A colleague on the old version of Lens has no problem.

I compiled version 6.2.6 all metrics are displayed.

Would you be able to provide logs please? See How can I see more verbose logs? - #3 by revans

[log(https://docs.google.com/document/d/1xLXPQ2qSJrldbLQashvyl0Rgn7yFKXSgapMIVcQw9AQ/edit?usp=share_link)

Thanks for the logs. But they don’t contain enough information.

If you run Lens from the command line you should see logs prefixed with METRICS-ROUTE. Can you please share those?

unfortunately I don’t see this data in the logs

Are you using the Operator Prometheus provider?

I have the same problem and I see the METRICS-ROUTE logs, here is what the logs say

warn: [METRICS-ROUTE]: failed to get metrics for clusterId=113d51914b5b4e0a5b1409e1886dab30: Metrics not available {“stack”:“Error: Metrics not available\n at loadMetricHelper (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:44783:31)\n at process.processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async Promise.all (index 14)\n at async /Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:44827:36\n at async Object.route (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:43672:32)\n at async Router.route (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:43903:9)\n at async LensProxy.handleRequest (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:41416:9)”}

@asasas234 Thanks for the reply. Would you be able to run Lens from the command line and post the same log line. The formatter we are currently using for writing logs to disk throws away error causes (this is a bug).

warn: [METRICS-ROUTE]: failed to get metrics for clusterId=018ced145db0f43b48fd0e29ba1221d0: No Prometheus service found {“stack”:“Error: No Prometheus service found\n at ContextHandler.getPrometheusService (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:35750:15)\n at process.processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async ContextHandler.getPrometheusDetails (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:35702:25)\n at async /Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:44807:54\n at async Object.route (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:43672:32)\n at async Router.route (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:43903:9)\n at async LensProxy.handleRequest (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js:41416:9)”}

I’m getting this exact same error in my logs and it used to work with an earlier Lens. What do I need to do to resolve this?

I started lens via command line and here’s the full stack:
warn: ┏ [METRICS-ROUTE]: failed to get metrics for clusterId=4566a1b686e61baa0d4f4fd5a4a14c68: Metrics not available +112ms
warn: ┃ [ 1] Error: Metrics not available
warn: ┃ [ 2] at loadMetricHelper (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@lensapp/core-main/dist/index.js:11805:19)
warn: ┃ [ 3] at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
warn: ┃ [ 4] at async Promise.all (index 0)
warn: ┃ [ 5] at async /Applications/Lens.app/Contents/Resources/app.asar/node_modules/@lensapp/core-main/dist/index.js:11848:28
warn: ┃ [ 6] at async Object.route (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@lensapp/core-main/dist/index.js:3577:31)
warn: ┃ [ 7] at async Router.route (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@lensapp/core-main/dist/index.js:3411:5)
warn: ┃ [ 8] at async LensProxy.handleRequest (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@lensapp/core-main/dist/index.js:3378:7)
warn: ┃ [ 9] Cause:
warn: ┃ [10] ‘d: request to https://127.0.0.1:50898/4566a1b686e61baa0d4f4fd5a4a14c68/api/v1/namespaces/monitoring/services/kube-prometheus-stack-prometheus:9090/proxy/api/v1/query_range failed, reason: socket hang up\n’ +
warn: ┃ [11] ’ at ClientRequest. (/Applications/Lens.app/Contents/Resources/app.asar/node_modules/@lensapp/node-fetch/dist/index.cjs:2:82006)\n’ +
warn: ┃ [12] ’ at ClientRequest.emit (node:events:525:35)\n’ +
warn: ┃ [13] ’ at ClientRequest.emit (node:domain:489:12)\n’ +
warn: ┃ [14] ’ at TLSSocket.socketOnEnd (node:_http_client:526:9)\n’ +
warn: ┃ [15] ’ at TLSSocket.emit (node:events:525:35)\n’ +
warn: ┃ [16] ’ at TLSSocket.emit (node:domain:489:12)\n’ +
warn: ┃ [17] ’ at endReadableNT (node:internal/streams/readable:1359:12)\n’ +
warn: ┗ [18] ’ at process.processTicksAndRejections (node:internal/process/task_queues:82:21)’