github.com/xtls/xray-core@v1.8.12-0.20240518155711-3168d27b0bdb/infra/conf/metrics.go (about)

     1  package conf
     2  
     3  import (
     4  	"github.com/xtls/xray-core/app/metrics"
     5  )
     6  
     7  type MetricsConfig struct {
     8  	Tag string `json:"tag"`
     9  }
    10  
    11  func (c *MetricsConfig) Build() (*metrics.Config, error) {
    12  	if c.Tag == "" {
    13  		return nil, newError("metrics tag can't be empty.")
    14  	}
    15  
    16  	return &metrics.Config{
    17  		Tag: c.Tag,
    18  	}, nil
    19  }