Skip to content
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 Monitor group name to metric labels #3905

Open
1 task done
mhkarimi1383 opened this issue Oct 16, 2023 · 17 comments
Open
1 task done

Add Monitor group name to metric labels #3905

mhkarimi1383 opened this issue Oct 16, 2023 · 17 comments
Labels
area:metrics related to monitoring metrics feature-request Request for new features to be added

Comments

@mhkarimi1383
Copy link
Contributor

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

🏷️ Feature Request Type

API, Other

🔖 Feature description

Hi

Making monitors group name available in metric labels will be great when creating dashboads in Grafana

✔️ Solution

Add a label named group in metrics

❓ Alternatives

No response

📝 Additional Context

No response

@mhkarimi1383 mhkarimi1383 added the feature-request Request for new features to be added label Oct 16, 2023
@CommanderStorm CommanderStorm added the area:metrics related to monitoring metrics label Dec 5, 2023
@Craftoncu

This comment was marked as spam.

@Craftoncu

This comment was marked as spam.

@CommanderStorm

This comment was marked as resolved.

@CommanderStorm
Copy link
Collaborator

CommanderStorm commented Mar 8, 2024

@mhkarimi1383
It is not clear to me how this feature should work.
A monitor can be in multiple groups ⇒ how should this be labelled?

@mhkarimi1383
Copy link
Contributor Author

@CommanderStorm
As long as we are not having a lot of group names we could have multiple metrics for the same monitor since, I know It's not recommended since it could make a lot of metrics and it's not good for Prometheus

But we could make this feature configurable and disable it by default

@CommanderStorm
Copy link
Collaborator

we could have multiple metrics for the same monitor since

You are not making a lot of sense to me.
What do you mean with this? How would you need this be labelled concretely?

@mhkarimi1383
Copy link
Contributor Author

we could have multiple metrics for the same monitor since

You are not making a lot of sense to me.
What do you mean with this? How would you need this be labelled concretely?

We are making SLA dashboards with the help of Prometheus metrics, but we are not able to categorize things, because we are not having access to group or tags from there

@CommanderStorm
Copy link
Collaborator

CommanderStorm commented Mar 11, 2024

That is not what I asked.
I asked how the metrics would need to be labeled concretely.

Our group monitors are hierarchical (a group can contain a group), while Prometheus (as far as I can tell only supports Key/value pairs.

@Craftoncu
Copy link

Craftoncu commented Mar 11, 2024

Its not about wrapping objects. Its about adding new information to the single line.
I think this should be the /metrics output.

- monitor_response_time{monitor_name="UPTIME REFERENCE GOOGLE.COM",monitor_type="http",monitor_url="https://google.com",monitor_hostname="null",monitor_port="null"} 200
+ monitor_response_time{monitor_name="UPTIME REFERENCE GOOGLE.COM",monitor_type="http",monitor_url="https://google.com",monitor_hostname="null",monitor_port="null",monitor_parent="**THIS_IS_THE_PARENT_NAME**"} 200

@Craftoncu
Copy link

Its just a new kv pair inside the json object.

@CommanderStorm
Copy link
Collaborator

What would you put under **THIS_IS_THE_PARENT_NAME** exactly?

I think we are unclear about prerequesits.
Are you aware that groups can contain groups?

Group A
|--> Monitor B
|--> Group B
        |--> Monitor C

@mhkarimi1383
Copy link
Contributor Author

mhkarimi1383 commented Mar 13, 2024

Are you aware that groups can contain groups?

Group A
|--> Monitor B
|--> Group B
        |--> Monitor C

Yap
I think that's Ok, we are having groups as monitors and they can be parents and/or children for others

@CommanderStorm
Copy link
Collaborator

Only selectively answering questions is quite painfull.

What would you put under **THIS_IS_THE_PARENT_NAME** exactly?

@Craftoncu
Copy link

Craftoncu commented Mar 13, 2024

Jup, Im aware of that. What about chaining these? Like GroupA/Group/B

There is the opportunity to build complex selection strategy in Grafana. But for this the groups should be available

@Craftoncu
Copy link

Are there any news about it? I tried to implement the changes yesterday in my lunch, but failed.

@CommanderStorm
Copy link
Collaborator

What about chaining these? Like GroupA/Group/B

See #4472

I don't know what is the best-practice in this situation

Are there any news about it

Please have a look at #898 for a related PR which had a prerequesite merged recently.

@CommanderStorm
Copy link
Collaborator

Thinking about it:
Maybe replacing the individual group names with .replace("/", "|") and then joining with / could work.
If someone wants to invest the time to add this feature, the code for this is avaliable here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:metrics related to monitoring metrics feature-request Request for new features to be added
Projects
None yet
Development

No branches or pull requests

3 participants