Helpers for integration with various application frameworks.

This package contains modules which integrate Baseplate with common application frameworks.

See one of the submodules below for your framework of choice.


Thrift integration for Baseplate.

This module provides an implementation of TProcessorEventHandler which integrates Baseplate’s facilities into the Thrift request lifecycle.

An abbreviated example of it in use:

def make_processor(app_config):
    baseplate = Baseplate()

    handler = MyHandler()
    processor = my_thrift.MyService.ContextProcessor(handler)

    event_handler = BaseplateProcessorEventHandler(logger, baseplate)

    return processor
class baseplate.integration.thrift.BaseplateProcessorEventHandler(logger, baseplate, edge_context_factory=None)

Processor event handler for Baseplate.



Pyramid integration for Baseplate.

This module provides a configuration extension for Pyramid which integrates Baseplate’s facilities into the Pyramid WSGI request lifecycle.

An abbreviated example of it in use:

def make_app(app_config):
    configurator = Configurator()

    baseplate = Baseplate()
    baseplate_config = BaseplateConfigurator(

    return configurator.make_wsgi_app()


Because of how Baseplate instruments Pyramid, you should not make an exception view prevent Baseplate from seeing the unhandled error and reporting it appropriately.

class baseplate.integration.pyramid.BaseplateConfigurator(baseplate, trust_trace_headers=False, edge_context_factory=None)

Config extension to integrate Baseplate into Pyramid.

  • baseplate (baseplate.core.Baseplate) – The Baseplate instance for your application.
  • trust_trace_headers (bool) – Should this application trust trace headers from the client? If True, trace headers in inbound requests will be used for the server span. If False, new random trace IDs will be generated for each request.
  • edge_context_factory (baseplate.core.EdgeRequestContextFactory) – A configured factory for handling edge request context.


Do not set trust_trace_headers to True unless you are sure your application is only accessible by trusted sources (usually backend-only services).


Within its Pyramid integration, Baseplate will emit events at various stages of the request lifecycle that services can hook into.

class baseplate.integration.pyramid.ServerSpanInitialized(request)

Event that Baseplate fires after creating the ServerSpan for a Request.

This event will be emitted before the Request is passed along to it’s handler. Baseplate initializes the ServerSpan in response to a event emitted by Pyramid so while we can guarantee what Baseplate has done when this event is emitted, we cannot guarantee that any other subscribers to have been called or not.