Skip to content

Commit

Permalink
removed default config and set as example + removed bad verification …
Browse files Browse the repository at this point in the history
…of len of metrics
  • Loading branch information
ahuret committed Nov 6, 2020
1 parent a5f3c64 commit 927371d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
3 changes: 0 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ func WriteFile(filename string, content []byte) error {
}

func (mm MetricsConfig) validate() error {
if len(mm.Metrics) == 0 {
return errors.New("missing field 'metrics' in top configuration")
}
for i, m := range mm.Metrics {
if m.Name == "" {
return errors.New("missing field 'name' in 'metrics' configuration of metric " + fmt.Sprint(i))
Expand Down
13 changes: 13 additions & 0 deletions examples/opcua.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
metrics:
- name: Temperature # MANDATORY
help: get metrics for machine temperature # MANDATORY
nodeid: ns=2;i=10853 # MANDATORY and UNIQUE for each metric
labels: # if metrics share the same name they can be distinguis by labels
site: MLK
type: gauge # MANDATORY metric type can be counter, gauge, Float, Double
- name: Temperature
help: get metrics for machine temperature
nodeid: ns=2;i=10852
labels:
site: Paris
type: gauge
14 changes: 1 addition & 13 deletions opcua.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
metrics:
- name: Temperature # MANDATORY
help: get metrics for machine temperature # MANDATORY
nodeid: ns=2;i=10853 # MANDATORY and UNIQUE for each metric
labels: # if metrics share the same name they can be distinguis by labels
site: MLK
type: gauge # MANDATORY metric type can be counter, gauge, Float, Double
- name: Temperature
help: get metrics for machine temperature
nodeid: ns=2;i=10852
labels:
site: Paris
type: gauge
metrics: []

0 comments on commit 927371d

Please sign in to comment.