2022-03-25 03:24:23 +00:00
|
|
|
package conf
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/xtls/xray-core/app/metrics"
|
2024-06-29 18:32:57 +00:00
|
|
|
"github.com/xtls/xray-core/common/errors"
|
2022-03-25 03:24:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type MetricsConfig struct {
|
|
|
|
Tag string `json:"tag"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *MetricsConfig) Build() (*metrics.Config, error) {
|
|
|
|
if c.Tag == "" {
|
2024-06-29 18:32:57 +00:00
|
|
|
return nil, errors.New("metrics tag can't be empty.")
|
2022-03-25 03:24:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return &metrics.Config{
|
|
|
|
Tag: c.Tag,
|
|
|
|
}, nil
|
|
|
|
}
|