autometrics-dev / am

Autometrics Companion CLI app
Apache License 2.0
16 stars 2 forks source link

Allow user to specify the name of the job #49

Closed hatchan closed 1 year ago

hatchan commented 1 year ago

Each target can have a name. This will be exposed as the job label in the metrics. It would be useful for the user to specify these names.

Currently we just have app_{} where the parenthesis will contain a incrementing number (to avoid collisions).

With a config file we can simply add another property, something like name. For the terminal approach, we might want to include a prefix or postfix. So something like api|:3000. The first part would be the name of the job, in this case api, and the part after the | will just be parsed as it currently is.

hatchan commented 1 year ago

I was thinking that now that we have support for a toml file it might make sense to just keep it there and not make the using the cli arguments too complicated. Any thoughts on this @mies @mellowagain

mellowagain commented 1 year ago

where is job name even displayed? its not displayed in dora at all, right? only in prom/grafana, in which case yea config should be fine

mies commented 1 year ago

I'd be in favor of reducing the complexity and number of arguments for the cli 🥳

hatchan commented 1 year ago

where is job name even displayed? its not displayed in dora at all, right? only in prom/grafana, in which case yea config should be fine

It is used in Prometheus. This jobname would be added to the metrics as a label that would be produced by this endpoint.