nabeards
01/14/2025, 5:51 PMkube-prometheus-stack seems to just have an enabled/disabled setting. any chance we can specify ports there?RunLLM
01/14/2025, 5:51 PMmetricsPort in the function runtime factory configurations. This allows you to specify a custom port for Prometheus scraping.
Would you like more details on how to implement this configuration?
Sources:
- KubernetesRuntimeTest.java π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.nabeards
01/14/2025, 5:53 PMRunLLM
01/14/2025, 5:53 PMKubernetesRuntimeTest.java, the assertMetricsPortConfigured method demonstrates how to set a custom metrics port. You can pass a map with the key metricsPort and the desired port number as the value.
2. Initialize the Kubernetes Runtime Factory: Create an instance of KubernetesRuntimeFactory and initialize it with the WorkerConfig that includes your custom metricsPort.
3. Set Annotations for Prometheus Scraping: Ensure that the Kubernetes pod template includes annotations for Prometheus to scrape metrics. The annotations should include prometheus.io/port set to your specified port and prometheus.io/scrape set to true.
Here's a simplified example in Java:
MapString, Object functionRuntimeFactoryConfigs = Collections.singletonMap("metricsPort", 12345);
KubernetesRuntimeFactory kubernetesRuntimeFactory = new KubernetesRuntimeFactory();
WorkerConfig workerConfig = new WorkerConfig();
workerConfig.setFunctionRuntimeFactoryConfigs(functionRuntimeFactoryConfigs);
kubernetesRuntimeFactory.initialize(workerConfig, ...);
This configuration will ensure that the specified port is used for Prometheus metrics scraping.
Sources:
- KubernetesRuntimeTest.java π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.nabeards
01/14/2025, 5:55 PMRunLLM
01/14/2025, 5:55 PMvalues.yaml file for the kube-prometheus-stack Helm chart might not be straightforward, as the chart typically uses default configurations for enabling or disabling features. However, you can customize the Prometheus configuration by using additional configuration files or by modifying the Helm chart templates.
Would you like more detailed guidance on how to customize the Helm chart for your specific needs?
Sources:
- https://github.com/streamnative/oxia/pull/310 π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.nabeards
01/14/2025, 5:55 PMRunLLM
01/14/2025, 5:55 PMkube-prometheus-stack Helm chart to specify desired ports for Prometheus, you can follow these steps:
1. Create a Custom Values File: Start by creating a custom values.yaml file where you can override the default settings provided by the Helm chart. This file will allow you to specify custom configurations, including ports.
2. Modify the Prometheus Configuration: In your custom values.yaml, you can specify the desired ports by adding or modifying the configuration under the prometheus section. For example, you can set the service and serviceMonitor configurations to specify the ports you want Prometheus to use.
3. Apply the Custom Values File: When installing or upgrading the Helm chart, use the -f flag to apply your custom values.yaml file. This will ensure that your specified configurations are used.
Here's an example of what your custom values.yaml might look like:
prometheus:
service:
port: 9090
serviceMonitor:
enabled: true
additionalLabels:
release: prometheus
endpoints:
- port: metrics
interval: 30s
4. Install or Upgrade the Helm Chart: Use the following command to install or upgrade the Helm chart with your custom values:
helm upgrade --install prometheus prometheus-community/kube-prometheus-stack -f custom-values.yaml
This approach allows you to specify custom ports and other configurations for Prometheus within the kube-prometheus-stack Helm chart.
Sources:
- https://github.com/streamnative/oxia/pull/310 π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.