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

[Feature Request] Export configurable server_name label #260

Open
drewburr opened this issue Aug 23, 2024 · 6 comments
Open

[Feature Request] Export configurable server_name label #260

drewburr opened this issue Aug 23, 2024 · 6 comments
Labels
enhancement good-first-issue Good for first-time contributors
Milestone

Comments

@drewburr
Copy link

Is your feature request related to a problem? Please describe.

To help simplify the Prometheus configuration, it would be great if the server_name label populated by the exporter automatically. My thought is that if the provided dashboards can accept this information and, in a way, tend tend to expect it, it could make sense to have the exporter supply this value itself.

Describe the solution you'd like

The ability to tell the exporter what value should be set for the server_name label, and for it to have a sensible default (i.e. minecraft)

Describe alternatives you've considered

In my Kubernetes environment, it's inconvenient to update the Prometheus scrape configs to provide these values. Alternatively, I can have these labels added in using relabelings or metricRelabelings on the serviceMonitor instead, but this makes templating options like Helm a bit of a pain to manage. While setting up my serviceMonitors, I wondered if it made sense for the exporter to define this label.

Additional context

Given that this label is a fully static value, the cost to storage should be negligible. It would also simplify setup for those who are less familiar with Prometheus and run multiple servers. In addition, I believe that the suggested use of scrapeconfig would override any defaults that the exporter would set itself, meaning existing configuration shouldn't break.

@sladkoff sladkoff added this to the 3.2.0 milestone Aug 23, 2024
@sladkoff sladkoff added enhancement good-first-issue Good for first-time contributors labels Aug 23, 2024
@sladkoff sladkoff changed the title [Feature Request] [Feature Request] Provide server_name label by default Aug 23, 2024
@sladkoff sladkoff changed the title [Feature Request] Provide server_name label by default [Feature Request] Export configurable server_name label Aug 23, 2024
@sladkoff
Copy link
Owner

sladkoff commented Aug 23, 2024

@drewburr Makes sense to me. Would it be fine for you if the server_name can be set in the plugin config?

As for the default, I'd suggest to do the following:

  1. Use the server name from the Bukkit/Spigot API (if I remember correctly that this exists)
  2. Fallback to static "minecraft" name

Do you agree?

@drewburr
Copy link
Author

I think setting server_name via the plugin config would work great, with that value taking highest priority, if set. The suggested default values also sound like a good option, assuming this is available. I'm assuming this would be like pulling the level-name from server.properties?

@geethika870
Copy link

can i work on this issue!

@sladkoff
Copy link
Owner

@geethika870 sure, go for it!

@xDangles
Copy link

I want to give my comment. I can't use this plugin because, for example, I have dozens of servers and some of them are created automatically via CloudNet. I want to get data from all of them, such as memory, but I can't do it because the system forces me to manually enter each server. It's horrible. So actually I can only use for static servers, but even here it is inconvenient. I hope something will be worked out with server-name. For example, I have a cluster-id in some cross-server support plugins that defines the server id by “Lobby-*”, i.e. lobby-1,2,3. Could some such function be made, only more flexible.

@drewburr
Copy link
Author

@geethika870 just wanted to see if this is something you're still considering implementing? If it's fallen off, it would be worth making a note in here so another has the opportunity to pick it up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good-first-issue Good for first-time contributors
Projects
None yet
Development

No branches or pull requests

4 participants