Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics Implementation #160

Merged
merged 96 commits into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from 95 commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
6ca4274
Create functions
lzchen Jul 29, 2019
b23cec1
fix lint
lzchen Jul 31, 2019
981eece
Fix lint
lzchen Jul 31, 2019
8ea9709
fix typing
lzchen Jul 31, 2019
00b4f11
Remove options, constructors, seperate labels
lzchen Aug 6, 2019
34c87ce
Consistent naming for float and int
lzchen Aug 6, 2019
df8ae34
Abstract time series
lzchen Aug 6, 2019
a2561ac
Use ABC
lzchen Aug 6, 2019
1ece493
Fix typo
lzchen Aug 6, 2019
ce9268a
Fix docs
lzchen Aug 6, 2019
f5f9f01
seperate measure classes
lzchen Aug 8, 2019
74a1815
Add examples
lzchen Aug 8, 2019
0a0b8ee
fix lint
lzchen Aug 8, 2019
555bf50
Update to RFC 0003
lzchen Aug 14, 2019
d6b1113
Add spancontext, measurebatch
lzchen Aug 14, 2019
c819109
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
lzchen Aug 15, 2019
18cfc71
Fix docs
lzchen Aug 15, 2019
f646555
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
lzchen Aug 19, 2019
a44cb47
Fix comments
lzchen Aug 22, 2019
94eaad9
fix lint
lzchen Aug 22, 2019
fc251b2
fix lint
lzchen Aug 22, 2019
262f312
fix lint
lzchen Aug 22, 2019
66c0a56
skip examples
lzchen Aug 22, 2019
e2c4a7e
white space
lzchen Aug 22, 2019
2fb7646
fix spacing
lzchen Aug 22, 2019
eb711cb
fix imports
lzchen Aug 22, 2019
baa3a32
fix imports
lzchen Aug 22, 2019
5c30a9c
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
lzchen Sep 3, 2019
211b20c
LabelValues to str
lzchen Sep 3, 2019
bffe040
Black formatting
lzchen Sep 3, 2019
0759b9a
fix isort
lzchen Sep 3, 2019
44d62f8
Remove aggregation
lzchen Sep 12, 2019
c5ab2df
Fix names
lzchen Sep 12, 2019
50d2de5
Remove aggregation from docs
lzchen Sep 12, 2019
d79bc7d
Fix lint
lzchen Sep 12, 2019
7fb7cdf
metric changes
lzchen Sep 13, 2019
79322f5
Typing
lzchen Sep 13, 2019
db242f0
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
lzchen Sep 13, 2019
f9c7cc3
Fix lint
lzchen Sep 13, 2019
4465929
Fix lint
lzchen Sep 13, 2019
695e596
Add space
lzchen Sep 13, 2019
ee43e39
Fix lint
lzchen Sep 13, 2019
e59f7c4
fix comments
lzchen Sep 16, 2019
9946028
handle, recordbatch
lzchen Sep 16, 2019
e1a3101
docs
lzchen Sep 16, 2019
47d5209
Update recordbatch
lzchen Sep 16, 2019
2553b89
black
lzchen Sep 16, 2019
15c2894
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
lzchen Sep 19, 2019
ebcc567
Fix typo
lzchen Sep 19, 2019
41ee12c
remove ValueType
lzchen Sep 19, 2019
62862a2
fix lint
lzchen Sep 19, 2019
b99dd3f
sdk
lzchen Sep 19, 2019
dda2966
metrics
lzchen Sep 20, 2019
38e5130
example
lzchen Sep 20, 2019
006bd89
counter
lzchen Sep 21, 2019
ae94dea
Tests
lzchen Sep 22, 2019
eed2cce
merge
lzchen Sep 22, 2019
a16556e
Address comments
lzchen Sep 23, 2019
3b0d251
ADd tests
lzchen Sep 23, 2019
8f2a216
Fix typing and examples
lzchen Sep 24, 2019
4f4e385
black
lzchen Sep 24, 2019
c0f1d10
fix lint
lzchen Sep 24, 2019
bbdc9df
remove override
lzchen Sep 24, 2019
bc617c0
Fix tests
lzchen Sep 24, 2019
081556b
mypy
lzchen Sep 24, 2019
77650be
fix lint
lzchen Sep 24, 2019
d1b8c32
fix type
lzchen Sep 24, 2019
1a8a037
fix typing
lzchen Sep 24, 2019
5c58f93
fix tests
lzchen Sep 24, 2019
1886a7e
isort
lzchen Sep 24, 2019
90fbbbb
isort
lzchen Sep 24, 2019
f602d70
isort
lzchen Sep 24, 2019
3d6654b
isort
lzchen Sep 24, 2019
6cd6ede
noop
lzchen Sep 25, 2019
d8e9a64
lint
lzchen Sep 25, 2019
311b1c4
lint
lzchen Sep 25, 2019
8ea1bd7
fix tuple typing
lzchen Sep 26, 2019
417231d
Merge branch 'metrics' of https://github.com/lzchen/opentelemetry-pyt…
lzchen Sep 26, 2019
1090a6c
fix type
lzchen Sep 26, 2019
18e6a11
black
lzchen Sep 26, 2019
4b03cb7
address comments
lzchen Sep 26, 2019
cedcd1e
fix type
lzchen Sep 26, 2019
77854c9
fix lint
lzchen Sep 26, 2019
605c947
remove imports
lzchen Sep 26, 2019
031bd1f
default tests
lzchen Sep 26, 2019
071b25b
fix lint
lzchen Sep 26, 2019
00eaea3
usse sequence
lzchen Sep 27, 2019
554b7b1
remove ellipses
lzchen Sep 27, 2019
7668de4
remove ellipses
lzchen Sep 27, 2019
61bef29
black
lzchen Sep 27, 2019
b26abba
Merge branch 'master' of https://github.com/open-telemetry/openteleme…
lzchen Sep 27, 2019
6564a3a
Fix typo
lzchen Sep 27, 2019
1083d7e
fix example
lzchen Sep 27, 2019
248e53e
fix type
lzchen Sep 27, 2019
56df6ac
fix type
lzchen Sep 27, 2019
2130ce8
address comments
lzchen Sep 27, 2019
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
5 changes: 0 additions & 5 deletions docs/opentelemetry.metrics.handle.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/opentelemetry.metrics.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
opentelemetry.metrics package
=============================

Submodules
----------

.. toctree::

opentelemetry.metrics.handle

Module contents
---------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,29 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""
This module serves as an example for a simple application using metrics
"""

# pylint: skip-file
from opentelemetry import metrics
from opentelemetry.sdk.metrics import Counter, Meter

METER = metrics.Meter()
MEASURE = metrics.create_measure(
"idle_cpu_percentage",
"cpu idle over time",
"percentage",
metrics.ValueType.FLOAT,
["environment"],
metrics.set_preferred_meter_implementation(lambda _: Meter())
meter = metrics.meter()
counter = meter.create_metric(
"available memory",
"available memory",
"bytes",
int,
Counter,
("environment",),
)

# Metrics sent to some exporter
MEASURE_METRIC_TESTING = MEASURE.get_handle("Testing")
MEASURE_METRIC_STAGING = MEASURE.get_handle("Staging")

# record individual measures
STATISTIC = 100
MEASURE_METRIC_STAGING.record(STATISTIC)
label_values = ("staging",)
counter_handle = counter.get_handle(label_values)
counter_handle.add(100)
meter.record_batch(label_values, [(counter, 50)])
print(counter_handle.data)

# Batch recording
METER.record_batch([tuple(MEASURE_METRIC_STAGING, STATISTIC)])
# TODO: exporters
Loading