2017 © Pedro Peláez
 

symfony-bundle xrequestuid-bundle

bundle sf2 allowing setting ids in headers propagated via guzzle

image

m6web/xrequestuid-bundle

bundle sf2 allowing setting ids in headers propagated via guzzle

  • Monday, February 27, 2017
  • by M6Web
  • Repository
  • 20 Watchers
  • 2 Stars
  • 52,494 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 9 Versions
  • 7 % Grown

The README.md

XRequestUidBundle

For implementation into a Symfony 3 or Symfony 4 application, please use the release v3.0.0 at least., (*1)

Why ?

"The cool thing in microservices is that you can generate 15 http calls in your infrastructure just with on client http call", (*2)

, (*3)

This situation leads to many difficulties to trace calls betweens APIs systems, especially when an internal call fails. This bundle provide a solution to generate ids for new requests and configure your guzzle services accordingly to uses those ids in sub http requests made by them., (*4)

The bundle will generate and/or forward those two headers : X-Request-Uid and X-Request-Parent-Uid., (*5)

How ?

When a request arrive, if a X-Request-Id exists, it is copied into the X-Request-Parent-Id. If it's dont exist we generate it throught the uniqId_service., (*6)

All your guzzle services are decorated with a proxy who will add the two headers in all the call made., (*7)

At the end both headers are added to the response for debugging purpose., (*8)

, (*9)

You can now add thoses two headers in your logs file and follow the calls., (*10)

Configuration

m6_web_x_request_uid:
    request_uid_header_name: X-Request-toto    # optionnal, X-Request-Uid by default
    request_parent_uid_header_name: X-Parent   # optionnal, X-Request-Parent-Uid by default 
    uniqId_service: myservice                  # optionnal, a service implementing UniqIdInterface 
    services:                                  # list of guzzle services to decorate 
        - test.guzzle1

services:
    test.guzzle1:
        class: 'GuzzleHttp\Client'

If you have other bundles creating guzzle services, be sure to add the bundle after them in your AppKernel file., (*11)

You can define you own uniqId service or juste use the one provided in the bundle (wich do a basic php uniqid)., (*12)

Todo

  • add more tests
  • add more docs

The Versions

27/02 2017

dev-master

9999999-dev

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^7.0

 

The Development Requires

by Olivier Mansour

10/01 2017

v2.0.1

2.0.1.0

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^7.0

 

The Development Requires

by Olivier Mansour

09/01 2017

v2.0.0

2.0.0.0

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^5.5|^7.0

 

The Development Requires

by Olivier Mansour

08/04 2016

v1.2.2

1.2.2.0

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^5.5|^7.0

 

The Development Requires

by Olivier Mansour

07/04 2016

dev-feature/docs

dev-feature/docs

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^5.5|^7.0

 

The Development Requires

by Olivier Mansour

06/04 2016

v1.2.1

1.2.1.0

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^5.5|^7.0

 

The Development Requires

by Olivier Mansour

06/04 2016

v1.2.0

1.2.0.0

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^5.5|^7.0

 

The Development Requires

by Olivier Mansour

06/04 2016

v1.0.1

1.0.1.0

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^5.6|^7.0

 

The Development Requires

by Olivier Mansour

06/04 2016

v1.0.0

1.0.0.0

bundle sf2 allowing setting ids in headers propagated via guzzle

  Sources   Download

The Requires

  • php ^5.6|^7.0

 

The Development Requires

by Olivier Mansour