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 authored and cisse21 committed Feb 3, 2025
1 parent 628b601 commit 8734959
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions internal/transformer-client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package transformerclient

import (
"context"
"github.com/bufbuild/httplb/resolver"
"net"
"net/http"
"time"

Expand Down Expand Up @@ -91,8 +93,9 @@ func NewClient(config *ClientConfig) Client {
httplb.WithHealthChecks(getChecker(checkerType, config.CheckURL)),
httplb.WithIdleConnectionTimeout(transport.IdleConnTimeout),
httplb.WithRequestTimeout(client.Timeout),
httplb.WithRoundTripperMaxLifetime(clientTTL),
httplb.WithIdleTransportTimeout(2*clientTTL),
httplb.WithRoundTripperMaxLifetime(transport.IdleConnTimeout),
httplb.WithIdleTransportTimeout(2*transport.IdleConnTimeout),
httplb.WithResolver(resolver.NewDNSResolver(net.DefaultResolver, resolver.PreferIPv4, clientTTL),
)

Check failure on line 99 in internal/transformer-client/client.go

View workflow job for this annotation

GitHub Actions / Integration (oss)

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 99 in internal/transformer-client/client.go

View workflow job for this annotation

GitHub Actions / Integration (enterprise)

syntax error: unexpected newline in argument list; possibly missing comma or )
default:
return client

Check failure on line 101 in internal/transformer-client/client.go

View workflow job for this annotation

GitHub Actions / Integration (oss)

syntax error: unexpected return at end of statement

Check failure on line 101 in internal/transformer-client/client.go

View workflow job for this annotation

GitHub Actions / Integration (enterprise)

syntax error: unexpected return at end of statement
Expand Down
5 changes: 2 additions & 3 deletions processor/transformer/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ func NewTransformer(conf *config.Config, log logger.Logger, stat stats.Stats, op
PickerType: conf.GetString("Transformer.Client.httplb.pickerType", "power_of_two"),
CheckerType: conf.GetString("Transformer.Client.httplb.checkerType", "nop"),

// for now no health checks - can be implemented when there are different clients for UT, DT, TPV
// CheckURL: trans.config.userTransformationURL,
//for now no health checks - can be implemented when there are different clients for UT, DT, TPV
CheckURL: trans.config.userTransformationURL,
}
transformerClientConfig.TransportConfig.DisableKeepAlives = trans.config.disableKeepAlives
transformerClientConfig.TransportConfig.MaxConnsPerHost = trans.config.maxHTTPConnections
Expand Down 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 Down

0 comments on commit 8734959

Please sign in to comment.