From f7ded649f04778dd3ea17af3d1b6a0a8454c74f1 Mon Sep 17 00:00:00 2001 From: Asher Foa Date: Sun, 17 Nov 2019 20:56:46 -0800 Subject: [PATCH] Fix some typos Signed-off-by: Asher Foa --- prometheus_client/exposition.py | 2 +- prometheus_client/metrics_core.py | 2 +- prometheus_client/openmetrics/parser.py | 8 ++++---- prometheus_client/parser.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/prometheus_client/exposition.py b/prometheus_client/exposition.py index 238591b1..221cbedf 100644 --- a/prometheus_client/exposition.py +++ b/prometheus_client/exposition.py @@ -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' diff --git a/prometheus_client/metrics_core.py b/prometheus_client/metrics_core.py index cfa2b221..d8873557 100644 --- a/prometheus_client/metrics_core.py +++ b/prometheus_client/metrics_core.py @@ -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. """ diff --git a/prometheus_client/openmetrics/parser.py b/prometheus_client/openmetrics/parser.py index fe4d90cd..000b55bc 100644 --- a/prometheus_client/openmetrics/parser.py +++ b/prometheus_client/openmetrics/parser.py @@ -214,7 +214,7 @@ def _parse_labels(text): 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[1:quote_end] # Replace escaping if needed @@ -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] @@ -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("}") diff --git a/prometheus_client/parser.py b/prometheus_client/parser.py index 1b4373eb..abea9b7d 100644 --- a/prometheus_client/parser.py +++ b/prometheus_client/parser.py @@ -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