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

README: add Prometheus plugin #854

Merged
merged 1 commit into from
Nov 11, 2023
Merged

README: add Prometheus plugin #854

merged 1 commit into from
Nov 11, 2023

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
Owner

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 robotastic: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
Owner

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.

None yet

3 participants