Esc

Run inside the charm container

Skip Juju entirely and talk to a mounted Pebble socket directly, from a charm hook, a debug-hooks session, or against any socket path.

When borescope runs inside a Juju Kubernetes charm container, it doesn't need Juju at all. Juju mounts each workload's Pebble socket into the charm container at /charm/containers/<name>/pebble.socket, and borescope can talk to that socket directly with the real ops.pebble.Client API.

Auto-detect with --here

From a juju ssh <unit> session, a juju debug-hooks shell, or charm code, run:

$ borescope --here

borescope scans /charm/containers/ for mounted Pebble sockets. If the charm declares exactly one workload container, it connects to that one. No unit reference, no model, no Juju round-trip.

Several containers

If the charm has more than one workload container, --here can't guess which you mean, so name it:

$ borescope --here --container=workload

If you omit --container with multiple containers present, borescope lists the available names and asks you to choose one.

Point at a socket

To talk to a Pebble over a specific Unix socket (a workload socket at a non-standard path, or a local Pebble you're running yourself), pass --socket:

$ borescope --socket /charm/containers/workload/pebble.socket
$ borescope --socket /var/run/pebble.socket

With --socket, borescope skips Juju discovery entirely and connects straight to that socket via the HTTP API. You can still pass a unit reference for labelling (it's used for the history key and the prompt), but it isn't required.

When to use which

You are… Use
On your workstation, debugging a remote unit borescope myapp/0 (the default)
Inside the charm container already borescope --here
Inside, with multiple workloads borescope --here --container=<name>
Pointing at a specific or local socket borescope --socket <path>

--here and --socket both use the direct socket transport, which is faster than going through juju ssh and works without any Juju access, but only from somewhere that can see the socket. From your workstation, use a unit reference instead. See How it reaches Pebble for how the two transports differ.