# API metrics addition

**URL:** <https://forum.storj.io/t/api-metrics-addition/11543>\
**Category:** Storage Node feature requests - voting\
**Tags:** storagenode-api\
**Created:** [February 2, 2021, 5:44pm UTC](https://forum.storj.io/t/api-metrics-addition/11543 "2021-02-02T17:44:41Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [February 2, 2021, 5:44pm UTC](https://forum.storj.io/t/api-metrics-addition/11543/1 "2021-02-02T17:44:41Z")

</div>

Please add back the metric audit successCount so we can track the progress of the vetting.

Additionally please expose the space used by different satellites. This is already done when pretending to start a Graceful Exit but doesn’t exist in the storagenode API.  
Edit:

> [@API metrics addition](https://forum.storj.io/t/api-metrics-addition/11543/4):
>
> I’m sorry, I didn’t check the API carefully enough. Looks like it got added at some point under /api/sno/satellite/\<sat\_id\>/CurrentStorageUsed

---

<div class="post-metadata">

**Author:** ![Odmin](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/odmin/32/92_2.png) [@Odmin](https://forum.storj.io/u/Odmin)\
**Post date:** [February 2, 2021, 5:50pm UTC](https://forum.storj.io/t/api-metrics-addition/11543/2 "2021-02-02T17:50:13Z")

</div>

> [@kevink](#):
>
> Additionally please expose the space used by different satellites.

I use `atRestTotal` parameter from API

 ![image](https://storj-s3.bcdn.literatehosting.net/original/2X/b/b23a3642b73b6c44543a4afd2ae9119c054f9dc2.jpeg)

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [February 2, 2021, 7:12pm UTC](https://forum.storj.io/t/api-metrics-addition/11543/3 "2021-02-02T19:12:34Z")

</div>

This is quite inaccurate because it’s TBh

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [February 2, 2021, 7:13pm UTC](https://forum.storj.io/t/api-metrics-addition/11543/4 "2021-02-02T19:13:13Z")

</div>

I’m sorry, I didn’t check the API carefully enough. Looks like it got added at some point under /api/sno/satellite/\<sat\_id\>/CurrentStorageUsed

---

<div class="post-metadata">

**Author:** ![cameron](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/cameron/32/69_2.png) [@cameron](https://forum.storj.io/u/cameron)\
**Post date:** [February 2, 2021, 8:52pm UTC](https://forum.storj.io/t/api-metrics-addition/11543/5 "2021-02-02T20:52:35Z")

</div>

I’ve asked the SNO growth team if we can put the audit metrics back into the API, and they said they can. They just need to schedule the work.

---

<div class="post-metadata">

**Author:** ![Pentium100](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/pentium100/32/6082_2.png) [@Pentium100](https://forum.storj.io/u/Pentium100)\
**Post date:** [February 2, 2021, 9:00pm UTC](https://forum.storj.io/t/api-metrics-addition/11543/6 "2021-02-02T21:00:48Z")

</div>

> [@kevink](#):
>
> Additionally please expose the space used by different satellites.

Until they do that, you can get the data from one of the databases.

My script as an example:

> <https://github.com/Pentium100MHz/storjv3-tools/blob/02fcdfafd3a3c066445f77e2ce4f846a24bf2711/satspace.php>

Set the db\_file variable to point to the location of that file.  
run the script like this  
`php satspace.php 12rfG3sh9NCWiX3ivPjq2HtdLmbqCrvHVEzJubnzFzosMuawymB content`  
“content” can also be “trash” or “total” (which returns content+trash).

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [February 2, 2021, 9:02pm UTC](https://forum.storj.io/t/api-metrics-addition/11543/7 "2021-02-02T21:02:05Z")

</div>

Thanks but it’s for the prometheus exporter. Adding db access would be more complicated.

---

<div class="post-metadata">

**Author:** ![fmoledina](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/fmoledina/32/6739_2.png) [@fmoledina](https://forum.storj.io/u/fmoledina)\
**Post date:** [February 8, 2021, 2:43am UTC](https://forum.storj.io/t/api-metrics-addition/11543/8 "2021-02-08T02:43:23Z")

</div>

> **[albertodonato/query-exporter](https://github.com/albertodonato/query-exporter)**
>
> Export Prometheus metrics from SQL queries. Contribute to albertodonato/query-exporter development by creating an account on GitHub.

@kevink @greener challenge accepted?

Just kidding, having the vetting metrics back in the API would be best. Glad to hear that they may be back soon.

---

<div class="post-metadata">

**Author:** ![kevink](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/kevink/32/6077_2.png) [@kevink](https://forum.storj.io/u/kevink)\
**Post date:** [February 8, 2021, 6:00am UTC](https://forum.storj.io/t/api-metrics-addition/11543/9 "2021-02-08T06:00:24Z")

</div>

I have a challenge for you 😃 Learn go and the go prometheus exporter library and integrate it into the storagenode directly 🤪

---

<div class="post-metadata">

**Author:** ![fmoledina](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/fmoledina/32/6739_2.png) [@fmoledina](https://forum.storj.io/u/fmoledina)\
**Post date:** [February 8, 2021, 2:43pm UTC](https://forum.storj.io/t/api-metrics-addition/11543/10 "2021-02-08T14:43:29Z")

</div>

Hah! That would be quite the heavy lift for me haha. I’m okay at configuration, but I’m not really a dev. Hopefully they can incorporate that in the near future.
