github.com/xmplusdev/xmcore@v1.8.11-0.20240412132628-5518b55526af/infra/conf/metrics.go (about)

     1  package conf
     2  
     3  import (
     4  	"github.com/xmplusdev/xmcore/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  }