summaryrefslogtreecommitdiff
path: root/vendor/open-telemetry/api/Metrics/MeterInterface.php
blob: 6e06d9085ade3e8359d70c8ccefcd6f33e98dd1a (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php

declare(strict_types=1);

namespace OpenTelemetry\API\Metrics;

interface MeterInterface
{

    /**
     * Creates a `Counter`.
     *
     * @param string $name name of the instrument
     * @param string|null $unit unit of measure
     * @param string|null $description description of the instrument
     * @return CounterInterface created instrument
     *
     * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#counter-creation
     */
    public function createCounter(
        string $name,
        ?string $unit = null,
        ?string $description = null
    ): CounterInterface;

    /**
     * Creates an `ObservableCounter`.
     *
     * @param string $name name of the instrument
     * @param string|null $unit unit of measure
     * @param string|null $description description of the instrument
     * @param callable ...$callbacks responsible for reporting measurements
     * @return ObservableCounterInterface created instrument
     *
     * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#asynchronous-counter-creation
     */
    public function createObservableCounter(
        string $name,
        ?string $unit = null,
        ?string $description = null,
        callable ...$callbacks
    ): ObservableCounterInterface;

    /**
     * Creates a `Histogram`.
     *
     * @param string $name name of the instrument
     * @param string|null $unit unit of measure
     * @param string|null $description description of the instrument
     * @return HistogramInterface created instrument
     *
     * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#histogram-creation
     */
    public function createHistogram(
        string $name,
        ?string $unit = null,
        ?string $description = null
    ): HistogramInterface;

    /**
     * Creates an `ObservableGauge`.
     *
     * @param string $name name of the instrument
     * @param string|null $unit unit of measure
     * @param string|null $description description of the instrument
     * @param callable ...$callbacks responsible for reporting measurements
     * @return ObservableGaugeInterface created instrument
     *
     * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#asynchronous-gauge-creation
     */
    public function createObservableGauge(
        string $name,
        ?string $unit = null,
        ?string $description = null,
        callable ...$callbacks
    ): ObservableGaugeInterface;

    /**
     * Creates an `UpDownCounter`.
     *
     * @param string $name name of the instrument
     * @param string|null $unit unit of measure
     * @param string|null $description description of the instrument
     * @return UpDownCounterInterface created instrument
     *
     * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#updowncounter-creation
     */
    public function createUpDownCounter(
        string $name,
        ?string $unit = null,
        ?string $description = null
    ): UpDownCounterInterface;

    /**
     * Creates an `ObservableUpDownCounter`.
     *
     * @param string $name name of the instrument
     * @param string|null $unit unit of measure
     * @param string|null $description description of the instrument
     * @param callable ...$callbacks responsible for reporting measurements
     * @return ObservableUpDownCounterInterface created instrument
     *
     * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#asynchronous-updowncounter-creation
     */
    public function createObservableUpDownCounter(
        string $name,
        ?string $unit = null,
        ?string $description = null,
        callable ...$callbacks
    ): ObservableUpDownCounterInterface;
}