Skip to content

Commit 8fa1bdd

Browse files
authored
augment OutboundHTTPResponse with helpful fields for metrics (#1519)
* add IsExternalEndpointError and ExternalEndpointLatency to OutboundHTTPResponse * add cache settings to cresettings
1 parent 0bc8c47 commit 8fa1bdd

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

pkg/settings/cresettings/settings.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ var Default = Schema{
6666
ConsensusCallsLimit: Int(2),
6767
LogLineLimit: Size(config.KByte),
6868
LogEventLimit: Int(1_000),
69-
7069
CRONTrigger: cronTrigger{
7170
RateLimit: Rate(rate.Every(30*time.Second), 1),
7271
},

pkg/types/gateway/action.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/hex"
66
"sort"
77
"strconv"
8+
"time"
89
)
910

1011
const (
@@ -65,8 +66,10 @@ func (req OutboundHTTPRequest) Hash() string {
6566

6667
// OutboundHTTPResponse represents the response from gateway to workflow node.
6768
type OutboundHTTPResponse struct {
68-
ErrorMessage string `json:"errorMessage,omitempty"` // error message in case of execution errors. i.e. errors before or after attempting HTTP call to external client
69-
StatusCode int `json:"statusCode,omitempty"` // HTTP status code
70-
Headers map[string]string `json:"headers,omitempty"` // HTTP headers
71-
Body []byte `json:"body,omitempty"` // HTTP response body
69+
ErrorMessage string `json:"errorMessage,omitempty"` // error message for all errors except HTTP errors returned by external endpoints
70+
IsExternalEndpointError bool `json:"isExternalEndpointError,omitempty"` // indicates whether the error is from a faulty external endpoint (e.g. timeout, response size) vs error introduced internally by gateway execution
71+
StatusCode int `json:"statusCode,omitempty"` // HTTP status code
72+
Headers map[string]string `json:"headers,omitempty"` // HTTP headers
73+
Body []byte `json:"body,omitempty"` // HTTP response body
74+
ExternalEndpointLatency time.Duration `json:"externalEndpointLatency,omitempty"` // Latency of the external endpoint
7275
}

0 commit comments

Comments
 (0)