mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-16 05:20:22 +08:00
* feat(server): add Prometheus metrics infrastructure and gRPC/HTTP request metrics Add metrics exposition via a dedicated server port (--metrics-port, default disabled) following the same optional-listener pattern as the health port. The metrics crate facade records counters and histograms in the MultiplexedService hot path, and a PrometheusHandle renders them at GET /metrics on the dedicated port. Metrics added: - openshell_server_grpc_requests_total (counter: method, code) - openshell_server_grpc_request_duration_seconds (histogram: method, code) - openshell_server_http_requests_total (counter: path, status) - openshell_server_http_request_duration_seconds (histogram: path, status) * feat(helm): add metrics port to openshell-server helm chart Expose the Prometheus metrics endpoint in the helm chart by adding service.metricsPort (default 9090) to values, the --metrics-port arg and container port to the statefulset, and a metrics service port. Set metricsPort to 0 to disable.
29 lines
849 B
YAML
29 lines
849 B
YAML
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "openshell.fullname" . }}
|
|
labels:
|
|
{{- include "openshell.labels" . | nindent 4 }}
|
|
spec:
|
|
type: {{ .Values.service.type }}
|
|
ports:
|
|
- port: {{ .Values.service.port }}
|
|
targetPort: grpc
|
|
protocol: TCP
|
|
name: grpc
|
|
appProtocol: grpc
|
|
{{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }}
|
|
nodePort: {{ .Values.service.nodePort }}
|
|
{{- end }}
|
|
{{- if .Values.service.metricsPort }}
|
|
- port: {{ .Values.service.metricsPort }}
|
|
targetPort: metrics
|
|
protocol: TCP
|
|
name: metrics
|
|
{{- end }}
|
|
selector:
|
|
{{- include "openshell.selectorLabels" . | nindent 4 }}
|