Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 3f01007

Browse files
nbutton23reyang
authored andcommitted
Trace exporter for Datadog (#793)
1 parent e5e752c commit 3f01007

File tree

15 files changed

+891
-0
lines changed

15 files changed

+891
-0
lines changed

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,14 @@ Trace Exporter
226226
--------------
227227

228228
- `Azure`_
229+
- `Datadog`_
229230
- `Jaeger`_
230231
- `OCAgent`_
231232
- `Stackdriver`_
232233
- `Zipkin`_
233234

234235
.. _Azure: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-azure
236+
.. _Datadog: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-datadog
235237
.. _Django: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-django
236238
.. _Flask: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-flask
237239
.. _gevent: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-gevent
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
## Unreleased
4+
- Initial version.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from flask import Flask
2+
3+
from opencensus.ext.flask.flask_middleware import FlaskMiddleware
4+
from opencensus.trace.samplers import AlwaysOnSampler
5+
from traces import DatadogTraceExporter
6+
from traces import Options
7+
8+
app = Flask(__name__)
9+
middleware = FlaskMiddleware(app,
10+
blacklist_paths=['/healthz'],
11+
sampler=AlwaysOnSampler(),
12+
exporter=DatadogTraceExporter(
13+
Options(service='python-export-test',
14+
global_tags={"stack": "example"})))
15+
16+
17+
@app.route('/')
18+
def hello():
19+
return 'Hello World!'
20+
21+
22+
if __name__ == '__main__':
23+
app.run(host='0.0.0.0', port=8080, threaded=True)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

0 commit comments

Comments
 (0)