Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Leong <[email protected]>
  • Loading branch information
adleong committed Mar 26, 2021
1 parent c65e367 commit 905d8e2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# tapshark
# tapshark

A wireshark inspired ncurses-style command line interface for Linkerd tap.

## Requirements

Requires [Linkerd 2.10.0](https://github.com/linkerd/linkerd2/releases/tag/stable-2.10.0)
with the [Viz extension](https://linkerd.io/2.10/getting-started/) installed.

## Building

1. Build linkerd-tapshark: `go build -o linkerd-tapshark ./main.go`
1. Move the binary onto your PATH: `mv linkerd-tapshark ~/.linkerd2/bin/`

## Usage

```
linkerd tapshark
```

Tapshark accepts the same flags as [linkerd tap](https://linkerd.io/2.10/reference/cli/viz/index.html#tap).

Use the arrow keys the browse requests. Press enter to see details for the
selected request. Press tab to switch focus between the top and bottom pane.
Ctrl-c to exit.
6 changes: 3 additions & 3 deletions cmd/tapshark.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ func NewCmdTapShark() *cobra.Command {
* statefulsets
* services (only supported as a --to resource)`,
Example: ` # tap the web deployment in the default namespace
linkerd viz tapshark deploy/web
linkerd tapshark deploy/web
# tap the web-dlbvj pod in the default namespace
linkerd viz tapshark pod/web-dlbvj
linkerd tapshark pod/web-dlbvj
# tap the test namespace, filter by request to prod namespace
linkerd viz tapshark ns/test --to ns/prod`,
linkerd tapshark ns/test --to ns/prod`,
Args: cobra.RangeArgs(1, 2),
ValidArgs: vizpkg.ValidTargets,
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
2 changes: 2 additions & 0 deletions pkg/tap.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
log "github.com/sirupsen/logrus"
)

// Event collation logic copied from https://github.com/linkerd/linkerd2/blob/main/viz/cmd/top.go

type (
Stream struct {
Event *tapPb.TapEvent
Expand Down

0 comments on commit 905d8e2

Please sign in to comment.