-
Notifications
You must be signed in to change notification settings - Fork 1
/
metrics.go
51 lines (43 loc) · 1.84 KB
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package ast
import "github.com/tigrannajaryan/telemetry-schema/schema/types"
type VersionOfMetrics struct {
Changes []MetricTranslationAction
Current []MetricSchema `yaml:"current_metric_schema"`
}
type MetricTranslationAction struct {
RenameMetrics map[types.MetricName]types.MetricName `yaml:"rename_metrics"`
RenameLabels *AttributeMapForMetrics `yaml:"rename_attributes"`
AddAttributes *AttributeMapForMetrics `yaml:"add_attributes"`
DuplicateAttributes *AttributeMapForMetrics `yaml:"duplicate_attributes"`
Split *SplitMetric `yaml:"split"`
Merge *MergeMetric `yaml:"merge"`
ToDelta []types.MetricName `yaml:"to_delta"`
}
type AttributeMapForMetrics struct {
ApplyToMetrics []types.MetricName `yaml:"apply_to_metrics"`
AttributeMap map[string]string `yaml:"label_map"`
}
type SplitMetric struct {
ApplyToMetric types.MetricName `yaml:"apply_to_metric"`
ByAttribute types.AttributeName `yaml:"by_attribute"`
AttributesToMetrics map[types.AttributeValue]types.MetricName `yaml:"attributes_to_metrics"`
}
type MergeMetric struct {
CreateMetric types.MetricName `yaml:"create_metric"`
ByAttribute string `yaml:"by_attribute"`
AttributesForMetrics map[types.AttributeValue]types.MetricName `yaml:"attributes_for_metrics"`
}
type MetricSchema struct {
MetricNames []string `yaml:"metric_names"`
Unit string
ValueType string `yaml:"value_type"`
Temporality string
Monotonic bool
Attributes map[string]AttributesSchema
}
type AttributesSchema struct {
Values []string
Description string
Required string
Example string
}