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

fix(logging): add flow to persistent logs fields #3472

Merged
merged 5 commits into from
Jan 30, 2024

Conversation

lsampras
Copy link
Member

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

  • Adding flow to the persistent keys in subscriber layer
  • Adding flow to the middle ware log

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

  • Adding flow to the persistent keys in api's

How did you test it?

run the application locally
all api requests should have the following log line at the end of request

  • the fields should be populated when available
  • These log line will be generated even for health & non-existent paths (e.g / or /favicon.ico)
{
    "message": "[GOLDEN_LOG_LINE - EVENT] REQUEST MIDDLEWARE END",
    "hostname": "<MY_MACHINE>.local",
    "pid": 62901,
    "env": "development",
    "level": "INFO",
    "target": "router::middleware",
    "service": "router",
    "line": 61,
    "file": "crates/router/src/middleware.rs",
    "fn": "golden_log_line",
    "full_name": "router::middleware::golden_log_line",
    "flow": "PaymentsCreate",
    "time": "2024-01-24T06:35:06.771569000Z",
    "merchant_id": "merchant_1706060159",
    "request_id": "018d3a2d-e583-7581-8992-8596b3052995",
    "extra": {
        "trace_id": "00000000000000000000000000000000",
        "http.method": "POST",
        "http.route": "/payments",
        "http.flavor": "1.1",
        "http.user_agent": "PostmanRuntime/7.33.0",
        "payment_id": "payment_intent_id = \"pay_y8XHx5whOaWTdoGrgAAf\"",
        "otel.name": "HTTP POST /payments",
        "http.client_ip": "::1",
        "http.host": "localhost:8080",
        "http.target": "/payments",
        "http.scheme": "http",
        "otel.kind": "server"
    }
}

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

SanchithHegde
SanchithHegde previously approved these changes Jan 30, 2024
@lsampras lsampras linked an issue Jan 30, 2024 that may be closed by this pull request
@SanchithHegde SanchithHegde added this pull request to the merge queue Jan 30, 2024
Merged via the queue into main with commit ac49103 Jan 30, 2024
10 of 12 checks passed
@SanchithHegde SanchithHegde deleted the add_flow_to_root_param branch January 30, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(logging): add flow field to logging framework
3 participants