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

SSmetrics - Elasticsearch powered metrics viewing #16549

Merged
merged 10 commits into from
Aug 17, 2021

Conversation

AffectedArc07
Copy link
Member

@AffectedArc07 AffectedArc07 commented Aug 15, 2021

What Does This PR Do

This PR adds a subsystem in, SSmetrics, which allows ingame metrics to be ingested straight into ElasticSearch. This allows us to easily visualise server performance and trends on pretty graphs, as well as correlate it with things such as player count. This allows us to gain a lot of insight on where the server dies more and gives us historical data.

This will POST the results directly into ElasticSearch, meaning they dont have to be written to a file for them to be read in, it can all happen through a HTTP post.

Todo:

  • Base code to gather metrics
  • Add more values to more subsystems (Requesting help of @Fox-McCloud for what vars on what subsystems would be good)
  • Finish and commit ELK ingesting code (Requires Denghis)

Why It's Good For The Game

Being able to visaulise server metrics over time is incredibly useful and will allow us to further optimise things.

Changelog

🆑 AffectedArc07
add: Added a subsystem which can send server metrics straight into ElasticSearch.
/:cl:

@AffectedArc07 AffectedArc07 added Feature This PR is a new addition to the game Configuration Change This PR changes the game configuration files. Please run via the host. Work In Progress This PR is work in progress, and unfinished Infrastructure This PR will update GitHub tooling labels Aug 15, 2021
@@ -32,7 +32,9 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
var/datum/configuration_section/logging_configuration/logging
/// Holder for the MC configuration datum
var/datum/configuration_section/mc_configuration/mc
/// Holder for the MC configuration datum
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a typo fix

@AffectedArc07 AffectedArc07 removed the Work In Progress This PR is work in progress, and unfinished label Aug 15, 2021
@AffectedArc07
Copy link
Member Author

PR is now /mergeable/ per say, just could do with extra input from Fox for specific metrics from each SS.

@AffectedArc07 AffectedArc07 marked this pull request as ready for review August 15, 2021 18:51
@AffectedArc07 AffectedArc07 changed the title [WIP] SSmetrics - Elasticsearch powered metrics viewing SSmetrics - Elasticsearch powered metrics viewing Aug 15, 2021
@AffectedArc07
Copy link
Member Author

This PR will be long term TM'd to gather metrics for dashboards early on.

@AffectedArc07
Copy link
Member Author

Spoke with fox and implemented metrics on subsystems where getting them would be useful.

Also fixed an issue with SSmentor_tickets reading as fire_codertrain_again due to being a snowflake piece of garbage.

@@ -11,6 +11,11 @@ SUBSYSTEM_DEF(acid)
/datum/controller/subsystem/acid/stat_entry()
..("P:[processing.len]")

/datum/controller/subsystem/acid/get_metrics()
. = ..()
var/list/cust = list()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These being cust rather than just custom or something else entirely seems a bit odd. It's pretty obvious that it does mean "custom" of course, but it could probably be a bit clearer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for easier differentiation between the list index and the entry itself. I also recall something having a custom var and I didn't want these to interfere.

@AffectedArc07
Copy link
Member Author

Latest commit fixes this

image

@AffectedArc07
Copy link
Member Author

image
Midnight rollover is confirmed fixed.

@@ -2,6 +2,8 @@
/datum/controller/subsystem
// Metadata; you should define these.
name = "fire codertrain" //name of the subsystem
/// Subsystem ID. Used for when we need a technical name for the SS
var/ss_id = "fire_codertrain_again"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌

var/list/out = list()
out["@timestamp"] = time_stamp() // This is required by ElasticSearch, complete with this name. DO NOT REMOVE THIS.
out["cpu"] = world.cpu
// out["maptick"] = world.map_cpu // TODO: 514
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Fox-McCloud Fox-McCloud merged commit 30fb0cf into ParadiseSS13:master Aug 17, 2021
dwasint added a commit to Vanderlin-Tales-Of-Wine/Vanderlin that referenced this pull request Feb 15, 2025
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- Note: PRs including balance changes authored by anyone other than
maintainers and official devs will not be considered. -->

## About The Pull Request
Lets us upload data to elasticsearch without ripping up log files
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review or prevent the PR from being merged!
-->

## Why It's Good For The Game

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->
The idea for this came from:
ParadiseSS13/Paradise#16549
where instead of metrics it was normalized into just an elastic
subsystem which can be used for metrics later
## Pre-Merge Checklist
<!-- Don't bother filling these in while creating your Pull Request,
just click the checkboxes after the Pull Request is opened and you are
redirected to the page. -->
- [ ] You tested this on a local server.
- [ ] This code did not runtime during testing.
- [ ] You documented all of your changes.
<!-- Neither the compiler nor workflow checks are perfect at detecting
runtimes and errors. It is important to test your code/feature/fix
locally. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Configuration Change This PR changes the game configuration files. Please run via the host. Feature This PR is a new addition to the game Infrastructure This PR will update GitHub tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants