Skip to content

Commit

Permalink
fixup! chore: emit metrics using transformer response headers. TODO: …
Browse files Browse the repository at this point in the history
…cleanup
  • Loading branch information
Sidddddarth committed Jan 29, 2025
1 parent 628b601 commit 031edfc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion processor/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,6 @@ func (trans *handle) doPost(ctx context.Context, rawJSON []byte, url, stage stri
req.Header.Set("X-Feature-Filter-Code", "?1")

resp, reqErr = trans.httpClient.Do(req)

})
trans.stat.NewTaggedStat("processor.transformer_request_time", stats.TimerType, tags).SendTiming(time.Since(requestStartTime))
if reqErr != nil {
Expand All @@ -518,6 +517,12 @@ func (trans *handle) doPost(ctx context.Context, rawJSON []byte, url, stage stri
headerResponseTime := resp.Header.Get("X-Response-Time")
instanceWorker := resp.Header.Get("X-Instance-ID")
if instanceWorker != "" {
fmt.Printf(`X-Response-Time: %s\nX-Instance-ID: %s\n`, headerResponseTime, instanceWorker)
trans.logger.Infon(
"transformer response headers",
logger.NewStringField("X-Response-Time", headerResponseTime),
logger.NewStringField("X-Instance-ID", instanceWorker),
)
newTags := lo.Assign(tags)
newTags["instanceWorker"] = instanceWorker
trans.stat.NewTaggedStat("processor_transformer_instance_event_count", stats.CountType, newTags).Count(numEvents)
Expand Down

0 comments on commit 031edfc

Please sign in to comment.