Skip to content

Propagate instrumentation params for etag-hits

This includes the expected information in the ActiveSupport notification that populates the payload for logging by lograge. Specifically, adds the information we pushed into the context for etag-caching to the logging message.

We also add the urgency information to the env so it can be picked up by RackRequestsMiddleware to emit the correct urgency labelling.

Resulting log message:

{
  "method": "GET",
  "path": "/twitter/Typeahead.Js/noteable/issue/68/notes",
  "format": "json",
  "controller": null,
  "action": null,
  "status": 304,
  "time": "2023-01-19T11:10:47.130Z",
  "params": [],
  "correlation_id": "01GQ4VJQT6NF5VM1YN98VT5X14",
  "meta.caller_id": "Projects::NotesController#index",
  "meta.remote_ip": "172.18.0.1",
  "meta.feature_category": "team_planning",
  "meta.client_id": "ip/172.18.0.1",
  "etag_route": "issue_notes",
  "request_urgency": "low",
  "target_duration_s": 5,
  "redis_calls": 1,
  "redis_duration_s": 0.000721,
  "redis_read_bytes": 32,
  "redis_write_bytes": 53,
  "redis_shared_state_calls": 1,
  "redis_shared_state_duration_s": 0.000721,
  "redis_shared_state_read_bytes": 32,
  "redis_shared_state_write_bytes": 53,
  "db_count": 0,
  "db_write_count": 0,
  "db_cached_count": 0,
  "db_replica_count": 0,
  "db_primary_count": 0,
  "db_main_count": 0,
  "db_ci_count": 0,
  "db_main_replica_count": 0,
  "db_ci_replica_count": 0,
  "db_replica_cached_count": 0,
  "db_primary_cached_count": 0,
  "db_main_cached_count": 0,
  "db_ci_cached_count": 0,
  "db_main_replica_cached_count": 0,
  "db_ci_replica_cached_count": 0,
  "db_replica_wal_count": 0,
  "db_primary_wal_count": 0,
  "db_main_wal_count": 0,
  "db_ci_wal_count": 0,
  "db_main_replica_wal_count": 0,
  "db_ci_replica_wal_count": 0,
  "db_replica_wal_cached_count": 0,
  "db_primary_wal_cached_count": 0,
  "db_main_wal_cached_count": 0,
  "db_ci_wal_cached_count": 0,
  "db_main_replica_wal_cached_count": 0,
  "db_ci_replica_wal_cached_count": 0,
  "db_replica_duration_s": 0,
  "db_primary_duration_s": 0,
  "db_main_duration_s": 0,
  "db_ci_duration_s": 0,
  "db_main_replica_duration_s": 0,
  "db_ci_replica_duration_s": 0,
  "cpu_s": 0.015843,
  "mem_objects": 2685,
  "mem_bytes": 300648,
  "mem_mallocs": 968,
  "mem_total_bytes": 408048,
  "pid": 941,
  "worker_id": "puma_1",
  "rate_limiting_gates": [],
  "duration_s": 0.00026
}

Notice the request_urgency, target_duration_s & meta.caller_id fields that are missing on master.

Edited by Bob Van Landuyt

Merge request reports

Loading