Skip to content

Commit

Permalink
disable pubmatic analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
AvinashKapre committed Feb 20, 2024
1 parent cd0d4db commit 7e88488
Showing 1 changed file with 27 additions and 30 deletions.
57 changes: 27 additions & 30 deletions analytics/pubmatic/pubmatic.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package pubmatic

import (
"runtime/debug"
"sync"

"github.com/golang/glog"
"github.com/prebid/prebid-server/analytics"
"github.com/prebid/prebid-server/analytics/pubmatic/mhttp"

"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/modules/pubmatic/openwrap"
"github.com/prebid/prebid-server/modules/pubmatic/openwrap/models"
)

type RequestType string
Expand All @@ -35,33 +32,33 @@ type HTTPLogger struct {

// LogAuctionObject prepares the owlogger url and send it to logger endpoint
func (ow HTTPLogger) LogAuctionObject(ao *analytics.AuctionObject) {
var rCtx *models.RequestCtx
defer func() {
if r := recover(); r != nil {
if rCtx != nil {
rCtx.MetricsEngine.RecordOpenWrapServerPanicStats(ow.hostName, "LogAuctionObject")
glog.Errorf("stacktrace:[%s], error:[%v], pubid:[%d], profid:[%d], ver:[%d]", string(debug.Stack()), r, rCtx.PubID, rCtx.ProfileID, rCtx.VersionID)
return
}
glog.Errorf("stacktrace:[%s], error:[%v]", string(debug.Stack()), r)
}
}()

rCtx = GetRequestCtx(ao.HookExecutionOutcome)
if rCtx == nil {
// glog.Errorf("Failed to get the request context for AuctionObject - [%v]", ao)
// add this log once complete header-bidding code is migrated to modules
return
}

url, headers := GetLogAuctionObjectAsURL(*ao, rCtx, false, false)
if url == "" {
glog.Errorf("Failed to prepare the owlogger for pub:[%d], profile:[%d], version:[%d].",
rCtx.PubID, rCtx.ProfileID, rCtx.VersionID)
return
}

go send(rCtx, url, headers, mhttp.NewMultiHttpContext())
// var rCtx *models.RequestCtx
// defer func() {
// if r := recover(); r != nil {
// if rCtx != nil {
// rCtx.MetricsEngine.RecordOpenWrapServerPanicStats(ow.hostName, "LogAuctionObject")
// glog.Errorf("stacktrace:[%s], error:[%v], pubid:[%d], profid:[%d], ver:[%d]", string(debug.Stack()), r, rCtx.PubID, rCtx.ProfileID, rCtx.VersionID)
// return
// }
// glog.Errorf("stacktrace:[%s], error:[%v]", string(debug.Stack()), r)
// }
// }()

// rCtx = GetRequestCtx(ao.HookExecutionOutcome)
// if rCtx == nil {
// // glog.Errorf("Failed to get the request context for AuctionObject - [%v]", ao)
// // add this log once complete header-bidding code is migrated to modules
// return
// }

// url, headers := GetLogAuctionObjectAsURL(*ao, rCtx, false, false)
// if url == "" {
// glog.Errorf("Failed to prepare the owlogger for pub:[%d], profile:[%d], version:[%d].",
// rCtx.PubID, rCtx.ProfileID, rCtx.VersionID)
// return
// }

// go send(rCtx, url, headers, mhttp.NewMultiHttpContext())
}

// Writes VideoObject to file
Expand Down

0 comments on commit 7e88488

Please sign in to comment.