Add args to serve application behind a route prefix/external URL #1328
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 😅