TP-5555 | device contexts

This commit is contained in:
varnit goyal
2024-11-20 17:32:14 +05:30
parent 4a98f36a28
commit 0b0a89cb3d
2 changed files with 4 additions and 1 deletions

View File

@@ -14,4 +14,5 @@ type ErrorDocument struct {
Breadcrumbs interface{} `json:"breadcrumbs"`
Extra interface{} `json:"extra"`
Request interface{} `json:"request"`
Contexts interface{} `json:"contexts"`
}

View File

@@ -60,6 +60,7 @@ type Exception struct {
Breadcrumbs interface{} `json:"breadcrumbs,omitempty"`
Extra interface{} `json:"extra,omitempty"`
Request interface{} `json:"request,omitempty"`
Contexts interface{} `json:"contexts,omitempty"`
}
func NewErrorProcessor(logger *log.Logger, elasticSearchClient *dbPackage.ElasticSearchClient, sourceMapFetcherService *SourceMapService, awsConfig configs.AwsConfig) *ErrorProcessor {
@@ -195,10 +196,11 @@ func (ep *ErrorProcessor) ProcessError(error []byte) {
Breadcrumbs: payload.Breadcrumbs,
Extra: payload.Extra,
Request: payload.Request,
Contexts: payload.Contexts,
}
elastic_err := ep.elasticSearchClient.IndexDocument(errorDocument)
if elastic_err != nil {
ep.logger.Info("error occured in elasticsearch", zap.Error(elastic_err))
ep.logger.Info("error occured in saving document to elasticsearch", zap.Error(elastic_err))
return
}
}