Skip to content
This repository was archived by the owner on Aug 28, 2020. It is now read-only.

Commit e673826

Browse files
alrexocelotl
alrex
andauthored
new: usr: Adding LightstepMetricsExporter (#14)
There are a few parts in this change: - adding a MetricExporter for Lightstep - refactoring LightStepSpanExporter to use protobuf directly rather than through lightstep library - cleaning up some pylint/flake Co-Authored-By: Diego Hurtado <[email protected]>
1 parent 3fb21f9 commit e673826

21 files changed

+2088
-152
lines changed

.flake8

+2
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ ignore =
44
F401 # unused import, defer to pylint
55
W503 # allow line breaks after binary ops, not after
66
E203 # allow whitespace before ':' (https://github.com/psf/black#slices)
7+
exclude =
8+
src/opentelemetry/ext/lightstep/protobuf

.github/workflows/build.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ jobs:
1919
pip install .
2020
- name: Lint with flake8
2121
run: |
22-
pip install flake8
23-
# stop the build if there are Python syntax errors or undefined names
24-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
25-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
26-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
22+
pip install -r dev-requirements.txt
23+
make lint
2724
- name: Test with pytest
2825
run: |
29-
pip install pytest
26+
pip install pytest .[test]
3027
pytest

.isort.cfg

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[settings]
2+
include_trailing_comma=True
3+
force_grid_wrap=0
4+
use_parentheses=True
5+
line_length=79
6+
7+
; 3 stands for Vertical Hanging Indent, e.g.
8+
; from third_party import (
9+
; lib1,
10+
; lib2,
11+
; lib3,
12+
; )
13+
; docs: https://github.com/timothycrosley/isort#multi-line-output-modes
14+
multi_line_output=3
15+
skip=target
16+
skip_glob=**/protobuf/*

.pylintrc

+9-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,15 @@ confidence=
7070
# --enable=similarities". If you want to run only the classes checker, but have
7171
# no warning level messages displayed, use"--disable=all --enable=classes
7272
# --disable=W"
73-
disable=protected-access,too-many-instance-attributes,too-few-public-methods,too-many-arguments,redefined-outer-name,line-too-long,W0141
73+
disable=protected-access,
74+
too-many-instance-attributes,
75+
too-few-public-methods,
76+
too-many-arguments,
77+
redefined-outer-name,
78+
line-too-long,
79+
W0141,
80+
missing-docstring,
81+
bad-continuation, # leave this up to black
7482

7583
[REPORTS]
7684

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
## Unreleased
22

3+
v0.6b3
4+
======
5+
6+
### Changes
7+
8+
* Adding LightstepMetricsExporter
9+
* Refactor LightStepSpanExporter to remove dependency on lightstep-tracer client
10+
* Deprecating LightStepSpanExporter in favour of LightstepSpanExporter
11+
312
v0.6b2
413
======
514

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
test:
2+
pip install -e .[test]
23
pytest
34

45
cover:
56
pytest --cov src/opentelemetry/ext/lightstep
67

78
lint:
8-
pip install black
9-
black .
9+
black . --diff --check
10+
isort --recursive .
11+
# stop the build if there are Python syntax errors or undefined names
12+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
13+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
14+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
1015

1116
clean-dist:
1217
rm -Rf ./dist

dev-requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
flake8
2+
black
3+
isort
4+
pylint

examples/tracer.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
import os
33

44
from opentelemetry import trace
5-
from opentelemetry.ext.lightstep import LightStepSpanExporter
5+
from opentelemetry.ext.lightstep import LightstepSpanExporter
66
from opentelemetry.sdk.trace import TracerProvider
77
from opentelemetry.sdk.trace.export import BatchExportSpanProcessor
88

9-
109
# configure the LightStepSpanExporter as our exporter
11-
exporter = LightStepSpanExporter(
10+
exporter = LightstepSpanExporter(
1211
name=os.getenv("LIGHTSTEP_SERVICE_NAME", "test-service-name"),
1312
token=os.getenv("LIGHTSTEP_ACCESS_TOKEN", ""),
14-
verbosity=5,
1513
host="ingest.staging.lightstep.com",
1614
service_version=os.getenv("LIGHTSTEP_SERVICE_VERSION", "0.0.1"),
1715
)

pyproject.toml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[tool.black]
2+
line-length = 79
3+
exclude = '''
4+
(
5+
/( # generated files
6+
src/opentelemetry/ext/lightstep/protobuf
7+
)/
8+
)
9+
'''

setup.cfg

+10-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ package_dir=
2424
=src
2525
packages=find_namespace:
2626
install_requires =
27-
thrift >= 0.10.0
28-
opentelemetry-api >= 0.6b0
29-
opentelemetry-sdk >= 0.6b0
30-
lightstep
27+
backoff~=1.10.0
28+
googleapis-common-protos>=1.5.3,<2.0
29+
protobuf>3.7.1,<4.0
30+
requests>=2.19,<3.0
31+
opentelemetry-api == 0.6b0
32+
opentelemetry-sdk == 0.6b0
33+
34+
[options.extras_require]
35+
test =
36+
httpretty~=1.0.2
3137

3238
[options.packages.find]
3339
where = src

0 commit comments

Comments
 (0)