Stay organized with collections Save and categorize content based on your preferences.
This document describes how to configure your Google Kubernetes Engine deployment so that you can use Google Cloud Managed Service for Prometheus to collect metrics from TorchServe. This document shows you how to do the following:
These instructions apply only if you are using managed collection with Managed Service for Prometheus. If you are using self-deployed collection, then see the TorchServe documentation for installation information.
These instructions are provided as an example and are expected to work in most Kubernetes environments. If you are having trouble installing an application or exporter due to restrictive security or organizational policies, then we recommend you consult open-source documentation for support.
For information about TorchServe, see TorchServe. For information about setting up TorchServe on Google Kubernetes Engine, see the GKE guide for TorchServe.
PrerequisitesTo collect metrics from TorchServe by using Managed Service for Prometheus and managed collection, your deployment must meet the following requirements:
TorchServe exposes Prometheus-format metrics automatically when the
metrics_mode
flag is specified either in the
config.properties
file or as an environment variable.
If you are setting up TorchServe yourself, then we recommend making the following additions to your config.properties
file.
If you are following the Google Kubernetes Engine document Serve scalable LLMs on GKE with TorchServe, then these additions are part of the default setup.
Also, when deploying this image to GKE, modify your deployment and service YAML to expose the added metrics port:
To verify that TorchServe is emitting metrics on the expected endpoints, do the following:
kubectl -n NAMESPACE_NAME port-forward SERVICE_NAME 8082
localhost:8082/metrics
by using the browser or the curl
utility in another terminal session.For target discovery, the Managed Service for Prometheus Operator requires a PodMonitoring resource that corresponds to TorchServe in the same namespace.
You can use the following PodMonitoring configuration:
Ensure that the values of the
port
and
matchLabels
fields match those of the TorchServe pods you want to monitor.
To apply configuration changes from a local file, run the following command:
kubectl apply -n NAMESPACE_NAME -f FILE_NAME
You can also use Terraform to manage your configurations.
Verify the configurationYou can use Metrics Explorer to verify that you correctly configured TorchServe. It might take one or two minutes for Cloud Monitoring to ingest your metrics.
To verify the metrics are ingested, do the following:
In the Google Cloud console, go to the leaderboard Metrics explorer page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
up{job="torchserve", cluster="CLUSTER_NAME", namespace="NAMESPACE_NAME"}
The Cloud Monitoring integration includes the TorchServe Prometheus Overview dashboard. Dashboards are automatically installed when you configure the integration. You can also view static previews of dashboards without installing the integration.
To view an installed dashboard, do the following:
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
To view a static preview of the dashboard, do the following:
In the Google Cloud console, go to the Integrations page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
For information about troubleshooting metric ingestion problems, see Problems with collection from exporters in Troubleshooting ingestion-side problems.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-11 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-11 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4