Skip to content

NETOBSERV-2359 Implement metrics display#333

Merged
openshift-merge-bot[bot] merged 11 commits intonetobserv:mainfrom
jpinsonneau:graphs
Sep 26, 2025
Merged

NETOBSERV-2359 Implement metrics display#333
openshift-merge-bot[bot] merged 11 commits intonetobserv:mainfrom
jpinsonneau:graphs

Conversation

@jpinsonneau
Copy link
Member

@jpinsonneau jpinsonneau commented Jul 11, 2025

Description

  • Query prometheus metrics from collector pod
  • Display metrics graphs
  • Show legends on focus
  • allow time range selection
Screencast.From.2025-07-11.12-20-44.mp4

Dependencies

Based on #215

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@jpinsonneau jpinsonneau changed the title Implement metrics display NETOBSERV-2359 Implement metrics display Aug 1, 2025
@jpinsonneau jpinsonneau marked this pull request as draft August 5, 2025 12:20
@jpinsonneau
Copy link
Member Author

Rebased without changes

@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 0.29155% with 684 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.67%. Comparing base (1e7cfe6) to head (a105511).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/metric_display.go 0.00% 311 Missing ⚠️
cmd/display.go 0.00% 121 Missing ⚠️
cmd/prom.go 0.00% 90 Missing ⚠️
cmd/metric_capture.go 0.00% 70 Missing ⚠️
cmd/mocks.go 0.00% 49 Missing ⚠️
cmd/root.go 0.00% 17 Missing ⚠️
cmd/flow_display.go 6.25% 15 Missing ⚠️
cmd/map_format.go 12.50% 7 Missing ⚠️
cmd/flow_capture.go 0.00% 2 Missing ⚠️
cmd/packet_capture.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #333      +/-   ##
==========================================
- Coverage   17.14%   13.67%   -3.47%     
==========================================
  Files          15       18       +3     
  Lines        2141     2684     +543     
==========================================
  Hits          367      367              
- Misses       1748     2291     +543     
  Partials       26       26              
