1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
MetricReader configuration scenarios
====================================
These examples show how to customize the metrics that are output by the SDK using configuration on metric readers. There are multiple examples:
* preferred_aggregation.py: Shows how to configure the preferred aggregation for metric instrument types.
* preferred_temporality.py: Shows how to configure the preferred temporality for metric instrument types.
* preferred_exemplarfilter.py: Shows how to configure the exemplar filter.
* synchronous_gauge_read.py: Shows how to use `PeriodicExportingMetricReader` in a synchronous manner to explicitly control the collection of metrics.
The source files of these examples are available :scm_web:`here <docs/examples/metrics/reader/>`.
Installation
------------
.. code-block:: sh
pip install -r requirements.txt
Run the Example
---------------
.. code-block:: sh
python <example_name>.py
The output will be shown in the console.
Useful links
------------
- OpenTelemetry_
- :doc:`../../../api/metrics`
.. _OpenTelemetry: https://github.com/open-telemetry/opentelemetry-python/
|