Commit Graph

37 Commits

Author SHA1 Message Date
Lukasz Szaszkiewicz 36e57697d1 apiserver/handlers/watch: encode initialEventsListBlueprint with watchEncoder (#127587)
* apiserver/handlers/get: construct versionedList

* storage/cacher: document caching the serialization of bookmark events

* endpoints/handlers/response: add watchListTransformer

* endpoints/handlers/watch: wire watchListTransformer

Kubernetes-commit: fbf1a0dc181ccbeb9925ad9c284d913a25c16562
2024-10-01 11:55:50 +00:00
CasperLiu 1bb7b2e6ab introduce a proper trace context
Signed-off-by: carlory <baofa.fan@daocloud.io>
Co-authored-by: CasperLiu <qiuyuzhe521@gmail.com>

Kubernetes-commit: 5b2632f70763aeadfc334df1364946fe39fc10bb
2024-04-07 17:58:59 +08:00
Lukasz Szaszkiewicz 8cb411e993 adds watchListEndpointRestrictions for watchlist requests (#126996)
* endpoints/handlers/get: intro watchListEndpointRestrictions

* consistencydetector/list_data_consistency_detector: expose IsDataConsistencyDetectionForListEnabled

* e2e/watchlist: extract common function for adding unstructured secrets

* e2e/watchlist: new e2e scenarios for convering watchListEndpointRestrict

Kubernetes-commit: ae35048cb0b9b177891aab41346b6d6cc504582f
2024-09-25 12:48:33 +00:00
Eric Lin 5d14d72b5c Fix httplog not logging watch duration in separate goroutines
Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: 06c7058115e623126884d05c54a30db511a9cb71
2024-06-21 10:03:31 +00:00
Eric Lin 000601bdbe Add handler to run watch serving in separate goroutine
This handler allows running execution prior to actual serving in a separate
goroutine when serving requests. Doing so benefits cases in serving long running
requests because it allows freeing memory used by the separate goroutine
and keeps the serving routines slim.

Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: 7b2698a5e5c61b303481c2006847409fc8704746
2023-10-10 08:53:26 +00:00
Eric Lin a2e6b85db4 handlers/watch: refactor watch serving to prepare offloading
Signed-off-by: Eric Lin <exlin@google.com>

Kubernetes-commit: 87d817e62d8c6e93cf45bf90a7ecadfe4156ab1f
2023-11-27 10:06:50 +00:00
Lukasz Szaszkiewicz cd87b8f62d handlers/watch: calculate and record WatchList latency metric.
Kubernetes-commit: 772b1f4cd84a738f632716e28d4067c00f0b7f13
2023-09-19 03:05:00 +02:00
Lukasz Szaszkiewicz c190575821 Add SetListOptionsDefaults for setting defaults on ListOptions
Kubernetes-commit: 52d613efde52437a64a1d4438f28e50d59c1596e
2023-01-31 14:07:30 +01:00
Lukasz Szaszkiewicz c0f50f11ef Update calls to ValidateListOptions
Kubernetes-commit: 4b3e0a39e5c1850363328682b8208be400f3b4a3
2023-01-30 14:10:10 +01:00
David Ashpole aa161f2fc0 migrate apiserver utiltrace usage to component-base/tracing
Kubernetes-commit: de26b9023f2872c5cd7e15fad5dd5ab649222c13
2022-10-20 18:15:38 +00:00
Abu Kashem 8949a1cdfc add trace step for transformResponseObject
Kubernetes-commit: 41cef06f66dd4d7e87ff852dc228ab69587be9de
2021-11-22 13:18:02 -05:00
David Eads 67507290ad finish removal of exportoptions
Kubernetes-commit: 37cc89ed8d5194f288bc9f9633e6142647631a07
2021-01-22 09:21:56 -05:00
lala123912 36a172d35e Code optimization for add additional information to log trace in api server
Kubernetes-commit: 5d61e18a4343773105e39c36b944b4f223e70eaf
2020-11-23 16:27:05 +08:00
Joe Betz 97937c66f2 Revert nested trace PR#88936
Kubernetes-commit: 02cf58102a61b6d1e021e256381ff750573ce55d
2020-07-20 09:55:05 -07:00
Joe Betz 7a467399ac Enable nested tracing, add request filter chain tracing incl. authn/authz tracing
Kubernetes-commit: b12ac0abc64adb71d97fbde12f373b1424631f20
2020-03-06 16:11:21 -08:00
Joe Betz ee219411ed Add ResourceVersionMatch parameter to make Resource Version semantics consistent for list
Kubernetes-commit: e214f2408b59c745c199645547948a8ad2a87ac2
2020-05-29 10:44:26 -07:00
AkashSarda e0d29c69be Migrate API server logs to Structured logging framewrok
Kubernetes-commit: af60e7b34d59d635740880a03e7e2587ec9ba041
2020-06-17 21:06:35 +00:00
Davanum Srinivas 5879417a28 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
Jianfei Bai a5b9ca7482 feat(apiserver): add user-agent and remote info into trace log for endpoints handlers.
Kubernetes-commit: 91bddd13485082892be8e8e471e358be317c4e9b
2019-10-10 21:30:05 +08:00
wojtekt ba8f49cc73 Ensure conversions are registered for metainternalversion codecs
Kubernetes-commit: 54163527a69a8c868b87d301876559495220d1b0
2019-09-11 16:30:08 +02:00
Joe Betz f103fcda51 Replace string concatination with trace fields
Kubernetes-commit: 46a04d50af78e01d06a9879d62cc71fbe892076f
2019-08-02 23:47:24 -07:00
fansong.cfs 73057f16b6 add timeout suuport for watch
Kubernetes-commit: b304a1f96d85cd351a0e22a091e17064d5edb35e
2019-04-03 09:37:48 +08:00
Benjamin Elder 8ad12b3912 Revert "add timeout suuport for watch"
This reverts commit c676e234cc1036a2a1147f2eeef9c89468671330.

Kubernetes-commit: 30a56bab42ab14a3a2ee21f5581b02525d4fd110
2019-04-01 18:39:17 -07:00
fansong.cfs 4d2b8eee69 add timeout suuport for watch
Kubernetes-commit: c676e234cc1036a2a1147f2eeef9c89468671330
2019-03-30 20:07:41 +08:00
Clayton Coleman c8f7d5017d Make RequestScope be a pointer consistently for better memory use
RequestScope is a large struct and causes stack growth when we pass
it by value into multiple stack levels. Avoid the allocations for
this read only struct by passing a pointer.

Kubernetes-commit: 8fede0b18a81a6fb1acc1a48857f482857c25286
2019-03-25 23:33:48 -04:00
Clayton Coleman 8d7b330c4c Support Table and PartialObjectMetadata on watch
Clean up the code paths that lead to objects being transformed and output with negotiation.
Remove some duplicate code that was not consistent. Now, watch will respond correctly to
Table and PartialObjectMetadata requests. Add unit and integration tests.

When transforming responses to Tables, only the first watch event for a given type will
include the columns. Columns will not change unless the watch is restarted.

Add a volume attachment printer and tighten up table validation error cases.

Disable protobuf from table conversion because Tables don't have protobuf because they
use `interface{}`

Kubernetes-commit: 3230a0b4fd14a6166f8362d4732e199e8779c426
2018-11-28 23:50:12 -05:00
Andrew Kim 2b43930b32 replace k8s.io/apiserver/pkg/util/trace with k8s.io/utils/trace
Kubernetes-commit: 93b086f6eafc1e94214fc1d946a1917482751cf3
2019-01-24 11:50:30 -05:00
Clayton Coleman 065e089126 Ensure all response object modification happens in one place
Make setLink and setListLink the same, and make them happen in transformResponseObject.
Make those methods also responsible for ensuring an empty list. Then move outputMediaType
negotiation before all other calls in the specific methods, to ensure we fail fast.

Refactoring in preparation to support type conversion on watch.

Kubernetes-commit: 56a25d8c5f04ec5401b99c8eb29e980b1e8123d3
2018-11-28 21:32:51 -05:00
Dr. Stefan Schimanski b4ca200ede apiserver: add component label to request metrics
Kubernetes-commit: 7190b17e5a52a7c0673c2e8a30cbe95f2847a6df
2018-11-29 16:30:15 +01:00
Davanum Srinivas 2710b17b80 Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135

Kubernetes-commit: 954996e231074dc7429f7be1256a579bedd8344c
2018-11-09 13:49:10 -05:00
Walter Fender 4749d14e11 Added tracing for long running requests.
Added tracing for use cases where etcd is not the cause of long running
requests.
Fixed spelling.
Factored in Wojtek-t feedback.

Kubernetes-commit: 99ebe8747176a10c718d5e3276c64d8c507bfb3b
2018-10-12 17:36:36 -07:00
Jordan Liggitt 453662ac63 change field selector conversion registration to be strongly typed
Kubernetes-commit: f51ba20cddeb44be355a79718a8274c272efc1e4
2018-07-03 15:47:20 -04:00
Jordan Liggitt 1f9c7bdd99 Quiet verbose apiserver logs
Kubernetes-commit: 862f8567bb4b1d4e9f63330cf3a516af61ae7cc5
2018-06-11 22:32:46 -04:00
wojtekt 6d795842cd Requires single name for list and watch
Kubernetes-commit: f344c5c0621b3e187ade02a6858bccb2c2d641bd
2018-05-06 15:15:32 +02:00
Mike Danese cd0258b4d7 replace request.Context with context.Context
Kubernetes-commit: 54fd2aaefd11e12a3ecb6d1a1326f04cdc8ea1a3
2018-04-24 08:10:34 -07:00
Jordan Liggitt 25758bf0f8 Remove request context mapper
Kubernetes-commit: 8ea88a5092c767fc3141512db924fd0435f7670e
2018-04-18 11:12:15 -04:00
David Eads a0a5b2c568 split up large rest handling file
Kubernetes-commit: cd663d7ad00937cffa8a09e4761acb95d34c89a3
2017-10-18 16:04:33 -04:00