# 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](/files/-LqkPRu3NbjO2GXz3Jei)

## TCP Dashboard Preview

![Grafana Dashboard TCP](/files/-LqkPRu5fN9Ey985AMOD)

## HTTP Dashboard Preview

![Grafana Dashboard HTTP](/files/-LqkPRu7v-GhYWl_OOHq)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.netcap.io/v0.4.1/metrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
