pip_services3_prometheus 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

Pip.Services Logo #

Pip.Services Prometheus components for Dart #

This component library is a part of the Pip.Services project. It contains the following Prometheus components: PrometheusCounters and PrometheusMetricsService

Quick Links:

Acknowledgements #

The library is created and maintained by

  • Sergey Seroukhov
  • Levichev Dmitry

The documentation is written by:

  • Levichev Dmitry
  • Mark Makarychev

Prometheus components for Pip.Services in Node.js Changelog #

3.0.5 (2020-04-08) #

Bug fixes #

  • Fixed enabling/disabling of metrics pushing by a configuration parameter

3.0.4 (2020-04-04) #

Features #

  • Prometheus updates to account for labels generated by the RPC and AWS Queue modules

3.0.0 (2018-08-21) #

Breaking Changes #

  • Moved to a separate package

1.2.0 (2018-08-10) #

Features #

  • Added RedisCache
  • Added RedisLock

1.1.0 (2018-03-26) #

Features #

  • Added PrometheusCounters and PrometheusMetricsService
  • Added labels to PrometheusCounters and PrometheusMetricsService

1.0.0 (2018-03-20) #

Features #

  • memcached Added MemcachedCache
  • memcached Added MemcachedLock
  • fluentd Added FluentdLogger
  • elasticsearch Added ElasticSearchLogger

example/main.dart

import 'package:pip_services3_commons/pip_services3_commons.dart';
import 'package:pip_services3_components/pip_services3_components.dart';

import 'package:pip_services3_prometheus/pip_services3_prometheus.dart';

