agent icon indicating copy to clipboard operation
agent copied to clipboard

(flow) node_exporter integration

Open captncraig opened this issue 1 year ago • 1 comments

Trying to reuse the maximum amount of code from the existing integration. The flow version simply adds hcl tags to the existing config type and invokes the integration directly.

Http handlers are a new frontier here. My first attempt here just adds a subtree at /component/{id}/ that gets delegated to the component itself if it implements HTTPComponent. This is functioning with this config:

integration "node_exporter" "n_ex_test"{
  
}

you can read metrics at http://localhost:12345/component/integration.node_exporter.n_ex_test/metrics.

This is a bit ugly, but it does work. If we wanted to go to in-memory pipes or whatever, the components shouldn't need to change anything, since they just expose a handler.

One piece I still haven't solved is how the component itself will be aware of this subpath to create targets for itself.

Fixes #1684

captncraig avatar Jul 07 '22 18:07 captncraig

Should we add metrics like the added in this PR?

marctc avatar Aug 09 '22 15:08 marctc