Closed godber closed 6 months ago
Play with prom-client
a bit:
We decided that the proper place for this to live is in the terafoundation foundation APIS. https://github.com/terascope/teraslice/blob/master/packages/terafoundation/src/api/index.ts
The registerApis function within terafoundation contains the foundationApis
object. It will now have a promMetrics
key that contains all the functions related to the prom-metrics-api
.
There was a lot of discussion about when the API and the associated exporter
server should be created. I've experimented with creating the API at the terafoundation
level vs the teraslice master
, execution_controller
, and worker
level.
terafoundation
seems out of order as the API setup requires adding logic that requires knowledge of the execution that will be run. If we want to use this API in other internal projects that use terafoundation
we would need to add extra logic into terafoundation
for that as well.
In standard assets we added the following
job_metric_api
:https://github.com/terascope/standard-assets/blob/master/asset/src/job_metric_api/api.ts
We should extract out the API into Teraslice itself so the metrics can be used elsewhere
See
registerApis
here:https://github.com/terascope/teraslice/blob/master/packages/job-components/src/register-apis.ts#L113
... and the APIs that get registered could be good examples.
Note that when this issue is done we need to do the following:
job_metrics_api
to use the built in API