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

Add NetworkPolicy metrics API and controlplane stats API #1221

Merged
merged 1 commit into from
Sep 23, 2020

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Sep 9, 2020

This PR introduces a control-plane API NodeStatsSummary for stats
collection and a public metrics API group including the following APIs:

  • NetworkPolicyMetrics
  • AntreaClusterNetworkPolicyMetrics
  • AntreaNetworkPolicyMetrics

For #985

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

@codecov-commenter
Copy link

codecov-commenter commented Sep 9, 2020

Codecov Report

Merging #1221 into master will decrease coverage by 0.03%.
The diff coverage is 53.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1221      +/-   ##
==========================================
- Coverage   55.04%   55.01%   -0.04%     
==========================================
  Files         110      113       +3     
  Lines       10597    10625      +28     
==========================================
+ Hits         5833     5845      +12     
- Misses       4190     4205      +15     
- Partials      574      575       +1     
Flag Coverage Δ
#integration-tests 44.90% <53.57%> (+<0.01%) ⬆️
#unit-tests 41.89% <ø> (-0.02%) ⬇️

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

Impacted Files Coverage Δ
pkg/apis/metrics/register.go 0.00% <0.00%> (ø)
...ntroller/networkpolicy/networkpolicy_controller.go 72.41% <ø> (+0.13%) ⬆️
pkg/apis/controlplane/v1alpha1/register.go 83.33% <83.33%> (ø)
pkg/apis/metrics/v1alpha1/register.go 90.90% <90.90%> (ø)
pkg/apiserver/storage/ram/watch.go 84.61% <0.00%> (-3.85%) ⬇️
pkg/ovs/openflow/ofctrl_bridge.go 67.98% <0.00%> (-0.80%) ⬇️

@tnqn
Copy link
Member Author

tnqn commented Sep 9, 2020

/test-all

@tnqn tnqn mentioned this pull request Sep 9, 2020
3 tasks
@tnqn tnqn force-pushed the policy-metrics-api branch 6 times, most recently from 74c253f to e1003bc Compare September 11, 2020 13:20
@tnqn tnqn changed the title Add NetworkPolicy Metrics API Add NetworkPolicy metrics API and controlplane stats API Sep 11, 2020
@tnqn tnqn added this to the Antrea v0.10.0 release milestone Sep 11, 2020
pkg/apis/controlplane/types.go Outdated Show resolved Hide resolved
pkg/apis/controlplane/types.go Show resolved Hide resolved
pkg/apis/controlplane/types.go Outdated Show resolved Hide resolved
pkg/apis/controlplane/types.go Outdated Show resolved Hide resolved
@tnqn tnqn force-pushed the policy-metrics-api branch 5 times, most recently from 4cea2fb to a19d7ce Compare September 16, 2020 16:58
@tnqn
Copy link
Member Author

tnqn commented Sep 16, 2020

@jianjuns @antoninbas Because of a conflict with #1258 in types.go and I need both changes to support NetworkPolicyMetrics, I rebased this on #1258, the real change in this PR is a19d7ce.

@tnqn tnqn force-pushed the policy-metrics-api branch 4 times, most recently from d5c16f4 to d0aab61 Compare September 17, 2020 09:37
@tnqn tnqn added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API. label Sep 18, 2020
jianjuns
jianjuns previously approved these changes Sep 18, 2020
This PR introduces a control-plane API NodeStatsSummary for stats
collection and a public metrics API group including the following APIs:
- NetworkPolicyMetrics
- AntreaClusterNetworkPolicyMetrics
- AntreaNetworkPolicyMetrics
@tnqn
Copy link
Member Author

tnqn commented Sep 22, 2020

Only rebased on master after #1258 was merged.

@tnqn
Copy link
Member Author

tnqn commented Sep 22, 2020

/test-all

@tnqn
Copy link
Member Author

tnqn commented Sep 22, 2020

/test-windows-networkpolicy

3 similar comments
@lzhecheng
Copy link
Contributor

/test-windows-networkpolicy

@tnqn
Copy link
Member Author

tnqn commented Sep 22, 2020

/test-windows-networkpolicy

@tnqn
Copy link
Member Author

tnqn commented Sep 22, 2020

/test-windows-networkpolicy

@tnqn tnqn merged commit 4e07577 into antrea-io:master Sep 23, 2020
@ceclinux
Copy link
Contributor

ceclinux commented Mar 15, 2022

Could you explain why pkg/apis/metrics/types.go is needed and get installed in pkg/apis/metrics/install/install.go? I think these are redundant. @tnqn

@tnqn
Copy link
Member Author

tnqn commented Mar 18, 2022

Could you explain why pkg/apis/metrics/types.go is needed and get installed in pkg/apis/metrics/install/install.go? I think these are redundant. @tnqn

@ceclinux please take a look at https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api_changes.md which explains why an internal version is required. Actually it's not a must right now but will be needed once we have another API version.

@tnqn tnqn deleted the policy-metrics-api branch March 18, 2022 15:00
@ceclinux
Copy link
Contributor

Could you explain why pkg/apis/metrics/types.go is needed and get installed in pkg/apis/metrics/install/install.go? I think these are redundant. @tnqn

@ceclinux please take a look at https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api_changes.md which explains why an internal version is required. Actually it's not a must right now but will be needed once we have another API version.

Thanks for your reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants