You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/Prometheus/MetricDescriptor.swift
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,8 @@ public struct MetricNameDescriptor {
30
30
/// An optional suffix describing the metric's unit (e.g., `total`).
31
31
publicletunitName:String?
32
32
33
-
/// Optional descriptive text for the metric.
33
+
/// Optional help text for the metric. If a non-empty string is provided, it will be emitted as a `# HELP` line in the exposition format.
34
+
/// If the parameter is omitted or an empty string is passed, the `# HELP` line will not be generated for this metric.
34
35
publiclethelpText:String?
35
36
36
37
/// Creates a new ``MetricNameDescriptor`` that defines the components of a fully qualified Prometheus metric name.
@@ -39,7 +40,8 @@ public struct MetricNameDescriptor {
39
40
/// - Parameter subsystem: An optional subsystem to group related metrics within a namespace.
40
41
/// - Parameter metricName: The required, descriptive base name of the metric.
41
42
/// - Parameter unitName: An optional suffix describing the metric's unit (e.g., `total`).
42
-
/// - Parameter helpText: Optional descriptive text for the metric.
43
+
/// - Parameter helpText: Optional help text for the metric. If a non-empty string is provided, it will be emitted as a `# HELP` line in the exposition format.
44
+
/// If the parameter is omitted or an empty string is passed, the `# HELP` line will not be generated for this metric.
43
45
publicinit(
44
46
namespace:String?=nil,
45
47
subsystem:String?=nil,
@@ -55,7 +57,7 @@ public struct MetricNameDescriptor {
55
57
self.helpText = helpText
56
58
}
57
59
58
-
/// The fully qualified metric name, joining non-empty components with underscores.
60
+
/// The fully qualified metric name, joining non-empty components with underscores (e.g. `namespace_subsytem_metricName_unitName`).
0 commit comments