Flag Coverage Δ
unittests 13.67% <0.29%> (-3.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cmd/options.go 25.00% <ø> (ø)
cmd/flow_capture.go 6.86% <0.00%> (+0.06%) ⬆️
cmd/packet_capture.go 0.00% <0.00%> (ø)
cmd/map_format.go 27.53% <12.50%> (-0.41%) ⬇️
cmd/flow_display.go 23.62% <6.25%> (+3.52%) ⬆️
cmd/root.go 23.21% <0.00%> (-3.32%) ⬇️
cmd/mocks.go 0.00% <0.00%> (ø)
cmd/metric_capture.go 0.00% <0.00%> (ø)
cmd/prom.go 0.00% <0.00%> (ø)
cmd/display.go 0.00% <0.00%> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpinsonneau jpinsonneau force-pushed the graphs branch 2 times, most recently from c5065c6 to 26adbd4 Compare August 26, 2025 08:21
@jpinsonneau jpinsonneau marked this pull request as ready for review August 26, 2025 08:22
@github-actions
Copy link

New image:
quay.io/netobserv/network-observability-cli:47509a7

It will expire after two weeks.

To use this build, update your commands using:

USER=netobserv VERSION=47509a7 make commands

or download the updated commands.

Comment on lines +41 to +44
false,
"/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt",
"/var/run/secrets/kubernetes.io/serviceaccount/token",
"https://thanos-querier.openshift-monitoring.svc:9091/",
Copy link
Member Author

Choose a reason for hiding this comment

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

These resources are hardcoded for now. Let me know if you feel that should be configurable at some point

Copy link
Member

Choose a reason for hiding this comment

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

how do we handle this in Operator, are these hardcoded there as well?

Copy link
Member

Choose a reason for hiding this comment

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

@memodi no in the operator it's configurable

Copy link
Member

Choose a reason for hiding this comment

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

I guess it can start as hardcoded and we'll make configurable later if someone asks

@memodi
Copy link
Member

memodi commented Sep 2, 2025

/ok-to-test

@github-actions
Copy link

github-actions bot commented Sep 2, 2025

New image:
quay.io/netobserv/network-observability-cli:a28a705

It will expire after two weeks.

To use this build, update your commands using:

USER=netobserv VERSION=a28a705 make commands

or download the updated commands.

@memodi
Copy link
Member

memodi commented Sep 2, 2025

@jpinsonneau - the metrics display work fine, I wonder if we can add an option to disable metrics display on terminal and just use the existing behavior? Currently when exiting kills entire cli.

@memodi
Copy link
Member

memodi commented Sep 2, 2025

@jpinsonneau - the metrics display work fine, I wonder if we can add an option to disable metrics display on terminal and just use the existing behavior? Currently when exiting kills entire cli.

never mind, I see you can do that using background option.

@memodi
Copy link
Member

memodi commented Sep 2, 2025

/label qe-approved

@jpinsonneau
Copy link
Member Author

@jpinsonneau - the metrics display work fine, I wonder if we can add an option to disable metrics display on terminal and just use the existing behavior? Currently when exiting kills entire cli.

never mind, I see you can do that using background option.

Do you want me to clarify that in the help ?
The flows, packets and metrics features are now aligned on the usage but it feels strange when you are coming from previous versions 😆

@jpinsonneau
Copy link
Member Author

@memodi I think integrations tests are flaky here:

Expected
    <string>: genev_sys_6081
not to equal
    <string>: genev_sys_6081 failed [FAILED] Flow should not contain excluded interface genev_sys_6081, but found it in interfaces: [genev_sys_6081]

This error message says we captured a flow with genev_sys_6081 whereas the capture didn't even run: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/netobserv_network-observability-cli/333/pull-ci-netobserv-network-observability-cli-main-integration-tests/1968639165360771072/artifacts/integration-tests/netobserv-cli-tests/artifacts/20250918-124247-flowInterfacesOutput

That happens since getFlowsJSONFile is considering the latest run to be the right one and it's not the case here.

@leandroberetta
Copy link
Contributor

Hi @jpinsonneau, I tested the last commit, probably I have less artifacts but still having issues when going full screen:

Screencast.From.2025-09-22.09-08-06.mp4
Screencast.From.2025-09-22.09-07-02.mp4

Copy link
Member

@jotak jotak left a comment

Choose a reason for hiding this comment

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

/lgtm

@memodi
Copy link
Member

memodi commented Sep 22, 2025


This error message says we captured a flow with genev_sys_6081 whereas the capture didn't even run: https://gcsweb-ci.apps.ci.l2s4.p1.openshiftapps.com/gcs/test-platform-results/pr-logs/pull/netobserv_network-observability-cli/333/pull-ci-netobserv-network-observability-cli-main-integration-tests/1968639165360771072/artifacts/integration-tests/netobserv-cli-tests/artifacts/20250918-124247-flowInterfacesOutput

That happens since getFlowsJSONFile is considering the latest run to be the right one and it's not the case here

from the logs it looks it copy was skipped, need to look more as to why this happened despite it's running with --copy=true.

@memodi
Copy link
Member

memodi commented Sep 22, 2025

from the logs it looks it copy was skipped, need to look more as to why this happened despite it's running with --copy=true.

I ran tests locally from this PR and it passes fine, I wonder, some securityConstraints that were added in this PR to netobserv-cli NS https://github.com/netobserv/network-observability-cli/pull/374/files#diff-b76153cc13c8e1e4a3b15cfb6d3df444f17cc6160e0ae42e7688a10d2d0f98e5R103 could be causing this?

it's strange that it's consistently failing and prior to #374 being merged this test was passing.

/test integration-tests

@jpinsonneau
Copy link
Member Author

Rebased without changes

@jpinsonneau jpinsonneau removed the needs-changes To be added to denote PR needs changes or some questions/comments to be addressed label Sep 25, 2025
@jotak
Copy link
Member

jotak commented Sep 25, 2025

/lgtm

@memodi
Copy link
Member

memodi commented Sep 25, 2025

/label qe-approved

@openshift-ci
Copy link

openshift-ci bot commented Sep 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 5ba90b9 into netobserv:main Sep 26, 2025
13 checks passed
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.

5 participants