OpenCensus exporter for Honeycomb
Project description
OpenCensus Python exporter for Honeycomb
A simple exporter to translate OpenCensus span data into Honeycomb traces.
Example
import time
import os
from opencensus.trace import tracer as tracer_module
from ochoneycomb import HoneycombExporter
exporter = HoneycombExporter(writekey=os.getenv("HONEYCOMB_WRITEKEY"), dataset=os.getenv("HONEYCOMB_DATASET"), service_name="test-app")
# exporter = file_exporter.FileExporter(file_name='traces')
# Initialize a tracer, by default using the `PrintExporter`
tracer = tracer_module.Tracer(exporter=exporter)
def do_something_to_trace():
time.sleep(1)
# Example for creating nested spans
with tracer.span(name='span1') as span1:
do_something_to_trace()
with tracer.span(name='span1_child1') as span1_child1:
span1_child1.add_annotation("something")
do_something_to_trace()
with tracer.span(name='span1_child2') as span1_child2:
do_something_to_trace()
with tracer.span(name='span2') as span2:
do_something_to_trace()
Install
pip install ochoneycomb
Requirements
pip install opencensus
pip install libhoney
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ochoneycomb-0.0.1.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for ochoneycomb-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c95ee2dd2755a2c3316c30648c41b51fb646c9a459c6a74ebf253e9552517079 |
|
MD5 | 6c04c4c953e35971126ede331bdb6937 |
|
BLAKE2b-256 | a7cde276b2171dea1a604b39b4e58d4ffe8ba71c45708f9ead18e44a251742aa |