PrometheusServed
Event Re-added v101 → v127, v133 → v219, v233 → v265, v273 → v277, v290 → current #29Emitted when a neuron updates their Prometheus metrics endpoint.
View events on chainThe Big Picture
Prometheus is a standard metrics format. By serving a Prometheus endpoint, you allow monitoring tools to collect performance data from your neuron. This is optional but valuable for transparency, debugging, and community dashboards that track network health.
Why This Matters
Publishing Prometheus metrics shows transparency and helps the ecosystem. Monitoring services can track your uptime, response times, and health. Some delegation services use this data to recommend validators. It's not required, but it's a good practice.
Example Scenario
You run a validator and want to be featured on taostats. You serve your Prometheus endpoint at port 9090. PrometheusServed fires, and now monitoring services can discover your metrics endpoint from chain data. Your uptime and performance become publicly trackable.
Common Questions
- Is serving Prometheus required?
- No, it's optional. But if you want third-party monitoring, delegation services, or community dashboards to track your performance, you need to publish it.
- What metrics should I expose?
- Standard bittensor metrics include response times, query counts, success rates, and system health. The bittensor SDK includes default Prometheus exporters.
Use Cases
- Publish metrics endpoint for monitoring
- Enable third-party monitoring services
- Build network-wide performance dashboards
- Track miner/validator health metrics
How to Use This Event
- → Scrape endpoints to build monitoring dashboards
- → Track uptime and performance across the network
- → Identify neurons with good/bad reliability
From Chain Metadata
the prometheus server information is added to the network.
Triggers
Emitted by
Preconditions
- Caller is registered on the subnet
- Valid IP/port provided
- Serving not rate limited
Effects
Storage Modified
Postconditions
- Prometheus storage updated with new endpoint
Side Effects
- Monitoring systems can discover metrics endpoint
Event Data
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Subscribe to PrometheusServed events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("SubtensorModule") &&
event.method === "PrometheusServed"
)
.forEach(({ event }) => {
console.log("PrometheusServed:", event.data.toHuman());
});
});On-Chain Activity
Occasional use
#50 most emitted event
As of block 7,429,232
Version History
Runtime Info
View Source- Pallet Index
- 7
- Event Index
- 29
- First Version
- v101
- Current Version
- v393