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

Adding metrics exporter #14

Merged
merged 38 commits into from
May 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
439905d
adding metric export
Mar 27, 2020
939d481
calculating values, filtering metrics
Apr 2, 2020
5c17499
Merge remote-tracking branch 'origin/master' into codeboten/metrics
Apr 24, 2020
5a6e2cc
Merge remote-tracking branch 'origin/master' into codeboten/metrics
Apr 27, 2020
9116a34
adding APIClient to use for both span/metric export
Apr 28, 2020
8d7140c
lowercase S
Apr 28, 2020
82e2623
rely on black over pylint for some formatting
Apr 29, 2020
ac8c288
exclude generated files from formatting
Apr 29, 2020
5bbbf75
minor formatting fixes
Apr 29, 2020
320d6ab
add reporter and util modules
Apr 29, 2020
c953b86
checkpoint checkin, refactor span exporter to use protos directly, re…
Apr 29, 2020
c5b3f8a
fix attributes
Apr 29, 2020
9f3a53f
fix logs
Apr 29, 2020
dc01053
fix env for tests, fix example
Apr 29, 2020
640a724
clean up output
Apr 29, 2020
6f6a7f3
Update .flake8
Apr 29, 2020
ed03dc8
Update pyproject.toml
Apr 29, 2020
f7bb59b
fix flake issues
Apr 29, 2020
5049ca6
cleaning up code
Apr 29, 2020
97b4476
adding isort
Apr 29, 2020
b46f0ed
fixing dependencies
Apr 29, 2020
ab89bb8
add DeprecationWarning
Apr 30, 2020
9ee3291
more cleanup, updating doc on shutdown
Apr 30, 2020
b10d300
adding missing dep
Apr 30, 2020
2028d19
Update src/opentelemetry/ext/lightstep/reporter.py
Apr 30, 2020
2e279e4
Update src/opentelemetry/ext/lightstep/__init__.py
Apr 30, 2020
7b35fcb
Update examples/tracer.py
Apr 30, 2020
b96aef6
use secure bool instead of encryption string, update docs
Apr 30, 2020
ab8930a
more cleanup
Apr 30, 2020
96c7a99
fix lint
Apr 30, 2020
8d55f86
ensure guid is never negative
Apr 30, 2020
bd0283d
fixed negative duration
Apr 30, 2020
9ae5055
update deps
Apr 30, 2020
91e856d
update deps
Apr 30, 2020
cd02458
pin otel dependencies
Apr 30, 2020
2491d23
update user agent
Apr 30, 2020
aa03a6a
updating tests
Apr 30, 2020
aa2bee2
updating changelog
Apr 30, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ ignore =
F401 # unused import, defer to pylint
W503 # allow line breaks after binary ops, not after
E203 # allow whitespace before ':' (https://github.com/psf/black#slices)
exclude =
src/opentelemetry/ext/lightstep/protobuf
9 changes: 3 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ jobs:
pip install .
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
pip install -r dev-requirements.txt
make lint
- name: Test with pytest
run: |
pip install pytest
pip install pytest .[test]
pytest
16 changes: 16 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[settings]
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=79

; 3 stands for Vertical Hanging Indent, e.g.
; from third_party import (
; lib1,
; lib2,
; lib3,
; )
; docs: https://github.com/timothycrosley/isort#multi-line-output-modes
multi_line_output=3
skip=target
skip_glob=**/protobuf/*
10 changes: 9 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,15 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=protected-access,too-many-instance-attributes,too-few-public-methods,too-many-arguments,redefined-outer-name,line-too-long,W0141
disable=protected-access,
too-many-instance-attributes,
too-few-public-methods,
too-many-arguments,
redefined-outer-name,
line-too-long,
W0141,
missing-docstring,
bad-continuation, # leave this up to black

[REPORTS]

Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
## Unreleased

v0.6b3
======

### Changes

* Adding LightstepMetricsExporter
* Refactor LightStepSpanExporter to remove dependency on lightstep-tracer client
* Deprecating LightStepSpanExporter in favour of LightstepSpanExporter

v0.6b2
======

Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
test:
pip install -e .[test]
pytest

cover:
pytest --cov src/opentelemetry/ext/lightstep

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

clean-dist:
rm -Rf ./dist
Expand Down
4 changes: 4 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
flake8
black
isort
pylint
6 changes: 2 additions & 4 deletions examples/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
import os

from opentelemetry import trace
from opentelemetry.ext.lightstep import LightStepSpanExporter
from opentelemetry.ext.lightstep import LightstepSpanExporter
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchExportSpanProcessor


# configure the LightStepSpanExporter as our exporter
exporter = LightStepSpanExporter(
exporter = LightstepSpanExporter(
name=os.getenv("LIGHTSTEP_SERVICE_NAME", "test-service-name"),
token=os.getenv("LIGHTSTEP_ACCESS_TOKEN", ""),
verbosity=5,
host="ingest.staging.lightstep.com",
service_version=os.getenv("LIGHTSTEP_SERVICE_VERSION", "0.0.1"),
)
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[tool.black]
line-length = 79
exclude = '''
(
/( # generated files
src/opentelemetry/ext/lightstep/protobuf
)/
)
'''
14 changes: 10 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ package_dir=
=src
packages=find_namespace:
install_requires =
thrift >= 0.10.0
opentelemetry-api >= 0.6b0
opentelemetry-sdk >= 0.6b0
lightstep
backoff~=1.10.0
googleapis-common-protos>=1.5.3,<2.0
protobuf>3.7.1,<4.0
requests>=2.19,<3.0
opentelemetry-api == 0.6b0
opentelemetry-sdk == 0.6b0

[options.extras_require]
test =
httpretty~=1.0.2

[options.packages.find]
where = src
Loading