Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the README #12

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Metrics API for [erldns](https://github.com/dnsimple/erldns)
# Metrics API for [erldns]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the link has been removed but we still keep the [] around was this intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes if you have a footnote in Markdown, like

[erldns]: https://...

anywhere on the page, then you can just use [erldns] instead of [erldns][erldns] 🙃


This app provides an HTTP API for gathering and querying metrics from an erldns server and presenting those metrics as JSON.
This app provides an HTTP API for gathering and querying metrics from an [erldns] server and presenting those metrics as JSON.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here [erldns] but no link.


> [!NOTE]
> erldns_metrics is architected to run in the *same Erlang VM* as erldns, as it reads metrics from the runtime. This is why erldns is a dependency of this library, and gets started in [`erldns_metrics.app.src`](./src/erldns_metrics.app.src): it's useful for local development, so that starting erldns_metrics also starts erldns.
> In general, you might want to run erldns_metrics and erldns both as dependencies of an application that *you* control and deploy.

Here's an example script that shows how to get the output with `curl` and pass it through Python to format it in a pretty fashion. It assumes you have this API running on port `8082`.

Expand All @@ -13,16 +17,16 @@ curl -s http://localhost:8082/ -H "Accept: application/json" | python -mjson.too

## Configuration

To configure the metrics API port, add something like the following to your Erlang configuration section:
To run this application and configure erldns, add something like the following to your Erlang configuration section:

```erlang
[
{erldns,[
{erldns, [
{metrics, [
{port, 8082}
]},
]}
]
].
```

## Building
Expand All @@ -41,7 +45,7 @@ make fresh

## Running

You'll need [erldns]() running. Then, you can run erldns_metrics as:
You'll need [erldns] running. erldns_metrics starts it on startup, so you just need to run this in the erldns_metrics repository:

```bash
rebar3 shell
Expand Down Expand Up @@ -77,3 +81,5 @@ rebar3 shell --config erldns_metrics.config
```bash
make test
```

[erldns]: https://github.com/dnsimple/erldns