remijouannet / graftorio2

(fork of graftorio) factorio mod for creating grafana dashboard
MIT License
77 stars 21 forks source link

Sample dashboards #11

Closed QCU87Z closed 1 year ago

QCU87Z commented 2 years ago

Hi,

I was wondering if you have any example for queries for creating dashboards. I have the data going into Grafana but cant work out how to graph how many sciences packs I am making per minute etc.

I know its not really about your mod and more about my ability to use grafana and prometheus but some examples would be awesome to help people along.

Great mod cheers.

Kariton commented 1 year ago

Hey,

I have a few mostly polished dashboards with datalinks etc. They include the following:

Info - overall stats

Items - important items - delta production / consumption

Default - rebuild of ingame graphs (as close as possible)

Rate - Various interpretation of "rate"

Misc - detailed presentation in various forms

All dashboards support a variety of different filters. For example: Force, TimeScale, Network, Item / Fluid / Building / etc. Force: default player - some mods provide their own identifyer. TimeScale: default minutes - is used to calculate values per seconds / minutes / hours. Network: default all - depending on context the available networks like electricity / logistic. Item: default all - depending on context the available entities.

[no data] is related to another graftorio fork which once included such values. sadly @remijouannet closed my feature request to add them to this version [#18] and I'm unable to do so. I don't script a lot in my free time and I'm not going to learn a new language - just "for a mod".

I will try to figure out how I can create an PR with those templates. Maybe they can be the default dashboard loadout after creating the container. Eventually they need to be imported one by one (or via script)

Kariton commented 1 year ago

I just realized that there is no 2.X Dashboard 😄

remijouannet commented 1 year ago

hello, if you have any dashboard you feel could be part of this repo don't hesitate to open a PR or link them here so i can push them myself

Kariton commented 1 year ago

@remijouannet here you go: https://github.com/Kariton/graftorio2/tree/default-dashboards

what do you think? yes, I moved data to a dedicated directory. Users need to move their data manually, and maybe correct the permissions accordingly - if they want to keep their prometheus metrics. I think this step is necessary to make it easy for others to maintain / update those dashboards if needed.

I would like to maintain them further. For example make something useful out of the train data.

Kariton commented 1 year ago

I was actually able to add those missing metrics myself. now the mods exports metrics for research_queue, pollution, evolution

Andrew-Wichmann commented 1 year ago

These dashboards are incredible! Thank you so much @Kariton

ben-thul commented 1 year ago

@Kariton - are you planning on submitting a PR so that these changes can be merged upstream?

Kariton commented 1 year ago

Hey, @ben-thul,

Yes, I plan to create a PR to get them merged upstream. This may happen after Christmas or in January.

In the mean time I which you all a very merry Christmas and a happy new year!

Andrew-Wichmann commented 1 year ago

Merry Christmas!

Kariton commented 1 year ago

Are you actively using my dashboards ATM?

I just pushed some new dashboards and added ${__url_time_range} to the datalinks. now a previously selected time range persists over datalinks.

I appreciate any suggestions for dashboards or improvements. Still working on them before I will create an PR in the near future.

ben-thul commented 1 year ago

I hadn't, but just tried. I cloned your fork (had to do git config core.protectNTFS false due to colon characters in file names) and ran with docker-compose up (like I would for the mainline mod). It looks like things started okay but I'm not seeing data in any of the dashboards. I'm probably doing something wrong.

Kariton commented 1 year ago

Hey @ben-thul, that's really unfortunate.

have you used this mod / setup beforehand? did you git checkout default-dashboards to switch to the branch?

are you familiar with the Debugging description in README?

Sounds like grafana is reachable and all dashboards are loaded (even without data). which implies that you have switched the branch.

we may figure it out if you can give some more information. hope that helps. :)

P.S.: the "upstream" mod is missing some metrics. due to this expect some dashboards to be empty. the fork is patched with metrics for research_queue, pollution, evolution

a possible solution (for now) is to ZIP the cloned fork and move it in-place as graftorio2 mod. please do your self a favor and use an "data less" structure - with nothing in data/{grafana,prometheus}/ this is only needed once. be aware that this is technically a version downgrade and the mod manage may wants to update.

remijouannet commented 1 year ago

i'm closing the issue since @Kariton merged a lot of great dashboards in https://github.com/remijouannet/graftorio2/pull/26