Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
[Feature Request] Add support for creating metrics from HTTP probe output #297
Comments
|
Mind if I take this one? I just learned Go and I'm eager to contribute. |
|
@mfboulos That's excellent. Logic for this should look very similar to how we do it for external probes: In fact, we should try to refactor the config and code in such a way that we can use them for both -- HTTP and external probe. I have a pending change to move parseValue from payload_metrics.go to metrics package, so it will be better to wait for that change (by Tue). I'll also think about sharing config and code in the meantime. |
|
That makes sense, configuration and metrics should be decoupled from the probe types. I'll take the time to familiarize myself with the workflow and such. |
|
I think external and payload parsing logic are sufficiently decoupled now. External probe initializes a payload parser at the time initialization: cloudprober/probes/external/external.go Line 156 in eaaf785 It updates payload metrics per target using this parser: cloudprober/probes/external/external.go Line 396 in eaaf785 I think we'd want to do something similar for HTTP probes. |
|
Sorry it took me so long to get around to this, I've been working on a personal project. Anyways, I'm having a bit of trouble with a couple things. Considering I've never used cloudprober at all, it's a bit difficult for me to grasp what's going on throughout, so bear with me. It feels like the payload metric parsing is still somewhat tightly coupled with the external probe, since If I'm missing something that indicates that they're indeed not as tightly coupled as I'm seeing, then it may be due to the fact that I'm just not entirely sure what metrics we're passing from the http probe results to begin with. Any further clarity on those fronts would help me immensely in resolving this issue. |
|
payloadParser.PayloadMetrics expects payload to just be a text that looks like this: For external probe it's produced by either running an external command: cloudprober/probes/external/external.go Line 522 in 5d8563a or by sending a probe request to probe server: cloudprober/probes/external/external.go Line 454 in 5d8563a In case of HTTP probe, payload will be HTTP response body in the similar format that I described above. Currently we are not parsing HTTP response body (except for the option -- export_response_as_metrics). (Just FYI: I am going to be away from work for next 6 days. I'll read your response after that.) |
|
Alright, that makes sense! I've added a couple optional fields to the config proto to mirror the changes on the external probe, which should allow configuration with the same level of freedom. However, I'm having a bit of trouble with This is pretty much the last blocker before I fully hash this out. |
|
There is a script in tools directory to generate protobuf code, did you give that a try? |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

Cloudprober supports building additional metrics (other than the default ones) from external probe output. We could possible do the same for HTTP probe.