Skip to main content

Enterprise Server 3.23 está disponível no momento como versão candidata a lançamento.

Skip to content

Monitoring your instance with GitHub Enterprise Monitor

Use GitHub Enterprise Monitor to collect and explore logs, metrics, and traces from your GitHub Enterprise Server instance.

Observação

Esse recurso está em prévia pública e está sujeito a alterações.

Download GitHub Enterprise Monitor

About GitHub Enterprise Monitor

GitHub Enterprise Monitor provides monitoring and observability for GitHub Enterprise Server. It supports standalone instances, high availability configurations, and clusters, and collects data from every node. The stack includes the following capabilities:

  • Log aggregation: Collect and analyze logs centrally.
  • Metrics access: Query OpenTelemetry or collectd metrics on the instance through an SSH tunnel.
  • Distributed tracing: Collect and analyze request flows and troubleshoot performance.
  • Unified dashboards: Visualize data from metrics and aggregated logs.
  • Sharing data with Suporte do GitHub: Export collected logs, metrics, and traces to an archive and upload it to Suporte do GitHub.
  • GitHub Copilot CLI skills: Query logs, metrics, and traces, manage the stack, and export data using natural language. Skills load automatically when you run copilot from the ghe-monitor directory.

How GitHub Enterprise Monitor works

GitHub Enterprise Monitor runs a local monitoring stack (Grafana, VictoriaLogs, VictoriaMetrics, and VictoriaTraces) on the host where you run it. When you connect to sua instância do GitHub Enterprise Server, it does the following:

  • Connects over the administrative shell. It opens an SSH session to the admin user on port 122. All telemetry and queries travel over SSH, so the instance doesn't need any outbound network access.

  • Starts a log collector on each node. It copies a configuration file to each node and runs the OpenTelemetry Collector that ships with GitHub Enterprise Server. Each collector reads the system journal, application logs, and trace files. No extra software is installed on the instance.

  • Forwards logs and traces to the monitoring host. SSH tunnels carry logs and traces from the primary node to the monitoring host, where they're stored. In a cluster, the tunnels carry logs and traces from the metrics server node instead.

    In high availability and cluster configurations, every other node sends its logs and traces to that anchor node. These logs and traces travel through a relay over port 122. The collectors also send a small set of metrics about their own health, so you can check that collection is working.

  • Queries metrics in place. GitHub Enterprise Monitor doesn't copy the instance's metrics. Grafana queries the instance's metrics store directly through a local SSH tunnel, so metrics stay on sua instância do GitHub Enterprise Server.

  • Cleans up when it stops. Collectors and relays run only while ghe-monitor -o is running. When the session ends, GitHub Enterprise Monitor stops them and removes them from each node.

By default, email addresses and IPv4 addresses are redacted from ingested logs. Logs and traces are stored only on the monitoring host. Metrics remain on sua instância do GitHub Enterprise Server.

GitHub Enterprise Monitor includes detailed documentation in the docs directory of the release archive, covering configuration, troubleshooting, and each deployment model. When you run the stack on a workstation or Linux server, you can also browse this documentation at http://localhost:4000.

Prerequisites

The host that runs the monitoring stack needs the following:

  • SSH access to the administrative shell of sua instância do GitHub Enterprise Server on port 122. Add the SSH public key for the host to the instance's list of authorized SSH keys. For more information, see Acessar o shell administrativo (SSH).
  • Docker and Docker Compose for operational commands
  • jq for JSON processing in operational commands
  • curl for operational commands
  • Outbound HTTPS access to Docker Hub, grafana.com, and storage.googleapis.com to download container images and Grafana plugins. If storage.googleapis.com is blocked, Grafana starts without its plugins, and the log dashboards can't query data.
  • At least 4 GB of available memory
  • At least 20 GB of free disk space

Observação

GitHub Enterprise Monitor pulls container images from Docker Hub using the host's Docker configuration. If your organization uses an internal registry or proxy, such as Artifactory, make sure Docker on the host is configured to use it. Grafana plugins are always downloaded from grafana.com.

If you use an always-on deployment, operator workstations that connect to it need SSH access to the monitoring host, but don't need Docker. For more information, see Connecting to an always-on deployment.

If you install GitHub Enterprise Monitor on an unconfigured GitHub Enterprise Server appliance, the stack runs under the appliance's built-in Docker and Nomad. As a result, you don't need Docker Compose. Instead of the memory and disk minimums above, size the appliance's CPU, memory, and data disk for your log volume and retention needs.

Observação

Running ./ghe-monitor without a command displays usage and does not require Docker, jq, or curl. The usage and help commands also do not require these tools.

Quickstart

To get started, extract the release archive, configure your defaults, connect to your instance, and open the monitoring interfaces.

Extract the release archive

The release archive doesn't contain a top-level directory. Create a ghe-monitor directory and extract the archive into it.

mkdir ghe-monitor
tar -xzf ghe-monitor-VERSION.tgz -C ghe-monitor
cd ghe-monitor

Replace VERSION with the version you downloaded.

