diff --git a/LICENSE b/LICENSE index 261eeb9..8bb72ec 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2019 Expedia, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index 02b5fd9..78276d2 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,8 @@ This is Haystack's client library for Python that implements [OpenTracing](https Further information can be found on [opentracing.io](https://opentracing.io/) ## Using this library -See examples in /examples directory. +See examples in /examples directory. See opentracing [usage](https://github.com/opentracing/opentracing-python/#usage) for additional information. + First initialize the tracer at the application level by supplying a service name and recorder ```python @@ -18,10 +19,6 @@ from haystack import HaystackTracer opentracing.tracer = HaystackTracer("a_service", HaystackAgentRecorder()) ``` -**If there is a Scope, it will act as the parent to any newly started Span** unless the programmer passes -`ignore_active_span=True` at `start_span()/start_active_span()` time or specified parent context explicitly using -`childOf=parent_context` - Starting a span can be done as a managed resource using `start_active_span()` ```python with opentracing.tracer.start_active_span("span-name") as scope: @@ -35,7 +32,16 @@ do_stuff() span.finish() ``` -See opentracing [usage](https://github.com/opentracing/opentracing-python/#usage) for additional information. +Note: **If there is a Scope, it will act as the parent to any newly started Span** unless the programmer passes +`ignore_active_span=True` at `start_span()/start_active_span()` time or specified parent context explicitly using +`childOf=parent_context` + +#### Custom propagation headers +If necessary, default propagation headers can be replaced with custom ones by specifying custom propagator options. Register the new propagator with the tracer once configured. +```python +prop_opts = PropagatorOpts("X-Trace-ID", "X-Span-ID", "X-Parent-Span", "X-baggage-") +opentracing.tracer.register_propagator(opentracing.Format.HTTP_HEADERS, TextPropagator(prop_opts)) +``` #### Logging All modules define their logger via `logging.getLogger(__name__)`