Skip to content

Commit b6ab5fd

Browse files
committed
update doc for metrics valueKey
1 parent 2d4b034 commit b6ab5fd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Following is the supported API format for prometheus encode:
2828
absence: filter key must be absent (filter value is ignored)
2929
match_regex: match filter value as a regular expression
3030
not_match_regex: the filter value must not match the provided regular expression
31-
valueKey: entry key from which to resolve metric value
31+
valueKey: entry key from which to resolve metric value; leave empty to count log lines
3232
labels: labels to be associated with the metric
3333
remap: optional remapping of labels
3434
flatten: list fields to be flattened
@@ -473,7 +473,7 @@ Following is the supported API format for writing metrics to an OpenTelemetry co
473473
absence: filter key must be absent (filter value is ignored)
474474
match_regex: match filter value as a regular expression
475475
not_match_regex: the filter value must not match the provided regular expression
476-
valueKey: entry key from which to resolve metric value
476+
valueKey: entry key from which to resolve metric value; leave empty to count log lines
477477
labels: labels to be associated with the metric
478478
remap: optional remapping of labels
479479
flatten: list fields to be flattened

pkg/api/encode_prom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type MetricsItem struct {
5151
Type MetricEncodeOperationEnum `yaml:"type" json:"type" doc:"(enum) one of the following:"`
5252
Help string `yaml:"help,omitempty" json:"help,omitempty" doc:"the metric help text"`
5353
Filters []MetricsFilter `yaml:"filters" json:"filters" doc:"a list of criteria to filter entries by"`
54-
ValueKey string `yaml:"valueKey" json:"valueKey" doc:"entry key from which to resolve metric value"`
54+
ValueKey string `yaml:"valueKey" json:"valueKey" doc:"entry key from which to resolve metric value; leave empty to count log lines"`
5555
Labels []string `yaml:"labels" json:"labels" doc:"labels to be associated with the metric"`
5656
Remap map[string]string `yaml:"remap" json:"remap" doc:"optional remapping of labels"`
5757
Flatten []string `yaml:"flatten" json:"flatten" doc:"list fields to be flattened"`

0 commit comments

Comments
 (0)