Configure defaults

Run the configuration wizard:

./ghe-monitor --config

The wizard helps you confirm or adjust settings such as data redaction, stack persistence, and memory limits.

Connect to your instance

Connect to sua instância do GitHub Enterprise Server by running the following command. Replace HOSTNAME with the hostname of your instance.

./ghe-monitor -o HOSTNAME

Access the monitoring interfaces

Use Grafana as the primary interface for reviewing ingested logs, metrics, and traces. Open http://localhost:3000 to access dashboards and visualizations.

Grafana dashboards are organized into folders:

  • Collectd: View Collectd metrics.
  • OpenTelemetry: View Prometheus metrics.
  • Logs: View log data.
  • Telemetry: Monitor the monitoring host and the components used by the stack:
    • ghe-monitor Host Health: CPU, memory, container, and storage usage on the monitoring host, plus log, metric, and trace shipping from the collectors.
    • VictoriaLogs: Log ingestion and query statistics.
    • VictoriaMetrics: Metric ingestion and query statistics.
    • VictoriaTraces: Trace ingestion and query statistics.

Dashboards are available without signing in. To query data directly in Grafana's Explore view, you may need to sign in, depending on where the stack runs:

  • Workstation or Linux server: Explore is available without signing in.

  • GitHub Enterprise Server appliance: Anonymous users can only view dashboards. To use Explore, sign in as admin. The installer generates the password. To retrieve it, run:

    ssh -p 122 admin@MONITOR-HOSTNAME -- "sudo grep '^GF_SECURITY_ADMIN_PASSWORD=' /data/user/ghe-monitor/env | cut -d= -f2-"
    

Access to Grafana isn't connected to sign-in on GitHub Enterprise Server. Anyone who can reach the monitoring host over SSH can open Grafana, so limit SSH access to trusted administrators.

Verify and stop collection

When collection is running, ghe-monitor prints Grafana is ready with the Grafana URL. To confirm that data is arriving:

  1. Open 01 - Bundle Overview, the first dashboard in Grafana's Logs folder.
  2. Set the time range to a short window, such as Last 15 minutes.
  3. Choose a regular interval in the refresh picker, such as 10s.

Log data appears on the dashboard as logs flow from sua instância do GitHub Enterprise Server. You can also run the following command from another terminal in the ghe-monitor directory to show the data available in each backend.

./ghe-monitor status

To stop collection, press Ctrl+C in the terminal running ghe-monitor -o. GitHub Enterprise Monitor stops the collectors and relays and removes them from each node.

By default, the monitoring stack and collected data stay on the host. To stop the stack, run:

./ghe-monitor down

Collected data is kept until you remove it. To restart the stack and resume collection later, run ./ghe-monitor -o HOSTNAME again.

Evaluating GitHub Enterprise Monitor in a staging environment

Before you connect to a production instance, test GitHub Enterprise Monitor against a staging instance with the same topology. Check the following:

  • Access: The monitoring host can reach port 122 on every node, and its SSH key is authorized on the instance.
  • Load on the instance: CPU, memory, and disk I/O on each node stay within normal ranges while collectors and relays are running. Clusters need extra care. GitHub Enterprise Monitor asks for confirmation before it deploys to every node in a cluster.
  • Data coverage: Logs, metrics, and traces from every node appear in the Grafana dashboards.
  • Redaction: Ingested logs meet your organization's data handling requirements.
  • Monitoring host capacity: CPU, memory, and disk usage on the monitoring host can handle your log volume and retention period.
  • Clean shutdown: After you stop ghe-monitor, no collector or relay processes remain on any node.

After you've tested in staging, connect to your production instance for the first time during a period of low activity. For example, connect during a scheduled maintenance window.

Staging environments rarely match production log volume, so watch resource usage on each node. Stop ghe-monitor if usage rises above normal levels.

Choosing a deployment model

After you've tested GitHub Enterprise Monitor in staging and know how it affects your environment, choose a deployment model. Every model collects data the same way. They differ in where the monitoring stack runs and how long it keeps data.

Only one GitHub Enterprise Monitor session can collect from an instance at a time. If another session is already collecting, ghe-monitor won't start.

If you use an always-on deployment, operators should connect to it to view data rather than starting their own ad hoc session.

The --force option takes over collection by stopping the existing session, including an always-on deployment's collection.

Ad hoc

Run GitHub Enterprise Monitor from an operator's workstation when you need it, for example during an incident. Collection starts when you run ./ghe-monitor -o HOSTNAME and stops when you exit. Data stays on the workstation, so this model suits short investigations rather than long-term trends.

Always on (dedicated Linux server)

Run the stack on a dedicated Linux server so data builds up over time. Size the server's disk for your log volume and the amount of history you want to keep.

Always on (GitHub Enterprise Server appliance)

Install GitHub Enterprise Monitor on a spare, unconfigured GitHub Enterprise Server appliance. The installer runs the stack under the appliance's built-in Nomad. Logs and traces are each kept for 60 days, so size the data disk to match.

