Add cron-based/manual reset to ExporterMetrics

This commit is contained in:
ionutboangiu
2025-03-14 18:51:58 +02:00
committed by Dan Christian Bogos
parent 934815d9ee
commit 1c00a3aad1
38 changed files with 286 additions and 347 deletions

View File

@@ -33,7 +33,7 @@ import (
)
func NewHTTPjsonMapEE(cfg *config.EventExporterCfg, cgrCfg *config.CGRConfig, filterS *engine.FilterS,
dc *utils.SafeMapStorage) (pstrJSON *HTTPjsonMapEE, err error) {
dc *utils.ExporterMetrics) (pstrJSON *HTTPjsonMapEE, err error) {
pstrJSON = &HTTPjsonMapEE{
cfg: cfg,
dc: dc,
@@ -47,7 +47,7 @@ func NewHTTPjsonMapEE(cfg *config.EventExporterCfg, cgrCfg *config.CGRConfig, fi
// HTTPjsonMapEE implements EventExporter interface for .csv files
type HTTPjsonMapEE struct {
cfg *config.EventExporterCfg
dc *utils.SafeMapStorage
dc *utils.ExporterMetrics
client *http.Client
reqs *concReq
@@ -91,7 +91,7 @@ func (httpEE *HTTPjsonMapEE) ExportEvent(content any, _ string) (err error) {
func (httpEE *HTTPjsonMapEE) Close() (_ error) { return }
func (httpEE *HTTPjsonMapEE) GetMetrics() *utils.SafeMapStorage { return httpEE.dc }
func (httpEE *HTTPjsonMapEE) GetMetrics() *utils.ExporterMetrics { return httpEE.dc }
func (httpEE *HTTPjsonMapEE) PrepareMap(mp *utils.CGREvent) (any, error) {
body, err := json.Marshal(mp.Event)