> **Page index:** https://km.oslo.systems/llms.txt lists every page on this site, with a link to its Markdown version.

# `pup`

[`pup`](https://github.com/DataDog/pup){:target="_blank"} is Datadog's command-line tool. It queries logs, metrics, traces, and monitors from the terminal, and creates and updates monitors from JSON files. Install it if you work with Datadog from the terminal.

## Step 1: Install `pup`

```sh
brew install datadog-labs/pack/pup
```

## Step 2: Log in to the EU site

Start the login:

```sh
pup auth login --site datadoghq.eu --read-only
```

In the browser window that opens:

1. Log in with your Microsoft email.
1. Select the `Digitaliseringsetaten` organization if prompted.
1. Approve the requested scopes.

Digitaliseringsetaten's Datadog organization is on the EU site, `datadoghq.eu`. `pup` defaults to `datadoghq.com`, so the command passes the site.

`--read-only` lets `pup` read from Datadog without changing anything. To log in with both read and write scopes, run the command without `--read-only`.

## Step 3: Set the EU site for all other commands

Add the site to the `pup` configuration file:

```yaml title="~/.config/pup/config.yaml"
site: datadoghq.eu
```

Only `pup auth login` and `pup auth status` accept `--site`. Every other command, such as `pup monitors list`, reads the site from this file. Without it, they fall back to `datadoghq.com`, where your login does not exist.

## Step 4: Verify (optional)

Check that commands resolve to the EU site and find your login there:

```sh
pup auth status | jq -e '.site == "datadoghq.eu" and .authenticated'
```

The command prints `true` when the site is `datadoghq.eu` and `pup` is logged in there. Otherwise it prints `false` and exits with a nonzero code.
