Skip to content
OpenCensus Python exporter for Honeycomb
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ochoneycomb
.gitignore
CODE_OF_CONDUCT.md
LICENSE
Makefile
README.md
example.py
setup.py

README.md

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")
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
You can’t perform that action at this time.