Skip to content

v0.18.0

Compare
Choose a tag to compare
@spladug spladug released this 09 May 19:43
· 685 commits to develop since this release

Changes

New Features

Memcached serialization helpers

The pymemcached integration now comes with helpers for serializing and deserializing python objects for storage in memcached. For green-field applications, use the non-pickle variants. Applications interacting with data from r2's caches can use the pickle variants.

CQLMapper integration

Baseplate now has instrumented clients for use with the Cassandra object mapper CQLMapper which is a stripped down fork of cqlengine better suited for use in environments like Baseplate that avoid application-global context.

API Modifications

  • The Baseplate.configure_tracing convenience method has been reworked so that Baseplate can standardize configuration parsing for your application.
  • BREAKING: The baseplate commands which parse INI files no longer allow interpolation of variables in the config file syntax.

Upgrading

Updating tracing setup

Replace manual configuration parsing with a call to Baseplate.make_tracing_client. Here's a theoretical example of upgrading the activity service:

@@ -10,6 +10,7 @@ from baseplate import (
     Baseplate,
     config,
     make_metrics_client,
+    make_tracing_client,
 )
 from baseplate.context.redis import RedisContextFactory
 from baseplate.integration.thrift import BaseplateProcessorEventHandler
@@ -113,10 +114,6 @@ def make_processor(app_config):  # pragma: nocover
             "window": config.Timespan,
             "fuzz_threshold": config.Integer,
         },
-        "tracing": {
-            "endpoint": config.Optional(config.Endpoint),
-            "service_name": config.String,
-        },
         "redis": {
             "url": config.String,
             "max_connections": config.Optional(config.Integer, default=100),
@@ -124,6 +121,7 @@ def make_processor(app_config):  # pragma: nocover
     })
 
     metrics_client = make_metrics_client(app_config)
+    tracing_client = make_tracing_client(app_config)
     redis_pool = redis.BlockingConnectionPool.from_url(
         cfg.redis.url,
         max_connections=cfg.redis.max_connections,
@@ -133,10 +131,7 @@ def make_processor(app_config):  # pragma: nocover
     baseplate = Baseplate()
     baseplate.configure_logging()
     baseplate.configure_metrics(metrics_client)
-    baseplate.configure_tracing(
-        cfg.tracing.service_name,
-        cfg.tracing.endpoint,
-    )
+    baseplate.configure_tracing(tracing_client)
     baseplate.add_to_context("redis", RedisContextFactory(redis_pool))
 
     counter = ActivityCounter(cfg.activity.window.total_seconds())