44
REQUEST TRACING PROMOTING TRANSPARENCY & TRUTHFULNESS

Enhance system transparency and truthfulness with request tracing

Embed Size (px)

Citation preview

Page 1: Enhance system transparency and truthfulness with request tracing

REQUEST TRACING

PROMOTING TRANSPARENCY & TRUTHFULNESS

Page 2: Enhance system transparency and truthfulness with request tracing

Hello!I AM SAM KEENpolyglot software developer

You can find me at:github.com/samkeenlinkedin.com/in/[email protected]/athletes/560497

Page 3: Enhance system transparency and truthfulness with request tracing

REQUEST TRACING

What is it?

Page 4: Enhance system transparency and truthfulness with request tracing

ASSOCIATING A GLOBALLY UNIQUE IDENTIFIER TO ALL REQUESTS OF A GIVEN SERVICE

Page 5: Enhance system transparency and truthfulness with request tracing

COMMON OCCURRENCE IN THE WILDPOST https://graph.facebook.com/v2.2/…Response headers…x-fb-rev → 1821576

x-fb-trace-id → E1+VUthAHKh

x-fb-debug → NXN2ONVBqC8lLJVzgjknii86r5AJbmLGS5zX227q+jmLI8sm+IIuAo8jETQ3bmH82w9SmjfAQktXTXpZJ7rtuA==

Page 6: Enhance system transparency and truthfulness with request tracing

GREAT, LET’S SEE THE CODE!

Page 7: Enhance system transparency and truthfulness with request tracing

ACTUALLY, I’D LIKE TO APPROACH THE SUBJECT IN A DIFFERENT WAY

Page 8: Enhance system transparency and truthfulness with request tracing

BEFORE, WHAT, THERE IS WHY

Development teams have a limited bandwidthBefore launching an endeavor, estimate the value it will add to the company and use that to prioritize the work, or possibly rule it out

Page 9: Enhance system transparency and truthfulness with request tracing

MEASURE VALUE

How will the work help you obtain your goals

Page 10: Enhance system transparency and truthfulness with request tracing

OK, GOALS, WHERE DO WE GET THOSE?

Page 11: Enhance system transparency and truthfulness with request tracing

COMPLEXITY

Software is one of the most complex of human endeavors

To organize, prioritize goals, We need a plan

Page 12: Enhance system transparency and truthfulness with request tracing

STRATEGIC GOALS

These are the highest level, inward facing drivers for a company

Page 13: Enhance system transparency and truthfulness with request tracing

ACQUIRE ONLINE SHOE SALES MARKET LEADER

Page 14: Enhance system transparency and truthfulness with request tracing

PRINCIPLES

Rules in place to help you remain aligned with Strategic Goals

Page 15: Enhance system transparency and truthfulness with request tracing

SYSTEMS ARE BUILT WITH CONSISTENT, DOCUMENTED INTEGRATION POINTS

^ supports goal

Page 16: Enhance system transparency and truthfulness with request tracing

PRACTICES

Often technology specific guidance to ensure Principles are being upheld

Page 17: Enhance system transparency and truthfulness with request tracing

ALL SERVICES ARE DOCUMENTED WITH API BLUEPRINT

^ supports principle

Page 18: Enhance system transparency and truthfulness with request tracing

GOALS <PRINCIPLES <PRACTICES

Strategic Goals

+ Acquire online shoe sales market leader

Principles

+ Systems are built with consistent and documented integration points

Practices

+ All services are documented with API Blueprint

Page 19: Enhance system transparency and truthfulness with request tracing

GOALS <PRINCIPLES <PRACTICES

Strategic Goals

+ Acquire online shoe sale market leader

+ Enable rapid innovation

Principles

+ Systems are built with consistent and documented integration points

+ Ensure systems are transparent and discoverable

Practices

+ All services are documented with API Blueprint

+ All application logs leverage trace tokens

Page 20: Enhance system transparency and truthfulness with request tracing

PRINCIPLE: SYSTEM TRANSPARENCYwhat do we mean by that

Page 21: Enhance system transparency and truthfulness with request tracing

NOT A NEW CONCEPT

The Art of Linux ProgrammingChapter 6 : Transparency

Page 22: Enhance system transparency and truthfulness with request tracing

