Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prometheus_client/exposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def sample_line(line):
mtype = 'gauge'
elif mtype == 'gaugehistogram':
# A gauge histogram is really a gauge,
# but this captures the strucutre better.
# but this captures the structure better.
mtype = 'histogram'
elif mtype == 'unknown':
mtype = 'untyped'
Expand Down
2 changes: 1 addition & 1 deletion prometheus_client/metrics_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __repr__(self):


class UnknownMetricFamily(Metric):
"""A single unknwon metric and its samples.
"""A single unknown metric and its samples.
For use by custom collectors.
"""

Expand Down
8 changes: 4 additions & 4 deletions prometheus_client/openmetrics/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _parse_labels(text):
break
i += 1

# The label value is inbetween the first and last quote
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inbetween is a word

# The label value is between the first and last quote
quote_end = i + 1
label_value = sub_labels[1:quote_end]
# Replace escaping if needed
Expand Down Expand Up @@ -245,10 +245,10 @@ def _parse_labels(text):


def _parse_sample(text):
seperator = " # "
separator = " # "
# Detect the labels in the text
label_start = text.find("{")
if label_start == -1 or seperator in text[:label_start]:
if label_start == -1 or separator in text[:label_start]:
# We don't have labels, but there could be an exemplar.
name_end = text.index(" ")
name = text[:name_end]
Expand All @@ -258,7 +258,7 @@ def _parse_sample(text):
return Sample(name, {}, value, timestamp, exemplar)
# The name is before the labels
name = text[:label_start]
if seperator not in text:
if separator not in text:
# Line doesn't contain an exemplar
# We can use `rindex` to find `label_end`
label_end = text.rindex("}")
Expand Down
2 changes: 1 addition & 1 deletion prometheus_client/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _parse_labels(labels_string):
break
i += 1

# The label value is inbetween the first and last quote
# The label value is between the first and last quote
quote_end = i + 1
label_value = sub_labels[quote_start:quote_end]
# Replace escaping if needed
Expand Down