Skip to content

Commit

Permalink
Rename "label" to "attributes"
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrannajaryan committed Oct 12, 2021
1 parent 2f8bc58 commit cda8e82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions schema/v1.0/ast/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ type Metrics struct {
// MetricsChange corresponds to a section representing metrics change.
type MetricsChange struct {
RenameMetrics map[types.MetricName]types.MetricName `yaml:"rename_metrics"`
RenameAttributes *AttributeMapForMetrics `yaml:"rename_labels"`
RenameAttributes *AttributeMapForMetrics `yaml:"rename_attributes"`
}

type AttributeMapForMetrics struct {
ApplyToMetrics []types.MetricName `yaml:"apply_to_metrics"`
AttributeMap AttributeMap `yaml:"label_map"`
AttributeMap AttributeMap `yaml:"attribute_map"`
}
18 changes: 9 additions & 9 deletions schema/v1.0/testdata/valid-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,28 @@ versions:
# to this version. The order in this sequence is important. Translations are
# applied from top to bottom in the listed order.

- rename_labels:
# Rename labels of all metrics, regardless of metric name.
# The keys are the old label name used prior to this version, the values are
# the new label name starting from this version.
label_map:
- rename_attributes:
# Rename attributes of all metrics, regardless of metric name.
# The keys are the old attribute name used prior to this version, the values are
# the new attribute name starting from this version.
attribute_map:
http.status_code: http.response_status_code

- rename_metrics:
# Rename metrics. The keys are old metric names, the values are the new metric names.
container.cpu.usage.total: cpu.usage.total
container.memory.usage.max: memory.usage.max

- rename_labels:
- rename_attributes:
apply_to_metrics:
# Name of the metric to apply this rule to. If empty the rule applies to all metrics.
- system.cpu.utilization
- system.memory.usage
- system.memory.utilization
- system.paging.usage
label_map:
# The keys are the old label name used prior to this version, the values are
# the new label name starting from this version.
attribute_map:
# The keys are the old attribute name used prior to this version, the values are
# the new attribute name starting from this version.
status: state

logs:
Expand Down

0 comments on commit cda8e82

Please sign in to comment.