Skip to content

Commit 471d760

Browse files
authored
[QoS][Cosmos] Hydrate REST request logger with request details (#369)
## Summary Hydrate REST request logger with request details ## Issue Insufficient details in REST request processors/validators logs to track endpoint errors. - Issue or PR: #{ISSUE_OR_PR_NUMBER} ## Type of change Select one or more from the following: - [x] New feature, functionality or library - [ ] Bug fix - [ ] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## QoS Checklist ### E2E Validation & Tests - [ ] `make path_up` - [ ] `make test_e2e_evm_shannon` ### Observability - [ ] 1. `make path_up` - [ ] 2. Run the following E2E test: `make test_request__shannon_relay_util_100` - [ ] 3. View results in LocalNet's [PATH Relay Grafana Dashboard](http://localhost:3003/d/relays/path-service-requests) ## Sanity Checklist - [ ] I have updated the GitHub Issue `assignees`, `reviewers`, `labels`, `project`, `iteration` and `milestone` - [ ] For docs, I have run `make docusaurus_start` - [ ] For code, I have run `make test_all` - [ ] For configurations, I have updated the documentation - [ ] I added `TODO`s where applicable
1 parent 41edbd0 commit 471d760

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

qos/cosmos/request_validator_rest.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,15 @@ func (rv *requestValidator) buildRESTRequestContext(
8787
servicePayload,
8888
)
8989

90-
logger.With(
90+
// Hydrate the logger with REST request details.
91+
logger = logger.With(
92+
"rest_backend_service", rpcType,
9193
"payload_length", len(servicePayload.Data),
92-
"request_path", servicePayload.Path,
93-
).Debug().Msg("REST request validation successful.")
94+
"rest_request_path", servicePayload.Path,
95+
"rest_request_method", servicePayload.Method,
96+
)
97+
98+
logger.Debug().Msg("REST request validation successful.")
9499

95100
// Create specialized REST context
96101
return &requestContext{

0 commit comments

Comments
 (0)