pravega / pravega-operator

Pravega Kubernetes Operator
Apache License 2.0
41 stars 38 forks source link

Enable segment store rest service for prometheus support #588

Open alfred-landrum opened 2 years ago

alfred-landrum commented 2 years ago

Description

I'd like to enhance the operator so that if the segment store rest server is enabled via config options, a "rest" port is added to the segment store service.

I have an open PR to add Prometheus support, https://github.com/pravega/pravega/pull/6360 . That adds a "/prometheus" route to the rest service of both the controller and segment store, so that Prometheus can scrape the metrics from both services.

I documented the service monitor objects needed for a Prometheus operator: https://github.com/pravega/pravega/pull/6360#issuecomment-947908146 . The peculiar relabeling workaround for the segment store is needed since the segment store service doesn't have an explicit "rest" port.

Importance

This isn't a blocker to allowing Prometheus support, so it's technically a nice to have. However, given the popularity of Prometheus, I think it makes sense to make enabling Prometheus support as easy as possible.

Location

My initial thought on how to implement this would be to modify the MakeSegmentStoreHeadlessService and reconcileSegmentStoreService functions so that if the pravegaservice.rest.listener.enable config is set, a rest port is added to the headless service. If there are better ways, please let me know!

anishakj commented 2 years ago

@alfred-landrum The above approach looks good to me. Would you like to create a PR for the same?