Skip to content

Commit e400a43

Browse files
rhilfersashishagg
authored andcommitted
Update License Copyright - Add custom propagation info to ReadMe (#6)
* add tracer init to readme * added build and release features * fix makefile typo * can enable shared spans if desired * add ability to provide custom propagation headers if needed. default to Span-ID, Trace-Id, Parent-ID * fix lint issue * fix copywrite in license and add re-org readme * fix typo
1 parent a53000b commit e400a43

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2019 Expedia, Inc.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ This is Haystack's client library for Python that implements [OpenTracing](https
77
Further information can be found on [opentracing.io](https://opentracing.io/)
88

99
## Using this library
10-
See examples in /examples directory.
10+
See examples in /examples directory. See opentracing [usage](https://github.com/opentracing/opentracing-python/#usage) for additional information.
11+
1112

1213
First initialize the tracer at the application level by supplying a service name and recorder
1314
```python
@@ -18,10 +19,6 @@ from haystack import HaystackTracer
1819
opentracing.tracer = HaystackTracer("a_service", HaystackAgentRecorder())
1920
```
2021

21-
**If there is a Scope, it will act as the parent to any newly started Span** unless the programmer passes
22-
`ignore_active_span=True` at `start_span()/start_active_span()` time or specified parent context explicitly using
23-
`childOf=parent_context`
24-
2522
Starting a span can be done as a managed resource using `start_active_span()`
2623
```python
2724
with opentracing.tracer.start_active_span("span-name") as scope:
@@ -35,7 +32,16 @@ do_stuff()
3532
span.finish()
3633
```
3734

38-
See opentracing [usage](https://github.com/opentracing/opentracing-python/#usage) for additional information.
35+
Note: **If there is a Scope, it will act as the parent to any newly started Span** unless the programmer passes
36+
`ignore_active_span=True` at `start_span()/start_active_span()` time or specified parent context explicitly using
37+
`childOf=parent_context`
38+
39+
#### Custom propagation headers
40+
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.
41+
```python
42+
prop_opts = PropagatorOpts("X-Trace-ID", "X-Span-ID", "X-Parent-Span", "X-baggage-")
43+
opentracing.tracer.register_propagator(opentracing.Format.HTTP_HEADERS, TextPropagator(prop_opts))
44+
```
3945

4046
#### Logging
4147
All modules define their logger via `logging.getLogger(__name__)`

0 commit comments

Comments
 (0)