Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codeboten/ochoneycomb
OpenCensus Python exporter for Honeycomb
https://github.com/codeboten/ochoneycomb
Last synced: 3 months ago
JSON representation
OpenCensus Python exporter for Honeycomb
- Host: GitHub
- URL: https://github.com/codeboten/ochoneycomb
- Owner: codeboten
- License: apache-2.0
- Created: 2019-03-01T08:02:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-03-19T04:43:23.000Z (over 5 years ago)
- Last Synced: 2023-11-28T10:44:03.578Z (7 months ago)
- Language: Python
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Lists
- awesome-opencensus - ochoneycomb
README
# OpenCensus Python exporter for Honeycomb
A simple exporter to translate OpenCensus span data into Honeycomb traces.
## Example
```python
import time
import osfrom opencensus.trace import tracer as tracer_module
from ochoneycomb import HoneycombExporterexporter = 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
```bash
pip install ochoneycomb
```## Requirements
```bash
pip install opencensus
pip install libhoney
```