SOFTWARE SYSTEM TRANSPARENCYGOOGLED

- A strength of OS software is that the src code is available to all so the NSA cannot hide back doors in it.

- DNS is a transparent system

Page 23: Enhance system transparency and truthfulness with request tracing

A TRANSPARENT SOFTWARE SYSTEM

- has a low learning curve, low barrier to entry

- values simplicity over complexity- has high discoverability- is highly accessible

Page 24: Enhance system transparency and truthfulness with request tracing

TRANSPARENCY SUPPORTING PRACTICES

- gathering performance metrics- All devs have access to all repos- Any given system should be capable of

running on a dev's machine (README)- centralized logging- Verbose modes of operation (-v). Have

verbosity off by default but don't make it inaccessible

Page 25: Enhance system transparency and truthfulness with request tracing

WTF, I THOUGHT THIS WAS A TALK ON TRACING?WHEN DO WE GET TO THE TRACING?

Page 26: Enhance system transparency and truthfulness with request tracing

PRACTICE TO SUPPORT TRANSPARENCY PRINCIPLE

Request Tracing

Page 27: Enhance system transparency and truthfulness with request tracing

LOG ALL THE THINGS

disk is cheapcpu is cheap

logs can be valuable for more than stack traces

Page 28: Enhance system transparency and truthfulness with request tracing
Page 29: Enhance system transparency and truthfulness with request tracing

THE STEPS

- per request create some sort of UUID token

- override your logger to add said token to all log statements

- add said token to all responses (in case of HTTP, use header)

Page 30: Enhance system transparency and truthfulness with request tracing

ALTERNATIVES

- Separate handler to its own log file- a TRACE level in the logger, just below or

above DEBUG

Page 31: Enhance system transparency and truthfulness with request tracing

DEMO

Page 32: Enhance system transparency and truthfulness with request tracing

CLI

aws --profile test logs filter-log-events \

--log-group-name export-demo \

--filter-pattern 559819cf1381f468e

Page 33: Enhance system transparency and truthfulness with request tracing
Page 34: Enhance system transparency and truthfulness with request tracing

SCALING

The are many know strategies for scaling log aggregationAlso many for log analysis

For Instance:Real-time Processing of Log Data with Subscriptions [http://goo.gl/Oo1m73]

Page 35: Enhance system transparency and truthfulness with request tracing

PRINCIPLE: TRUTHFULNESS

How truthful is our documentation

How do you create / maintain truthful documentation

Page 36: Enhance system transparency and truthfulness with request tracing

TRUTHFUL DOCUMENTATIONTHE REALITYStatic docs are at best: Truth’ish

As soon as they are pened, they they start a steady migration towards lies and half-truths

Entropy always wins

Page 37: Enhance system transparency and truthfulness with request tracing

OFTEN THE CASEDOCS → MISINFORMATIONplanning stage, we document the system we plan to build. valuable exercise, spawns collaboration and feedbackThen we build the system. Then the system ALWAYS changes.No one goes back and updates the docs

Page 38: Enhance system transparency and truthfulness with request tracing

REDUCE PURE STATIC DOCS

- Generated docs can help (javadoc, etc)- Real time metrics : better to look at what

the app is actually doing, than rely on a perf test from 3 months agoContinual Non-functional testing anyone?

- All docs should be wiki style, including diagrams!

Page 39: Enhance system transparency and truthfulness with request tracing

DOCUMENTATION BEST PRACTICE

Generate as much documentation as possible from the actual operation of the System and/or the source code of the System

Page 40: Enhance system transparency and truthfulness with request tracing

PRACTICE TO SUPPORT TRUTHFUL DOCUMENTATION PRINCIPLE

Request Rendering

Page 41: Enhance system transparency and truthfulness with request tracing
Page 42: Enhance system transparency and truthfulness with request tracing

DEMO

Page 43: Enhance system transparency and truthfulness with request tracing

THANKS!Any questions?

You can find me at:@samkeen / github.com/samkeenSlides:

Page 44: Enhance system transparency and truthfulness with request tracing

CREDITS

Special thanks to all the people who made and released these awesome resources for free:○ Presentation template by SlidesCarnival○ Photographs by Unsplash