Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0702852

Browse files
authored
Fix View doc string (open-telemetry#2551)
1 parent b7f9157 commit 0702852

File tree

1 file changed

+49
-52
lines changed
  • opentelemetry-sdk/src/opentelemetry/sdk/_metrics

1 file changed

+49
-52
lines changed

opentelemetry-sdk/src/opentelemetry/sdk/_metrics/view.py

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -27,71 +27,68 @@
2727

2828

2929
class View:
30-
def __init__(
31-
self,
32-
instrument_type: Optional[Type[Instrument]] = None,
33-
instrument_name: Optional[str] = None,
34-
meter_name: Optional[str] = None,
35-
meter_version: Optional[str] = None,
36-
meter_schema_url: Optional[str] = None,
37-
name: Optional[str] = None,
38-
description: Optional[str] = None,
39-
attribute_keys: Optional[Set[str]] = None,
40-
aggregation: Optional[_AggregationFactory] = None,
41-
):
42-
"""
43-
A `View` configuration parameters can be used for the following
44-
purposes:
30+
"""
31+
A `View` configuration parameters can be used for the following
32+
purposes:
4533
46-
1. Match instruments: When an instrument matches a view, measurements
47-
received by that instrument will be processed.
48-
2. Customize metric streams: A metric stream is identified by a match
49-
between a view and an instrument and a set of attributes. The metric
50-
stream can be customized by certain attributes of the corresponding
51-
view.
34+
1. Match instruments: When an instrument matches a view, measurements
35+
received by that instrument will be processed.
36+
2. Customize metric streams: A metric stream is identified by a match
37+
between a view and an instrument and a set of attributes. The metric
38+
stream can be customized by certain attributes of the corresponding view.
5239
53-
The attributes documented next serve one of the previous two purposes.
40+
The attributes documented next serve one of the previous two purposes.
5441
55-
Args:
56-
instrument_type: This is an instrument matching attribute: the
57-
class the instrument must be to match the view.
42+
Args:
43+
instrument_type: This is an instrument matching attribute: the class the
44+
instrument must be to match the view.
5845
59-
instrument_name: This is an instrument matching attribute: the name
60-
the instrument must have to match the view. Wild card
61-
characters are supported. Wild card characters should not be
62-
used with this attribute if the view has also a
63-
``name`` defined.
46+
instrument_name: This is an instrument matching attribute: the name the
47+
instrument must have to match the view. Wild card characters are
48+
supported. Wild card characters should not be used with this
49+
attribute if the view has also a ``name`` defined.
6450
65-
meter_name: This is an instrument matching attribute: the name
66-
the instrument meter must have to match the view.
51+
meter_name: This is an instrument matching attribute: the name the
52+
instrument meter must have to match the view.
6753
68-
meter_version : This is an instrument matching attribute: the
69-
version the instrument meter must have to match the view.
54+
meter_version : This is an instrument matching attribute: the version
55+
the instrument meter must have to match the view.
7056
71-
meter_schema URL : This is an instrument matching attribute: the
72-
schema URL the instrument meter must have to match the view.
57+
meter_schema URL : This is an instrument matching attribute: the schema
58+
URL the instrument meter must have to match the view.
7359
74-
name: This is a metric stream customizing attribute: the name of
75-
the metric stream. If `None`, the name of the instrument will
76-
be used.
60+
name: This is a metric stream customizing attribute: the name of the
61+
metric stream. If `None`, the name of the instrument will be used.
7762
78-
description: This is a metric stream customizing attribute: the
79-
description of the metric stream. If `None`, the description of
80-
the instrument will be used.
63+
description: This is a metric stream customizing attribute: the
64+
description of the metric stream. If `None`, the description of the
65+
instrument will be used.
8166
82-
attribute_keys: This is a metric stream customizing attribute: this
83-
is a set of attribute keys. If not `None` then only the
84-
measurement attributes that are in `attribute_keys` will be
85-
used to identify the metric stream.
67+
attribute_keys: This is a metric stream customizing attribute: this is
68+
a set of attribute keys. If not `None` then only the measurement
69+
attributes that are in `attribute_keys` will be used to identify the
70+
metric stream.
8671
87-
aggregation: This is a metric stream customizing attribute: the
88-
aggregatation instance to use when data is aggregated for the
89-
corresponding metrics stream. If `None` the default aggregation
90-
of the instrument will be used.
72+
aggregation: This is a metric stream customizing attribute: the
73+
aggregatation instance to use when data is aggregated for the
74+
corresponding metrics stream. If `None` the default aggregation of
75+
the instrument will be used.
9176
92-
This class is not intended to be subclassed by the user.
93-
"""
77+
This class is not intended to be subclassed by the user.
78+
"""
9479

80+
def __init__(
81+
self,
82+
instrument_type: Optional[Type[Instrument]] = None,
83+
instrument_name: Optional[str] = None,
84+
meter_name: Optional[str] = None,
85+
meter_version: Optional[str] = None,
86+
meter_schema_url: Optional[str] = None,
87+
name: Optional[str] = None,
88+
description: Optional[str] = None,
89+
attribute_keys: Optional[Set[str]] = None,
90+
aggregation: Optional[_AggregationFactory] = None,
91+
):
9592
if (
9693
instrument_type
9794
is instrument_name

0 commit comments

Comments
 (0)