Skip to content

README: add Prometheus plugin#854

Merged
robotastic merged 1 commit intoTrunkRecorder:masterfrom
USA-RedDragon:prometheus-plugin
Nov 11, 2023
Merged

README: add Prometheus plugin#854
robotastic merged 1 commit intoTrunkRecorder:masterfrom
USA-RedDragon:prometheus-plugin

Conversation

@USA-RedDragon
Copy link
Contributor

I created a Prometheus metrics plugin at https://github.com/USA-RedDragon/trunk-recorder-prometheus, so I wanted to link it here. If this isn't something you want to link, feel free to close the PR, no hard feelings :)

@robotastic
Copy link
Collaborator

This is great!! I am going to go give this a try - it seems like a super easy way to track stats.

@robotastic robotastic merged commit af9a1c9 into TrunkRecorder:master Nov 11, 2023
@USA-RedDragon USA-RedDragon deleted the prometheus-plugin branch November 11, 2023 22:19
@frameshift18
Copy link
Contributor

Trying to get this to work and ran into a couple issues.

  1. In trunk-recorder/plugin_manager/plugin_api.h I had to change #include <json.hpp> to #include "../json.hpp" or else it couldn't find it. I know you just changed that so probably a typo?

  2. When trying to build the plugin I get the following error and I don't know enough about C to fix it, lol :D. I did remove 'override' and it built but it doesn't seem to work then. At least nothing loads at the :9842 endpoint and Prometheus doesn't find any metrics.

prometheus_plugin.cc:60:7: error: ‘int Prometheus::parse_config(boost::property_tree::ptree&)’ marked ‘override’, but does not override 60 | int parse_config(boost::property_tree::ptree &cfg) override

@USA-RedDragon
Copy link
Contributor Author

USA-RedDragon commented Nov 12, 2023

Yeah the plugin was built against 4.2.0, so the new json stuff being passed around in the latest changes on the master branch aren't used yet since the plugin API changed a bit (#856) this morning. Getting my plugin's main based on the master is on my todo tonight. There now exists a 4.2.0 tag on the GHCR image which should run against Trunk Recorder 4.2.0 if you're using Docker

@frameshift18
Copy link
Contributor

Kind of figured. Course I had to update my running TR instance to master and then try this. All good and appreciate the work :)

@robotastic
Copy link
Collaborator

Sorry about that - I was going to put in a PR to fix things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants