# prom-query

> Prometheus Query API Wrapper

Latest version **1.0.0** (published 2017-08-16) · MPL-2 license · 0 weekly downloads

## Install

```sh
npm install prom-query
pnpm add prom-query
yarn add prom-query
bun add prom-query
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-08-16 |
| First published | 2017-08-15 |
| Weekly downloads | 0 |
| License | MPL-2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | wyatt |
| Maintainers | wyatt |
| Keywords | prometheus, api |

## Links

- npm: https://www.npmjs.com/package/prom-query
- Repository: https://github.com/geek/prom-query
- Homepage: https://github.com/geek/prom-query#readme
- Issues: https://github.com/geek/prom-query/issues
- npm.io page: https://npm.io/package/prom-query

## Dependencies (1)

- [wreck](https://npm.io/package/wreck.md) ^12.2.3

## Recent versions

- 1.0.0 (latest) — 2017-08-16
- 0.0.0 — 2017-08-15

## README

# prom-query
Prometheus Query API Wrapper


## Usage

### Constructor

```
const prom = new PromQuery({ url: 'http://PROMETHEUS:PORT' });
````

### `getMetricNames(job, cb)`

Return an array of metric names for a given job.


### `getMetrics(options, cb)`

Return an array of metrics given the following options:
- `names`: array of metric names
- `instances`: array of instance names
- `start`: string representation of start date range to get metrics for
- `end`: string representation of end date range to get metrics for

Resulting metrics have the following format:

```
[
  {
    name: String,
    instance: String,
    metrics: [
      time: Date,
      value: Number
    ]
  }
]
```

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