Open abeach-nr opened 2 years ago
another option is modifying zpages to include json version of the /pipelinez and other endpoints
This sounds like the way to go if it would meet your needs. zpages
is already intended to provide debugging information and it could certainly be useful to provide it in a more easily machine readable format. Would love to see Accept
-based content negotiation on those resources.
@Aneurysm9 extensions would be preferable, as I wouldn't need another process to then consume that endpoint. An extension could say, log the DAG representation of the pipelines, or the extension could instrument that DAG information and push to to another server.
There is another option without changing the Host
interface.
currently, the Host
interface does not implement the RegisterZPages
method.
the 'zpagesexention' gets around this because extensions use a host wrapper
that adds the RegisterZPages
and then there is a type cast. https://github.com/open-telemetry/opentelemetry-collector/blob/e0eea95c1a6913741fbfe622ea41dfa33ecf8df2/extension/zpagesextension/zpagesextension.go#L70
I could add GetPipelines
to the host wrapper and do the same interface type casting approach the zpagesextension does.
However, this approach seems like it should be avoided: https://github.com/open-telemetry/opentelemetry-collector/blob/e0eea95c1a6913741fbfe622ea41dfa33ecf8df2/service/internal/components/host_wrapper.go#L47
What specific information are you trying to discover about the pipelines?
This capability would directly expose a substantial portion of the collector's internals. I think we should avoid this if at all possible and instead provide targeted access for specific use cases.
@djaglowski ultimately I would like to aggregate collector metrics (Prometheus metrics from the collector) on a pipeline level for the purposes of monitoring pipelines within a collector. I want to be able to look at individual component metrics but in the larger context of a pipeline. With the current collector metrics, there is no way to associate a components metrics to its pipeline. Zpages only really provides the structure of the pipeline, which is a start.
I think that points to a need to augment the metrics (and preferably also log) data with this information. I tried doing this earlier with logs, but because receivers and exporters can be shared across many pipelines I was only able to do so for processors.
Is your feature request related to a problem? Please describe. I am trying to build an extension to provide debugging information about pipelines.
I believe it is only possible to debug pipelines via zpagesexention as an http endpoint
/debug/pipelinez
https://github.com/open-telemetry/opentelemetry-collector/blob/e0eea95c1a6913741fbfe622ea41dfa33ecf8df2/service/zpages.go#L36Describe the solution you'd like I would like to add a
GetPipelines
method to theHost
interface:https://github.com/open-telemetry/opentelemetry-collector/blob/e0eea95c1a6913741fbfe622ea41dfa33ecf8df2/component/host.go#L23
With that interface, i can build an exention with the following:
Describe alternatives you've considered another option is modifying zpages to include json version of the /pipelinez and other endpoints