Skip to content

Include Puma worker PID in structured log [RUN AS-IF-FOSS]

What does this MR do?

This MR is to include the PID of Puma worker in structured log.

Screenshots or Screencasts (strongly suggested)

click to see the sample log { "method": "GET", "path": "/dashboard/projects/starred", "format": "html", "controller": "Dashboard::ProjectsController", "action": "starred", "status": 200, "time": "2021-07-22T23:23:06.608Z", "params": [], "remote_ip": "127.0.0.1", "user_id": 1, "username": "root", "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36", "correlation_id": "01FB88ENR1Q6A1RF1D7BR5SA8Q", "meta.user": "root", "meta.caller_id": "Dashboard::ProjectsController#starred", "meta.remote_ip": "127.0.0.1", "meta.feature_category": "projects", "meta.client_id": "user/1", "redis_calls": 24, "redis_duration_s": 0.008975, "redis_read_bytes": 8039, "redis_write_bytes": 52747, "redis_cache_calls": 23, "redis_cache_duration_s": 0.007076, "redis_cache_read_bytes": 7858, "redis_cache_write_bytes": 52063, "redis_shared_state_calls": 1, "redis_shared_state_duration_s": 0.001899, "redis_shared_state_read_bytes": 181, "redis_shared_state_write_bytes": 684, "db_count": 18, "db_write_count": 0, "db_cached_count": 3, "external_http_count": 1, "external_http_duration_s": 0.011391000007279217, "rack_attack_redis_count": 1, "rack_attack_redis_duration_s": 0.0008440000237897038, "cpu_s": 16.478855, "mem_objects": 4350875, "mem_bytes": 548496563, "mem_mallocs": 2486302, "mem_total_bytes": 722531563, "pid": 81836, "queue_duration_s": 12.687865, "db_duration_s": 0.03614, "view_duration_s": 1.42145, "duration_s": 2.45571 }

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #300172 (closed)

Edited by Changzheng Liu

Merge request reports