Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downmerge Release 08th August 2024 #870

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions modules/pubmatic/openwrap/applovinmax.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,15 @@ func setIfKeysExists(source []byte, target []byte, keys ...string) []byte {

func updateRequestWrapper(signalExt json.RawMessage, maxRequest *openrtb2.BidRequest) {
clientConfigFlag, err := jsonparser.GetInt(signalExt, "wrapper", "clientconfig")
if err != nil || clientConfigFlag != 1 {
return
if err != nil {
clientConfigFlag = 0
}

if len(maxRequest.Ext) == 0 {
maxRequest.Ext = []byte(`{}`)
}

if maxReqExt, err := jsonparser.Set(maxRequest.Ext, []byte(`1`), "prebid", "bidderparams", "pubmatic", "wrapper", "clientconfig"); err == nil {
if maxReqExt, err := jsonparser.Set(maxRequest.Ext, []byte(strconv.FormatInt(clientConfigFlag, 10)), "prebid", "bidderparams", "pubmatic", "wrapper", "clientconfig"); err == nil {
maxRequest.Ext = maxReqExt
}
}
Expand Down
12 changes: 6 additions & 6 deletions modules/pubmatic/openwrap/applovinmax_test.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions modules/pubmatic/openwrap/metrics/config/multimetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@ func (me *MultiMetricsEngine) RecordReqImpsWithContentCount(publisher, contentTy
}
}

// RecordPrebidAuctionBidResponse across all engines
func (me *MultiMetricsEngine) RecordPrebidAuctionBidResponse(publisher string, partnerName string, bidderCode string, adapterCode string) {
for _, thisME := range *me {
thisME.RecordPrebidAuctionBidResponse(publisher, partnerName, bidderCode, adapterCode)
}
}

// RecordPBSAuctionRequestsStats across all engines
func (me *MultiMetricsEngine) RecordPBSAuctionRequestsStats() {
for _, thisME := range *me {
Expand Down
1 change: 1 addition & 0 deletions modules/pubmatic/openwrap/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type MetricsEngine interface {

// not-captured in openwrap module, dont provide enough insights
RecordPBSAuctionRequestsStats()
RecordPrebidAuctionBidResponse(publisher string, partnerName string, bidderCode string, adapterCode string)
RecordInvalidCreativeStats(publisher, partner string)

// not implemented in openwrap module yet
Expand Down
12 changes: 12 additions & 0 deletions modules/pubmatic/openwrap/metrics/mock/mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions modules/pubmatic/openwrap/metrics/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ type Metrics struct {
ampVideoResponses *prometheus.CounterVec
analyticsThrottle *prometheus.CounterVec
signalStatus *prometheus.CounterVec
pbsAuctionResponse *prometheus.CounterVec

// VAST Unwrap
requests *prometheus.CounterVec
Expand Down Expand Up @@ -112,6 +113,8 @@ const (
signalTypeLabel = "signal_status"
successLabel = "success"
adpodImpCountLabel = "adpod_imp_count"
bidderCodeLabel = "bidder_code"
adapterCodeLabel = "adapter_code"
)

var standardTimeBuckets = []float64{0.1, 0.3, 0.75, 1}
Expand Down Expand Up @@ -163,6 +166,12 @@ func newMetrics(cfg *config.PrometheusMetrics, promRegistry *prometheus.Registry
[]string{pubIDLabel, partnerLabel, adFormatLabel},
)

metrics.pbsAuctionResponse = newCounter(cfg, promRegistry,
"pbs_auction_response",
"Count of errors while injecting trackers at publisher, partner level.",
[]string{pubIDLabel, partnerLabel, bidderCodeLabel, adapterCodeLabel},
)

metrics.pubPartnerResponseTimeSecs = newHistogramVec(cfg, promRegistry,
"partner_response_time",
"Time taken by each partner to respond in seconds labeled by publisher.",
Expand Down Expand Up @@ -401,6 +410,15 @@ func (m *Metrics) RecordOpenWrapServerPanicStats(hostName, method string) {
}).Inc()
}

func (m *Metrics) RecordPrebidAuctionBidResponse(publisher string, partnerName string, bidderCode string, adapterCode string) {
m.pbsAuctionResponse.With(prometheus.Labels{
pubIDLabel: publisher,
partnerLabel: partnerName,
bidderCodeLabel: bidderCode,
adapterCodeLabel: adapterCode,
}).Inc()
}

func (m *Metrics) RecordPublisherPartnerNoCookieStats(publisherID, partner string) {
m.pubPartnerNoCookie.With(prometheus.Labels{
pubIDLabel: publisherID,
Expand Down
2 changes: 2 additions & 0 deletions modules/pubmatic/openwrap/metrics/stats/tcp_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,5 @@ func (st *StatsTCP) RecordAdruleEnabled(pubId, profId string)
func (st *StatsTCP) RecordAdruleValidationFailure(pubId, profId string) {}
func (st *StatsTCP) RecordSignalDataStatus(pubid, profileid, signalType string) {}
func (st *StatsTCP) RecordPrebidCacheRequestTime(success bool, length time.Duration) {}
func (st *StatsTCP) RecordPrebidAuctionBidResponse(publisher string, partnerName string, bidderCode string, adapterCode string) {
}
Loading