Coder Social home page Coder Social logo

Comments (16)

roidelapluie avatar roidelapluie commented on June 10, 2024 1

Thanks for creating a request.

I am not sure I want this because configtest is an expensive and slow operation.

from apache_exporter.

cryptobioz avatar cryptobioz commented on June 10, 2024 1

Well, we're facing a design problem. The exporter can, and it's a good thing, be used remotely. It doesn't depend on anything and only rely on the HTTP endpoint provided by Apache. It can be deployed next to Apache or on an other container or even on an other machine.

If we add the feature to expose the configtest result, we add an important dependency in this exporter. It will have to be deployed next to Apache in order to work properly because it will need access to the configuration files and the apachectl binary.

Therefore, I'm not sure it's a good thing to add this feature because it will begin to change the design of this exporter...

from apache_exporter.

roidelapluie avatar roidelapluie commented on June 10, 2024 1

Please note that they can break the configuration in other ways that would not be caugh by this (e.g. removing vhosts). So that would anyway not be a complete solution for you.

from apache_exporter.

cryptobioz avatar cryptobioz commented on June 10, 2024

Indeed, the other solution would be to run the configtest regularly instead running it at every request.

from apache_exporter.

mcanevet avatar mcanevet commented on June 10, 2024

We tested it with a quite big configuration, and it took a few tens of milliseconds.
Maybe an opt-in parameter would be acceptable?

from apache_exporter.

roidelapluie avatar roidelapluie commented on June 10, 2024

an opt-in flag seems reasonable

from apache_exporter.

mcanevet avatar mcanevet commented on June 10, 2024

I'm wondering if there's a way to ask the currently running apachectl process to launch the configtest via a signal or something else to avoid creating a new one.

from apache_exporter.

Lusitaniae avatar Lusitaniae commented on June 10, 2024

Not sure that's gonna work

apachectl is a front end to the Apache HyperText Transfer Protocol (HTTP) server.

Second, apachectl can act as a SysV init script, taking simple one-word arguments like start, restart, and stop, and translating them into appropriate signals to httpd.

and when doing configtest, httpd is launched, reads the config file and exits:

Run syntax tests for configuration files only. The program immediately exits after these syntax parsing tests with either a return code of 0 (Syntax OK) or return code not equal to 0 (Syntax Error).

But please look more into this, only had a brief look at this

from apache_exporter.

Lusitaniae avatar Lusitaniae commented on June 10, 2024

from apache_exporter.

roidelapluie avatar roidelapluie commented on June 10, 2024

I do think that it is an issue that would be better covered by node_exporter file collector

from apache_exporter.

cryptobioz avatar cryptobioz commented on June 10, 2024

When you talk about "node_exporter file collector", do you mean the textfile collector?

from apache_exporter.

roidelapluie avatar roidelapluie commented on June 10, 2024

Yes, calling external commands from the exporter exposes it to a new range of security threats.

from apache_exporter.

roidelapluie avatar roidelapluie commented on June 10, 2024

Also it has serious limitations like you should run the exporter with the same user as apache and use apache default path for configuration

from apache_exporter.

cryptobioz avatar cryptobioz commented on June 10, 2024

Indeed, I'm not a big fan of this solution too but I'd prefer to have a kind of real exporter instead a cronjob. However, you're totally right regarding the security issues and limitations that this kind of workflow involves so I think your solution is the best.

from apache_exporter.

roidelapluie avatar roidelapluie commented on June 10, 2024

In general, configtest is run by e.g. config management before putting the new file in place, so it looks like the process to modify the file should run the configtest too and rollback wrong configs..

from apache_exporter.

cryptobioz avatar cryptobioz commented on June 10, 2024

Yeah, of course. But in our case, developers have the ability to modify the configuration files so they might break something and we would like to be informed as soon as possible. We will both agree to say that this is not a good practice but we don't have choice here.

from apache_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.