Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement atomic operations for various metrics using Prometheus as the backend storage #773

Closed
wants to merge 12 commits into from
Closed
4 changes: 4 additions & 0 deletions conf/bootstrap.docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ logging:
max_age: 7
compress: true
console: true

stats:
service: "TestService"
stats_enable: false
4 changes: 4 additions & 0 deletions conf/bootstrap.local-etcd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ logging:
max_age: 30
compress: false
console: true

stats:
service: "TestService"
stats_enable: false
4 changes: 4 additions & 0 deletions conf/bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ logging_config:
sql_log_enabled: false
sql_log_name: sql.log
physical_sql_log_name: physql.log

stats:
service: "TestService"
stats_enable: false
3 changes: 3 additions & 0 deletions pkg/config/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ logging:
max_age: 7
compress: true
console: true
stats:
service: "TestService"
stats_enable: false
`
_, err = tmpfile.WriteString(text)
require.NoError(t, err)
Expand Down
27 changes: 12 additions & 15 deletions pkg/config/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,15 @@ import (
"strings"
"time"
"unicode"
)

import (
"github.com/arana-db/arana/pkg/util/log"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import style

"github.com/go-playground/validator/v10"

"github.com/pkg/errors"

"golang.org/x/text/cases"
"golang.org/x/text/language"

"gopkg.in/yaml.v3"
)

import (
"github.com/arana-db/arana/pkg/util/log"
)

type (
DataRevision interface {
Revision() string
Expand Down Expand Up @@ -82,14 +74,19 @@ type (

BootOptions struct {
Spec `yaml:",inline"`
Config *Options `yaml:"config" json:"config"`
Listeners []*Listener `validate:"required,dive" yaml:"listeners" json:"listeners"`
Registry *Registry `yaml:"registry" json:"registry"`
Trace *Trace `yaml:"trace" json:"trace"`
Supervisor *User `validate:"required,dive" yaml:"supervisor" json:"supervisor"`
Logging *log.Config `validate:"required,dive" yaml:"logging" json:"logging"`
Config *Options `yaml:"config" json:"config"`
Listeners []*Listener `validate:"required,dive" yaml:"listeners" json:"listeners"`
Registry *Registry `yaml:"registry" json:"registry"`
Trace *Trace `yaml:"trace" json:"trace"`
Supervisor *User `validate:"required,dive" yaml:"supervisor" json:"supervisor"`
Logging *log.Config `validate:"required,dive" yaml:"logging" json:"logging"`
Stats *StatsConfig `yaml:"stats" json:"stats"`
}

StatsConfig struct {
Service string `yaml:"service" json:"service"`
StatsEnabled bool `yaml:"stats_enabled" json:"stats_enabled"`
}
// Configuration represents an Arana configuration.
Configuration struct {
Spec `yaml:",inline"`
Expand Down
Loading
Loading