Closed stefankaufmann closed 1 year ago
Hi @stefankaufmann,
Thanks for your PR!
It seems very good so far, but I was just thinking it would be better to export this start time information in unix timestamp format. Would you mind adapting it? Another thing would be how lmstat
manages year changes, as I see year is not referenced somewhere.
Thank you!
Mario
Hi @mjtrangoni,
thanks for your feedback. I thought about this already and I will try to convert the start time information to unix timestamp. I guess I will just use the closest year matching to the timestamp (current year, or last year depending on the day/month information)
Hi @mjtrangoni,
I managed to export the "since" field as unix time. It was more complex than I thought. Here some notes:
time.Time
first and compare only the information month, day and time. Otherwise the test would not work next year :DI hope this fits for you. I am also open for any other suggestions in improving the code. I never programmed in go before and never worked on a prometheus exporter. So if there are any things to be changed, just let me know
Perfect! I like it. I am sure this format will be better than the former string, and there will be better queries out of it!
Thanks for your contribution!
I added the export of the
Start time
of a usage for a license. This information is returned from lmstat, but was not exported to prometheus. I added it as the fieldsince
for the featureflexlm_feature_used_users
.Maybe this information is of interest for other users, so feel free to merge the PR if you agree that this feature is useful.
I also changed the way the named regex groups are used. Actually the named groups were still accessed by index, so I changed it, because I think it is more stable when a developer adds a new capture group to a regex, like i did now