---
# Code generated by 'make generate-documentation'. DO NOT EDIT.
title: Gadget socket-collector
---

The socket-collector gadget gathers information about TCP and UDP sockets.

### Example CR

```yaml
apiVersion: gadget.kinvolk.io/v1alpha1
kind: Trace
metadata:
  name: socket-collector
  namespace: gadget
spec:
  node: my-node
  gadget: socket-collector
  filter:
    namespace: default
    podname: mypod
  runMode: Manual
  outputMode: Status
  parameters:
    proto: all # all, udp and tcp are allowed
```

### Operations


#### collect

Create a snapshot of the currently open TCP and UDP sockets. Once taken, the snapshot is not updated automatically. However one can call the collect operation again at any time to update the snapshot.

```bash
$ kubectl annotate -n gadget trace/socket-collector \
    gadget.kinvolk.io/operation=collect
```

### Output Modes

* Status
