I have a CLI application of which I can run multiple instances simultaneously. I need to associate a unique, sequential and re-usable identifier to each instance. It should also be contextual/independent for each process type.
Example:
The obvious choice would be to use the processes' PID but that would give me too many different and too sparse identifiers.
Is there something built-in in Unix/Linux or some service that gives me that?
I would prefer a system native or Node.js solution.
Background:
I'm using Graphite to generate stats of an application and I don't want to potentially create thousands of buckets of the same stats using the processes' PIDs. If there's an alternative solution to this problem, I would also be interested in knowing that.
Thank you!
Since I didn't find any system that meets my requirements, I have created an app myself and hosted it at GitHub: https://github.com/muzzley/process-id-dealer
It's a Node.js app that deals sequential and reusable process ids through an HTTP endpoint. Thus, it can be used by any other program.