Aviso

Never install GitHub Enterprise Monitor on an appliance that serves users. The installer refuses to run on a configured appliance.

To install GitHub Enterprise Monitor on the appliance and connect it to your instance:

  1. Browse to https://MONITOR-HOSTNAME/setup.

  2. Choose to configure the appliance as a replica or restore target.

  3. Add your SSH public key so you can access the appliance's administrative shell. At the same time, add the SSH public keys for any other operators who need access.

  4. Stop without completing the replica or restore setup. The appliance must stay unconfigured.

  5. Copy the release archive from your workstation to the monitoring appliance over SSH.

    scp -P 122 ghe-monitor-VERSION.tgz admin@MONITOR-HOSTNAME:~/
    
  6. SSH into the monitoring appliance.

    ssh -p 122 admin@MONITOR-HOSTNAME
    
  7. Create a ghe-monitor directory and extract the archive into it. The archive doesn't contain a top-level directory.

    mkdir ghe-monitor
    tar -xzf ghe-monitor-VERSION.tgz -C ghe-monitor
    cd ghe-monitor
    
  8. Run the installer.

    ./install
    

    On first run, the installer creates a dedicated SSH key pair at ~/.ssh/ghe_monitor_ed25519 and prints the public key. To show the key again, run cat ~/.ssh/ghe_monitor_ed25519.pub.

  9. Copy the public key from the monitoring appliance.

  10. Browse to https://HOSTNAME/setup/settings for the instance you want to monitor.

  11. Add the public key to the list of authorized keys.

  12. Repeat the previous two steps for each instance you plan to monitor.

  13. To verify the connection and start collection, run ghe-monitor from the monitoring appliance.

    ./ghe-monitor -o HOSTNAME
    

The key has no passphrase, and ./uninstall doesn't remove it. Before you retire the monitoring appliance, remove the key from each instance you added it to.

After installation, the appliance's Console de Gerenciamento is disabled. All further access to the monitoring appliance is through the administrative shell on port 122. This includes running ghe-monitor and connecting to Grafana from operator workstations.

To give other operators access after installation, add their SSH public keys to ~/.ssh/authorized_keys for the admin user on the monitoring appliance.

Each installation runs one collection session at a time. To monitor a different instance, stop the current session first. Data you've already collected stays on the appliance.

Keeping collection running

In both always-on models, the stack keeps running on its own. However, collection runs only while ./ghe-monitor -o is running. If you run the command directly in an SSH session to the persistent host, collection stops when that session ends.

To keep collecting, start the session inside screen or tmux on the persistent host, then detach.

screen -S ghe-monitor
./ghe-monitor -o HOSTNAME

To return to the session later, run screen -r ghe-monitor.

If the persistent host restarts, collected data is kept, but collection stops. Start a new screen or tmux session and run ./ghe-monitor -o HOSTNAME again. This starts the stack and resumes collection.

Connecting to an always-on deployment

Operators don't need Docker or a local stack to view data from an always-on deployment. From your workstation, run:

./ghe-monitor -o MONITOR-HOSTNAME

GitHub Enterprise Monitor detects that the target is a monitoring host, not a GitHub Enterprise Server instance. It doesn't deploy any collectors. It only opens SSH tunnels to Grafana and the data backends, then prints http://localhost:3000.

If port 3000 is already in use, for example because you're also running a local stack, GitHub Enterprise Monitor uses the next free port instead.

Several operators can connect at the same time. To close the tunnel, press Ctrl+C.

GitHub Enterprise Monitor uses your SSH configuration file (~/.ssh/config) when it connects to the monitoring host. If the host needs a specific username, private key, or a non-standard SSH port, add a Host entry for it before you connect.

Host MONITOR-HOSTNAME
  User USERNAME
  IdentityFile /path/to/private_key
  Port PORT

If the monitoring host is a GitHub Enterprise Server appliance, set User to admin and Port to 122.

Sharing data with Suporte do GitHub

You can export the data GitHub Enterprise Monitor has collected and upload it to Suporte do GitHub. The archive contains logs and traces from the monitoring stack, plus metrics and metadata fetched from sua instância do GitHub Enterprise Server over SSH. To upload the archive to an existing ticket, run:

./ghe-monitor export -t 24h --host HOSTNAME -u TICKET-NUMBER

Replace HOSTNAME with the hostname of your instance, and TICKET-NUMBER with your support ticket number. To upload without a ticket number, omit TICKET-NUMBER. Use -t to set the time range to export, such as 48h or 2d.

Observação

Uploading requires outbound internet access from the host running ghe-monitor, and AzCopy version 10 installed and on your PATH. GitHub Enterprise Monitor doesn't download AzCopy for you. If AzCopy isn't installed, ./ghe-monitor export -u stops before it exports any data.

An export doesn't replace a support bundle. If Suporte do GitHub asks for a support bundle, see Fornecendo dados para GitHub suporte.

Sharing feedback

GitHub Enterprise Monitor is in prévia pública. During the preview, please share any feedback with your customer success team.