Skip to content
pubscout

prometheus_client

1.0.0+1, released 4 years ago by tentaclelabs.com

Dart implementation of the Prometheus client library providing metrics.

WASM-ready
$ flutter pub add prometheus_client
Source repository

What it does

Provides Prometheus metric types like counters, gauges, histograms, and summaries for Dart applications. Allows registering and collecting metrics to export them in the standard text format.

AI-written summary of version 1.0.0+1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to instrument a Dart backend or server application with Prometheus metrics
  • You want to expose runtime and custom metrics for scraping

Skip it when

  • You are building a client-side Flutter app without a backend server endpoint for scraping metrics

Strengths

  • Supports standard Prometheus metric types (Counter, Gauge, Histogram, Summary)
  • Includes plug-in ready metrics for the Dart runtime
  • Allows dynamic metric updates using collect callbacks

Weaknesses

  • Limited set of runtime metrics compared to other languages due to Dart platform limitations

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1

not documented

import 'package:prometheus_client/prometheus_client.dart';

final requestsCounter = Counter(
  name: 'metric_requests_total',
  help: 'The total amount of requests of the metrics.',
)..register();

requestsCounter.inc();