-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tags as labels to prometheus metrics #898
Add tags as labels to prometheus metrics #898
Conversation
@chakflying / @louislam - I'm not sure how to do this in NodeJS, hopefully this is a reasonable start to show the kind of thing I'm trying to achieve? Instead of
then I should see
Does that make sense? |
If that's the data structure you want, you would probably do this: for (const tag of monitor.tags) {
this.monitorLabelValues[tag.name] = tag.value
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ESLint!
You are using var
in your code...
Yup, I learned Javascript nearly 20 years ago and spend most of my life writing other languages. I had no idea that Any ideas how I get this working? |
6acc10b
to
0e6e42c
Compare
0e6e42c
to
144b8f1
Compare
Currently we use the ORM in a very raw way, meaning that table joins have to be done manually. You can check |
@louislam - I'm hoping to find time to come back to this shortly, is the ORM capable of doing the links or should I just go for a raw query? |
@chakflying - I've just found time to come back to this. I've added some code that does a lookup and pulls back the tags, however I can't seem to get them to be passed through to the correct dict. In the logs, I get the following:
but I'd expect to see all of the tags listed on the line that starts I've tried to add an
Any idea how I can get around this? |
Tags that will automatically be turned into labels are:
and new ones can be added by updating https://github.com/louislam/uptime-kuma/pull/898/files#diff-a2ea08464c146b6af2888bdf744cb4789cac4bcda6731289d02431bcc9451363R10-R18 Once this is merged, I'll update the wiki accordingly. Tags that do not meet one of the above names are ignored silently |
@chakflying / @louislam - any chance you can take a look at this please? |
Looking for a tester who are using prometheus to test this pull request. |
fixes louislam#680 replaces louislam#898
in preperation for louislam#2491,louislam#680 and louislam#898
in preperation for louislam#2491,louislam#680 and louislam#898
Hey everyone! Your suggestions are great. I was testing the Prometheus endpoint with Grafana and found this PR. In the endgame, the Prometheus endpoint should include some of the parameters in api.get_monitors() of API also. Even the Tag parameter alone would add much more flexibility. For dashboarding and reporting purposes, these would be great additions for users that can't access UI because of the lack of user permissions: 'accepted_statuscodes' 'active' 'expiryNotification' 'id' 'interval' 'keyword' 'maintenance' 'method' 'name' 'port' 'proxyId' 'tags' 'type' 'upsideDown' 'url' Reference:https://uptime-kuma-api.readthedocs.io/en/latest/api.html#uptime_kuma_api.UptimeKumaApi.get_monitors |
Any progress here by chance? Happy to sponsor someone's work to get this shipped! |
First preparation PR was merged. Wanted to split it to make the reviews easier. |
This comment was marked as spam.
This comment was marked as spam.
Do you want more tests ? it works fine. |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as outdated.
This comment was marked as outdated.
Where is the PR, what are we missing? |
#2830 was merged 1 month ago |
What is the logical next step? |
fixes louislam#680 replaces louislam#898
fixes louislam#680 replaces louislam#898
fixes louislam#680 replaces louislam#898
See 4704 |
Thanks for the wor that went into this PR Closing in favor of #4704 as said PR seems to also handle the editing of tags. => lets continue the conversation there. |
fixes louislam#680 replaces louislam#898
fixes louislam#680 replaces louislam#898
Description
Fixes #680 - Once working, this should add any tags added in the UI as labels for Prometheus
Type of change
Please delete options that are not relevant.
Checklist
Screenshots (if any)
Please do not use any external image service. Instead, just paste in or drag and drop the image here and it will be uploaded automatically.