> For the complete documentation index, see [llms.txt](https://docs.netcap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.netcap.io/v0.4.1/metrics.md).

# Metrics

Prometheus Metrics

## Introduction

Netcap now support exporting prometheus metrics about its go runtime, the collection process and the audit records itself. This feature can be used with the **net.export** tool.

## Configuration

Metrics are served by default on **127.0.0.1:7777/metrics**. Configure a prometheus instance to scrape it:

```yaml
# reference: https://prometheus.io/docs/prometheus/latest/configuration/configuration/

global:
  scrape_interval: 15s
  scrape_timeout: 15s
  #evaluation_interval: 15s

scrape_configs:
  # process_ metrics
  - job_name: netcap
    metrics_path: /metrics
    scheme: http
    static_configs:
      - targets:
        - 127.0.0.1:7777
```

## Usage

Export a PCAP dumpfile and serve metrics .

```
$ net.export -r 2017-09-19-traffic-analysis-exercise.pcap
```

Capture and export traffic live from the named interface:

```
$ net.export -iface en0
```

Export a specific audit record file:

```
$ net.export -r HTTP.ncap.gz
```

Export all audit record files in the current directory:

```
$ net.export .
```

## Overview Dashboard Preview

![Grafana Dashboard Overview](https://501659213-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La-SRWxzIGdy_3ynMZH%2F-LqkPR4DukbeBJnAbdn3%2F-LqkPRu3NbjO2GXz3Jei%2Fscreenshot-2019-05-04-at-23.39.19.png?generation=1570622789111658\&alt=media)

## TCP Dashboard Preview

![Grafana Dashboard TCP](https://501659213-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La-SRWxzIGdy_3ynMZH%2F-LqkPR4DukbeBJnAbdn3%2F-LqkPRu5fN9Ey985AMOD%2Fscreenshot-2019-05-04-at-23.39.41.png?generation=1570622789205206\&alt=media)

## HTTP Dashboard Preview

![Grafana Dashboard HTTP](https://501659213-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-La-SRWxzIGdy_3ynMZH%2F-LqkPR4DukbeBJnAbdn3%2F-LqkPRu7v-GhYWl_OOHq%2Fscreenshot-2019-05-04-at-23.40.05.png?generation=1570622789228247\&alt=media)
