# hyper-blackbox-exporter

> Prometheus blackbox exporter for Hypercore

Latest version **0.0.1-alpha.9** (published 2024-09-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install hyper-blackbox-exporter
pnpm add hyper-blackbox-exporter
yarn add hyper-blackbox-exporter
bun add hyper-blackbox-exporter
```

Provides the command `hyper-blackbox-exporter`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1-alpha.9 |
| Published | 2024-09-22 |
| First published | 2023-07-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 23.7 KB |
| Known vulnerabilities | 0 (+9 in 1 direct dependencies) |
| Install scripts | no |
| Author | H. Degroote |
| Maintainers | hdegroote |
| Keywords | Prometheus, blackbox, exporter, hypercore |

## Links

- npm: https://www.npmjs.com/package/hyper-blackbox-exporter
- Repository: https://gitlab.com/dcent-tech/hyper-blackbox-exporter
- Homepage: https://gitlab.com/dcent-tech/hyper-blackbox-exporter#readme
- Issues: https://gitlab.com/dcent-tech/hyper-blackbox-exporter/issues
- npm.io page: https://npm.io/package/hyper-blackbox-exporter

## Dependencies (10)

- [pino](https://npm.io/package/pino.md) ^9.0.0
- [dotenv](https://npm.io/package/dotenv.md) ^16.0.3
- [fastify](https://npm.io/package/fastify.md) ^4.20.0
- [hyperdht](https://npm.io/package/hyperdht.md) ^6.5.3
- [corestore](https://npm.io/package/corestore.md) ^6.4.1
- [hyperswarm](https://npm.io/package/hyperswarm.md) ^4.4.1
- [hexkey-utils](https://npm.io/package/hexkey-utils.md) ^1.0.2
- [safety-catch](https://npm.io/package/safety-catch.md) ^1.0.2
- [graceful-goodbye](https://npm.io/package/graceful-goodbye.md) ^1.3.0
- [random-access-memory](https://npm.io/package/random-access-memory.md) ^6.2.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.0.1-alpha.9 (latest) — 2024-09-22
- 0.0.1-alpha.8 — 2024-09-17
- 0.0.1-alpha.7 — 2024-08-13
- 0.0.1-alpha.6 — 2024-01-03
- 0.0.1-alpha.5 — 2023-08-24
- 0.0.1-alpha.4 — 2023-08-21
- 0.0.1-alpha.3 — 2023-08-17
- 0.0.1-alpha.2 — 2023-07-26
- 0.0.1-alpha.1 — 2023-07-26
- 0.0.1-alpha.0 — 2023-07-26

## README

# Hyper Blackbox Exporter

A prometheus exporter to get basic metrics about hypercores. It uses the [multi-exporter pattern](https://prometheus.io/docs/guides/multi-target-exporter/).

Includes metrics:
- `hyper_probe_success`: whether a hypercore can be located and its first block downloaded
- `hyper_probe_duration_seconds`: how long it takes to locate the hypercore and download the first block
- `hyper_probe_nr_peers`: how many peers are serving this block (this is an underbound, the server might not connect to all of them)
## Install

`npm i -g hyper-blackbox-exporter`

## Usage

Note: can also be run as Docker, see [here](https://hub.docker.com/r/hdegroote/hyper-blackbox-exporter).

CLI usage:

`hyper-blackbox-exporter`

Then from another terminal:

`curl http://127.0.0.1:43211/probe?target=<key>`

For example:
curl http://127.0.0.1:43211/probe?target=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Output example:
```
# HELP hyper_probe_duration_seconds Returns how long the probe took to complete in seconds
# TYPE hyper_probe_duration_seconds gauge
hyper_probe_duration_seconds 0.011095994994044303
# HELP hyper_probe_success Displays whether or not the probe was a success
# TYPE hyper_probe_success gauge
hyper_probe_success 1
# HELP hyper_probe_nr_peers Displays the number of peers who are serving this core
# TYPE hyper_probe_nr_peers gauge
hyper_probe_nr_peers 7
```

## Prometheus Config

This endpoint can be scraped with the following config, entering your own hypercore keys under targets and replacing the `__address__` entry with the URL to your hyper-blackbox-exporter's URL.

```
  - job_name: hyperblackbox-exporter
    metrics_path: /probe
    scheme: https
    scrape_timeout: 10s
    scrape_interval: 60s
    static_configs:
      - targets:
        - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
        - bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
      - source_labels: [__param_target]
        target_label: hypercoreKey
      - target_label: __address__
        replacement: myUrl:8080
```

---
_Source: https://npm.io/package/hyper-blackbox-exporter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
