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

Add args to serve application behind a route prefix/external URL #1328

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kwilt
Copy link

@kwilt kwilt commented Jan 2, 2025

Add feature to serve application behind a route prefix or external URL by supplying args --web.external-url/--web.route-prefix, in the same way as blackbox_exporter or other exporters

I essentially copied the code from blackbox_exporter to achieve this functionality. Currently, the exporter-toolkit's web landing page doesn't allow for serving the landing page on anything other than "/" (returns 404) so I had to replace the landing page section of code in this exporter with some HTML like blackbox_exporter is doing.

With that in mind, I guess you could consider this a proof-of-concept pull request as it does change the existing implementation of the landing page - and because of this I don't expect this pull request to get merged as-is - however, it appears all functionality is retained.

I would consider these additional args to be "must-have" features to bring snmp_exporter closer to feature parity with the other exporters. I needed to serve this exporter behind a prefix like I'm doing with the other exporters, so I figured I would make an attempt at this update myself, as it does appear to be something other people have been wanting for quite some time. See: #648

fyi: this is my first pull request on GitHub, so hopefully I haven't done anything too awful here 😅

@kwilt kwilt force-pushed the web-external-url branch from 96af8da to 7be5d67 Compare January 2, 2025 18:41
@kwilt kwilt force-pushed the web-external-url branch from 7be5d67 to d99c9c6 Compare January 2, 2025 18:43
@kwilt kwilt marked this pull request as draft January 2, 2025 18:44
@kwilt kwilt marked this pull request as ready for review January 2, 2025 18:45
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.

1 participant