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

feat: improve handlers tracing code #5442

Merged
merged 4 commits into from
Nov 23, 2022

Conversation

eddycharly
Copy link
Member

Explanation

This PR improves handlers tracing code:

  • adds a bunch of attributes
  • makes easier to use and build complex admission chains

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
Comment on lines +30 to +35
// ResourceNameKey = attribute.Key("admission.resource.name")
// ResourceNamespaceKey = attribute.Key("admission.resource.namespace")
// ResourceGroupKey = attribute.Key("admission.resource.group")
// ResourceVersionKey = attribute.Key("admission.resource.version")
// ResourceKindKey = attribute.Key("admission.resource.kind")
// ResourceUidKey = attribute.Key("admission.resource.uid")
Copy link
Member

Choose a reason for hiding this comment

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

Are these needed?

@realshuting realshuting self-assigned this Nov 23, 2022
@realshuting realshuting enabled auto-merge (squash) November 23, 2022 06:21
@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #5442 (593d3de) into main (900002f) will increase coverage by 0.02%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #5442      +/-   ##
==========================================
+ Coverage   36.41%   36.44%   +0.02%     
==========================================
  Files         171      172       +1     
  Lines       19086    19075      -11     
==========================================
  Hits         6951     6951              
+ Misses      11337    11326      -11     
  Partials      798      798              
Impacted Files Coverage Δ
pkg/webhooks/handlers/admission.go 0.00% <0.00%> (ø)
pkg/webhooks/handlers/dump.go 50.81% <0.00%> (+3.84%) ⬆️
pkg/webhooks/handlers/filter.go 0.00% <0.00%> (ø)
pkg/webhooks/handlers/metrics.go 0.00% <0.00%> (ø)
pkg/webhooks/handlers/protect.go 0.00% <0.00%> (ø)
pkg/webhooks/handlers/trace.go 0.00% <0.00%> (ø)
pkg/webhooks/handlers/types.go 0.00% <0.00%> (ø)
pkg/webhooks/handlers/utils.go 0.00% <0.00%> (ø)
pkg/webhooks/handlers/verify.go 0.00% <0.00%> (ø)
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@realshuting realshuting merged commit f4c2f24 into kyverno:main Nov 23, 2022
@eddycharly eddycharly deleted the handlers-trace branch November 23, 2022 06:56
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.

None yet

3 participants