PrometheusServed

Event Re-added v101 → v127, v133 → v219, v233 → v265, v273 → v277, v290 → current #29

Emitted when a neuron updates their Prometheus metrics endpoint.

View events on chain
Useful for: minersvalidatorsanalyticsdevelopers

The 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

#NameTypeDescription
0
arg0
u16 Event field #0 (u16)
1
arg1
AccountId Event field #1 (AccountId) (hex -> SS58)

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

Emission Frequency
●●○○○○ Moderate 10K–100K emissions

Occasional use

#50 most emitted event

As of block 7,429,232

Version History

v101 block 1 2 args
v133 block 1,404,224 2 args
v233 block 4,920,350 2 args
v273 block 5,659,032 2 args
v290 block 5,947,548 2 args Current

Runtime Info

View Source
Pallet Index
7
Event Index
29
First Version
v101
Current Version
v393