Skip to content

Add functionality to trace API calls #455

Open
@gandro

Description

@gandro

To aid in debugging (but also learnability regarding the Hubble API), it would be nice to have a flag/mode for the CLI to track the API calls emitted by the CLI in a given run.

Example of a similar feature from kubectl:

$ kubectl --v=8 get pods -n kube-system
I1210 16:43:37.292636    9562 loader.go:379] Config loaded from file:  /home/vagrant/.kube/config
I1210 16:43:37.310335    9562 round_trippers.go:422] GET https://192.168.33.11:6443/api/v1/namespaces/kube-system/pods?limit=500
I1210 16:43:37.310379    9562 round_trippers.go:429] Request Headers:
I1210 16:43:37.310385    9562 round_trippers.go:433]     Accept: application/json;as=Table;v=v1;g=meta.k8s.io,application/json;as=Table;v=v1beta1;g=meta.k8s.io,application/json
I1210 16:43:37.310390    9562 round_trippers.go:433]     User-Agent: kubectl/v1.20.0 (linux/amd64) kubernetes/3321f00
I1210 16:43:37.345064    9562 round_trippers.go:448] Response Status: 200 OK in 34 milliseconds
I1210 16:43:37.345093    9562 round_trippers.go:451] Response Headers:
I1210 16:43:37.345102    9562 round_trippers.go:454]     Cache-Control: no-cache, private
I1210 16:43:37.345259    9562 round_trippers.go:454]     Content-Type: application/json
I1210 16:43:37.345635    9562 round_trippers.go:454]     X-Kubernetes-Pf-Flowschema-Uid: fba42907-d6e4-4b79-b35a-5964a353086d
I1210 16:43:37.346165    9562 round_trippers.go:454]     X-Kubernetes-Pf-Prioritylevel-Uid: a4104551-f5eb-4385-b6e5-696678b32669
I1210 16:43:37.346185    9562 round_trippers.go:454]     Date: Thu, 10 Dec 2020 16:43:37 GMT
I1210 16:43:37.353313    9562 request.go:1107] Response Body: {"kind":"Table","apiVersion":"meta.k8s.io/v1","metadata":{"resourceVersion":"110001"},"columnDefinitions":[{"name":"Name","type":"string","format":"name","description":"Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names","priority":0},{"name":"Ready","type":"string","format":"","description":"The aggregate readiness state of this pod for accepting traffic.","priority":0},{"name":"Status","type":"string","format":"","description":"The aggregate status of the containers in this pod.","priority":0},{"name":"Restarts","type":"integer","format":"","description":"The number of times the containers in this pod have been restarted.","priority":0},{"name":"Age","type":"string","format":"","description":"CreationTimestamp is [truncated 5536 chars]
NAME                       READY   STATUS    RESTARTS   AGE
coredns-6954c77b9b-gjdmp   1/1     Running   0          25h

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/enhancementThis would improve or streamline existing functionality.⌨️ area/cliImpacts the command line interface of any command in the repository.🙏 help-wantedPlease volunteer for this by adding yourself as an assignee!

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions