Skip to content

JoyfulProgramming/practical_observability

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

276 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open in GitHub Codespaces

Practical Observability

  • MiniCrossStitching Rails app
  • Contains a mystery defect

Setup

  1. Create a new Github Codespace
  2. Run server: bin/serve
  3. Simulate users: bin/hammer

Commands

bin/setup  # Setup the app
bin/serve  # Start the server
bin/hammer # Simulate users
bin/errors # Show errors in Solid Errors

Code

3. Build

Starting code for logging:

    Rails.logger.info(
      message: "Added border to preview",
      "event.name" => "com.jp.cs.pattern.preview.added",
      "com.jp.cs.pattern.width" => width,
      "com.jp.cs.pattern.height" => height
    )
  rescue StandardError => e
    Rails.logger.error(
      message: "Error adding border to preview",
      "event.name" => "com.jp.cs.pattern.preview.added",
      "com.jp.cs.pattern.width" => width,
      "com.jp.cs.pattern.height" => height,
      exception: e,
    )
    raise e

4. Use

DQL for GROUP BY orientation:

fetch logs
| filter matchesValue(event.name, "com.jp.cs.pattern.preview.added")
| filter isNotNull(com.jp.cs.pattern.orientation)
| summarize count(), by: { loglevel, com.jp.cs.pattern.orientation }

About

Practical Observability Course

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Ruby 52.5%
  • HTML 27.1%
  • JavaScript 18.4%
  • Shell 1.2%
  • CSS 0.4%
  • Dockerfile 0.3%
  • Nix 0.1%