Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Mitsuki’s documented automatic instrumentation requires both an application decorator and configuration: add @Instrumented() to the application class, then set instrumentation.enabled: true and metrics.enabled: true in application.yml. Install Mitsuki with its optional metrics extra to sample process CPU and memory. The application exposes a JSON summary at /metrics and Prometheus-format metrics at /metrics/prometheus. These details are from David Landup’s Mitsuki feature article published September 29, 2026, and describe the documented implementation rather than an independent test. Read the feature article.

Enable Mitsuki instrumentation

The documented setup combines application-level instrumentation with configuration that enables recording and the metrics endpoints.

  1. Install the metrics extra: pip install "mitsuki[metrics]". The optional metrics extra supplies psutil, which the article identifies for process CPU and memory sampling.
  2. Decorate the application class: import Instrumented from the appropriate Mitsuki module in your project and add @Instrumented() above the application class. The feature article’s example uses this decorator at application level.
  3. Enable both settings in application.yml:
    instrumentation:
      enabled: true
    metrics:
      enabled: true
  4. Start the application and request the metrics endpoints from a client that is permitted by your endpoint access policy.

The feature article says the two configuration settings are needed for recording and for the metrics registry and endpoints. It also describes decorating individual components as an option; application-level decoration is described as covering controllers, services, repositories, and CRUD repositories.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What Mitsuki records

According to the feature article, the instrumentation wraps public methods at startup. Methods beginning with an underscore, static methods, class methods, and properties are excluded. The author also says repository-generated methods and custom repository methods are recorded. The metric names and behavior below reflect the article’s description, not independently verified behavior across Mitsuki versions.

Area What the article says is recorded
HTTP requests http_requests_total, a counter labelled by method, path, and status; and http_request_duration_seconds, a histogram labelled by method and path.
Instrumented components Call counts and duration metrics for component methods, with component, method, and status labels as shown in the article.
Scheduled tasks Task execution counts and durations, plus gauges for running tasks.
Process memory and CPU system_memory_bytes and system_cpu_percent, described as sampled every five seconds when the metrics extra is available.
Traced Python memory system_traced_memory_bytes, described as sampled every five seconds only when track_memory: true is enabled. This optional tracemalloc-based debugging aid can slow allocations.

Traced memory is not described as enabled by default. The article’s example request counts and latency averages are demo output from one run, not representative performance figures.

Choose an output endpoint

  • /metrics: JSON summary containing totals and averages accumulated since startup.
  • /metrics/prometheus: Prometheus text exposition, including metric series and histograms.

For Prometheus collection, configure a scrape target pointing to the application’s reachable host and the /metrics/prometheus path. The built-in endpoint is the export surface; Prometheus and Grafana are optional tools for collecting and viewing it, not prerequisites for enabling Mitsuki’s metrics.

Connect Prometheus and Grafana

A related tutorial dated October 3, 2026 demonstrates a Mitsuki application with Prometheus scraping at a five-second interval and Grafana dashboards provisioned to display application metrics. That is one integration example, not a requirement imposed by the endpoints. See the Prometheus and Grafana walkthrough for its stack configuration.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prometheus can scrape the text endpoint, after which Grafana can use Prometheus as a data source for dashboards. A five-second interval is the interval in that tutorial, not a universal recommendation; choose a scrape interval appropriate to your workload and monitoring needs.

Understand storage and worker limitations

The feature article describes the metrics as in-memory and per process. Values reset when that process restarts; the endpoint is not a durable, globally aggregated store. In a multi-worker setup, a scrape may reach one worker and expose that worker’s totals, so successive scrapes can appear to jump among worker-specific values rather than show one combined counter.

If you need a coherent view across workers or continuity across restarts, do not assume the described endpoint provides either. Validate how your deployed Mitsuki version and server configuration route scrapes, and design aggregation and retention accordingly.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Restrict access to the metrics endpoints

The article warns that the endpoints can reveal route tables, component names, and traffic volumes. Its example uses metrics.allowed_ips; an empty list is described as allowing all addresses. Restrict access to trusted monitoring clients and avoid exposing the endpoints publicly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is a specific proxy caveat in the article’s Mitsuki 0.2.0 Granian-engine setup: the application may see the reverse proxy or load balancer as the client address. An allowlist that trusts that proxy address could therefore permit requests from every user routed through it. Verify how your version obtains client IP addresses and how your proxy forwards them before relying on an IP allowlist.

How this relates to OpenTelemetry

OpenTelemetry’s Python documentation describes a separate ecosystem of APIs, SDKs, instrumentation libraries, and exporters. It treats traces and metrics as stable components on the page, while logs are described as in development; the page was last modified July 22, 2026. The Mitsuki feature article does not establish that its built-in instrumentation uses OpenTelemetry, so compatibility or implementation should not be inferred from that documentation. OpenTelemetry Python documentation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.