void main() async {
  var restConfig = ConfigParams.fromTuples([
    'connection.protocol',
    'http',
    'connection.host',
    'localhost',
    'connection.port',
    3000
  ]);

  PrometheusMetricsService service;
  PrometheusCounters counters;
 
  service = PrometheusMetricsService();
  counters = PrometheusCounters();

  service.configure(restConfig);

  var contextInfo = ContextInfo();
  contextInfo.name = 'Test';
  contextInfo.description = 'This is a test container';

  var references = References.fromTuples([
    Descriptor('pip-services', 'context-info', 'default', 'default', '1.0'),
    contextInfo,
    Descriptor('pip-services', 'counters', 'prometheus', 'default', '1.0'),
    counters,
    Descriptor(
        'pip-services', 'metrics-service', 'prometheus', 'default', '1.0'),
    service
  ]);
  counters.setReferences(references);
  service.setReferences(references);

  await counters.open(null);
  await service.open(null);

  counters.incrementOne('test.counter1');
  counters.stats('test.counter2', 2);
  counters.last('test.counter3', 3);
  counters.timestampNow('test.counter4');

  // all metrics accessable on http://localhost:3000/metrics
  // configure the Prometheus service to poll this host
  // ...

  await service.close(null);
  await counters.close(null);
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  pip_services3_prometheus: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:pip_services3_prometheus/pip_services3_prometheus.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

We analyzed this package on Jul 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Analysis suggestions

Package not compatible with SDK flutter

Because it is not compatible with any of the supported runtimes: flutter-native, flutter-web

Package not compatible with runtime flutter-native on android

Because of the import of dart:mirrors via the import chain package:pip_services3_prometheus/pip_services3_prometheus.dartpackage:pip_services3_prometheus/src/services/services.dartpackage:pip_services3_prometheus/src/services/PrometheusMetricsService.dartpackage:pip_services3_prometheus/src/count/PrometheusCounterConverter.dartpackage:pip_services3_commons/pip_services3_commons.dartpackage:pip_services3_commons/src/validate/validate.dartpackage:pip_services3_commons/src/validate/ProjectionParamsSchema.dartpackage:pip_services3_commons/src/validate/ArraySchema.dartpackage:pip_services3_commons/src/reflect/ObjectReader.dartpackage:pip_services3_commons/src/reflect/PropertyReflector.dartdart:mirrors

Package not compatible with runtime flutter-native on ios

Because of the import of dart:mirrors via the import chain package:pip_services3_prometheus/pip_services3_prometheus.dartpackage:pip_services3_prometheus/src/services/services.dartpackage:pip_services3_prometheus/src/services/PrometheusMetricsService.dartpackage:pip_services3_prometheus/src/count/PrometheusCounterConverter.dartpackage:pip_services3_commons/pip_services3_commons.dartpackage:pip_services3_commons/src/validate/validate.dartpackage:pip_services3_commons/src/validate/ProjectionParamsSchema.dartpackage:pip_services3_commons/src/validate/ArraySchema.dartpackage:pip_services3_commons/src/reflect/ObjectReader.dartpackage:pip_services3_commons/src/reflect/PropertyReflector.dartdart:mirrors

Package not compatible with runtime flutter-native on linux

Because of the import of dart:mirrors via the import chain package:pip_services3_prometheus/pip_services3_prometheus.dartpackage:pip_services3_prometheus/src/services/services.dartpackage:pip_services3_prometheus/src/services/PrometheusMetricsService.dartpackage:pip_services3_prometheus/src/count/PrometheusCounterConverter.dartpackage:pip_services3_commons/pip_services3_commons.dartpackage:pip_services3_commons/src/validate/validate.dartpackage:pip_services3_commons/src/validate/ProjectionParamsSchema.dartpackage:pip_services3_commons/src/validate/ArraySchema.dartpackage:pip_services3_commons/src/reflect/ObjectReader.dartpackage:pip_services3_commons/src/reflect/PropertyReflector.dartdart:mirrors

Package not compatible with runtime flutter-native on macos

Because of the import of dart:mirrors via the import chain package:pip_services3_prometheus/pip_services3_prometheus.dartpackage:pip_services3_prometheus/src/services/services.dartpackage:pip_services3_prometheus/src/services/PrometheusMetricsService.dartpackage:pip_services3_prometheus/src/count/PrometheusCounterConverter.dartpackage:pip_services3_commons/pip_services3_commons.dartpackage:pip_services3_commons/src/validate/validate.dartpackage:pip_services3_commons/src/validate/ProjectionParamsSchema.dartpackage:pip_services3_commons/src/validate/ArraySchema.dartpackage:pip_services3_commons/src/reflect/ObjectReader.dartpackage:pip_services3_commons/src/reflect/PropertyReflector.dartdart:mirrors

Package not compatible with runtime flutter-native on windows

Because of the import of dart:mirrors via the import chain package:pip_services3_prometheus/pip_services3_prometheus.dartpackage:pip_services3_prometheus/src/services/services.dartpackage:pip_services3_prometheus/src/services/PrometheusMetricsService.dartpackage:pip_services3_prometheus/src/count/PrometheusCounterConverter.dartpackage:pip_services3_commons/pip_services3_commons.dartpackage:pip_services3_commons/src/validate/validate.dartpackage:pip_services3_commons/src/validate/ProjectionParamsSchema.dartpackage:pip_services3_commons/src/validate/ArraySchema.dartpackage:pip_services3_commons/src/reflect/ObjectReader.dartpackage:pip_services3_commons/src/reflect/PropertyReflector.dartdart:mirrors

Package not compatible with runtime flutter-web on web

Because of the import of dart:mirrors via the import chain package:pip_services3_prometheus/pip_services3_prometheus.dartpackage:pip_services3_prometheus/src/services/services.dartpackage:pip_services3_prometheus/src/services/PrometheusMetricsService.dartpackage:pip_services3_prometheus/src/count/PrometheusCounterConverter.dartpackage:pip_services3_commons/pip_services3_commons.dartpackage:pip_services3_commons/src/validate/validate.dartpackage:pip_services3_commons/src/validate/ProjectionParamsSchema.dartpackage:pip_services3_commons/src/validate/ArraySchema.dartpackage:pip_services3_commons/src/reflect/ObjectReader.dartpackage:pip_services3_commons/src/reflect/PropertyReflector.dartdart:mirrors

Package not compatible with runtime native-aot

Because of the import of dart:mirrors via the import chain package:pip_services3_prometheus/pip_services3_prometheus.dartpackage:pip_services3_prometheus/src/services/services.dartpackage:pip_services3_prometheus/src/services/PrometheusMetricsService.dartpackage:pip_services3_prometheus/src/count/PrometheusCounterConverter.dartpackage:pip_services3_commons/pip_services3_commons.dartpackage:pip_services3_commons/src/validate/validate.dartpackage:pip_services3_commons/src/validate/ProjectionParamsSchema.dartpackage:pip_services3_commons/src/validate/ArraySchema.dartpackage:pip_services3_commons/src/reflect/ObjectReader.dartpackage:pip_services3_commons/src/reflect/PropertyReflector.dartdart:mirrors

Package not compatible with runtime web

Because of the import of dart:mirrors via the import chain package:pip_services3_prometheus/pip_services3_prometheus.dartpackage:pip_services3_prometheus/src/services/services.dartpackage:pip_services3_prometheus/src/services/PrometheusMetricsService.dartpackage:pip_services3_prometheus/src/count/PrometheusCounterConverter.dartpackage:pip_services3_commons/pip_services3_commons.dartpackage:pip_services3_commons/src/validate/validate.dartpackage:pip_services3_commons/src/validate/ProjectionParamsSchema.dartpackage:pip_services3_commons/src/validate/ArraySchema.dartpackage:pip_services3_commons/src/reflect/ObjectReader.dartpackage:pip_services3_commons/src/reflect/PropertyReflector.dartdart:mirrors

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
angel_framework ^2.1.1 2.1.1
http ^0.12.0 0.12.1
pip_services3_commons >=1.0.4 <2.0.0 1.0.11
pip_services3_components >=1.0.2 <2.0.0 1.0.6
pip_services3_rpc >=1.0.1 <2.0.0 1.0.7
Transitive dependencies
angel_container 1.1.0
angel_http_exception 1.1.0
angel_model 1.0.3
angel_route 3.1.0+1
charcode 1.1.3
code_buffer 1.0.1
collection 1.14.13
combinator 1.1.0
convert 2.1.1
crypto 2.1.5
dart2_constant 1.0.2+dart2
file 5.2.1
http2 1.0.0
http_parser 3.1.4
http_server 0.9.8+3
intl 0.16.1
logging 0.11.4
matcher 0.12.8
merge_map 1.0.2
meta 1.1.8
mime 0.9.6+3
mock_request 1.0.7
mustache4dart2 0.1.0
path 1.7.0
pedantic 1.9.0 1.9.1
quiver 2.1.3
quiver_hashcode 2.0.0
recase 2.0.1 3.0.0
source_span 1.7.0
sprintf 4.0.2
stack_trace 1.9.5
string_scanner 1.0.5
term_glyph 1.1.0
tuple 1.0.3
typed_data 1.2.0
uuid 2.2.0
yaml 2.2.1
Dev dependencies
test >=1.14.2 <2.0.0