-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate trace/metrics packages out for staggered 1.0 release
- Loading branch information
Showing
27 changed files
with
489 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
OpenTelemetry Google Cloud Integration | ||
====================================== | ||
|
||
.. image:: https://badge.fury.io/py/opentelemetry-exporter-cloud-monitoring.svg | ||
:target: https://badge.fury.io/py/opentelemetry-exporter-cloud-monitoring | ||
|
||
.. image:: https://readthedocs.org/projects/google-cloud-opentelemetry/badge/?version=latest | ||
:target: https://google-cloud-opentelemetry.readthedocs.io/en/latest/?badge=latest | ||
:alt: Documentation Status | ||
|
||
This library provides support for: | ||
|
||
- Exporting traces to Google Cloud Trace | ||
- Exporting metrics to Google Cloud Monitoring | ||
|
||
For resource detection and GCP trace context propagation, see | ||
`opentelemetry-tools-google-cloud | ||
<https://pypi.org/project/opentelemetry-tools-google-cloud/>`_. | ||
|
||
Installation | ||
------------ | ||
|
||
.. code:: bash | ||
pip install opentelemetry-exporter-cloud-monitoring | ||
Usage | ||
----- | ||
|
||
Traces | ||
|
||
.. code:: python | ||
from opentelemetry import trace | ||
from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter | ||
from opentelemetry.sdk.trace import TracerProvider | ||
from opentelemetry.sdk.trace.export import ( | ||
SimpleExportSpanProcessor, | ||
) | ||
trace.set_tracer_provider(TracerProvider()) | ||
cloud_trace_exporter = CloudTraceSpanExporter( | ||
project_id='my-gcloud-project', | ||
) | ||
trace.get_tracer_provider().add_span_processor( | ||
SimpleExportSpanProcessor(cloud_trace_exporter) | ||
) | ||
tracer = trace.get_tracer(__name__) | ||
with tracer.start_as_current_span('foo'): | ||
print('Hello world!') | ||
Metrics | ||
|
||
.. code:: python | ||
import time | ||
from opentelemetry import metrics | ||
from opentelemetry.exporter.cloud_monitoring import ( | ||
CloudMonitoringMetricsExporter, | ||
) | ||
from opentelemetry.sdk.metrics import Counter, MeterProvider | ||
metrics.set_meter_provider(MeterProvider()) | ||
meter = metrics.get_meter(__name__) | ||
metrics.get_meter_provider().start_pipeline( | ||
meter, CloudMonitoringMetricsExporter(), 5 | ||
) | ||
requests_counter = meter.create_counter( | ||
name="request_counter", | ||
description="number of requests", | ||
unit="1", | ||
value_type=int | ||
) | ||
staging_labels = {"environment": "staging"} | ||
for i in range(20): | ||
requests_counter.add(25, staging_labels) | ||
time.sleep(10) | ||
References | ||
---------- | ||
|
||
* `Cloud Trace <https://cloud.google.com/trace/>`_ | ||
* `OpenTelemetry Project <https://opentelemetry.io/>`_ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[metadata] | ||
name = opentelemetry-exporter-cloud-monitoring | ||
description = Google Cloud Monitoring exporter for OpenTelemetry | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
author = Google | ||
author_email = [email protected] | ||
url = https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/tree/master/opentelemetry-exporter-cloud-monitoring | ||
platforms = any | ||
license = Apache-2.0 | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: Apache Software License | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.5 | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
|
||
[options] | ||
python_requires = >=3.5 | ||
package_dir= | ||
=src | ||
packages=find_namespace: | ||
install_requires = | ||
google-cloud-monitoring <2.0.0 | ||
opentelemetry-api ~= 0.17b0 | ||
opentelemetry-sdk ~= 0.17b0 | ||
|
||
[options.packages.find] | ||
where = src | ||
|
||
[options.extras_require] | ||
test = |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Changelog | ||
|
||
## Unreleased | ||
|
||
## Version 0.17b0 | ||
|
||
Released 2021-02-04 | ||
|
||
## Version 0.16b1 | ||
|
||
Released 2021-01-14 | ||
|
||
- Add mapping between opentelemetry and google traces attributes | ||
([#90](https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/pull/90)) | ||
|
||
## Version 0.15b0 | ||
|
||
Released 2020-11-04 | ||
|
||
## Version 0.14b0 | ||
|
||
Released 2020-10-27 | ||
|
||
- Fix breakages for opentelemetry-python v0.14b0 | ||
([#79](https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/pull/79), | ||
[#83](https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/pull/83)) | ||
|
||
## Version 0.13b0 | ||
|
||
Released 2020-09-17 | ||
|
||
## Version 0.12b0 | ||
|
||
Released 2020-08-17 | ||
|
||
- Add spankind support for trace exporter | ||
([#58](https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/pull/58)) | ||
|
||
## Version 0.11b0 | ||
|
||
Released 2020-08-05 | ||
|
||
- Add support for resources | ||
([#853](https://github.com/open-telemetry/opentelemetry-python/pull/853)) | ||
|
||
## Version 0.10b0 | ||
|
||
Released 2020-06-23 | ||
|
||
- Add g.co/agent label for Google internal metrics tracking | ||
([#833](https://github.com/open-telemetry/opentelemetry-python/pull/833)) | ||
- Adding trouble-shooting tips | ||
([#827](https://github.com/open-telemetry/opentelemetry-python/pull/827)) | ||
- Added Cloud Trace context propagation | ||
([#819](https://github.com/open-telemetry/opentelemetry-python/pull/819)) | ||
- Added tests to tox coverage files | ||
([#804](https://github.com/open-telemetry/opentelemetry-python/pull/804)) | ||
- Add ability for exporter to add unique identifier | ||
([#841](https://github.com/open-telemetry/opentelemetry-python/pull/841)) | ||
- Added tests to tox coverage files | ||
([#804](https://github.com/open-telemetry/opentelemetry-python/pull/804)) | ||
|
||
## 0.9b0 | ||
|
||
Released 2020-06-10 | ||
|
||
- Initial release |
Oops, something went wrong.