Skip to content

Commit

Permalink
separate trace/metrics packages out for staggered 1.0 release (#107)
Browse files Browse the repository at this point in the history
* separate trace/metrics packages out for staggered 1.0 release

* update docs

* move ambiguous version.py files
  • Loading branch information
aabmass authored Apr 6, 2021
1 parent 34bf045 commit 249ec10
Show file tree
Hide file tree
Showing 30 changed files with 492 additions and 75 deletions.
3 changes: 2 additions & 1 deletion docs-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ Sphinx
sphinx-autodoc-typehints
opentelemetry-api
opentelemetry-sdk
-e ./opentelemetry-exporter-google-cloud
-e ./opentelemetry-exporter-cloud-trace
-e ./opentelemetry-exporter-cloud-monitoring
-e ./opentelemetry-tools-google-cloud
4 changes: 2 additions & 2 deletions docs/cloud_monitoring/cloud_monitoring.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
OpenTelemetry Cloud Monitoring Exporter
=======================================

.. image:: https://badge.fury.io/py/opentelemetry-exporter-google-cloud.svg
:target: https://badge.fury.io/py/opentelemetry-exporter-google-cloud
.. image:: https://badge.fury.io/py/opentelemetry-exporter-cloud-monitoring.svg
:target: https://badge.fury.io/py/opentelemetry-exporter-cloud-monitoring

.. automodule:: opentelemetry.exporter.cloud_monitoring
:members:
Expand Down
4 changes: 2 additions & 2 deletions docs/cloud_trace/cloud_trace.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
OpenTelemetry Cloud Trace Exporter
==================================

.. image:: https://badge.fury.io/py/opentelemetry-exporter-google-cloud.svg
:target: https://badge.fury.io/py/opentelemetry-exporter-google-cloud
.. image:: https://badge.fury.io/py/opentelemetry-exporter-cloud-trace.svg
:target: https://badge.fury.io/py/opentelemetry-exporter-cloud-trace

.. automodule:: opentelemetry.exporter.cloud_trace
:members:
Expand Down
4 changes: 1 addition & 3 deletions docs/examples/cloud_monitoring/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ To use this exporter you first need to:

.. code-block:: sh
pip install opentelemetry-api
pip install opentelemetry-sdk
pip install opentelemetry-exporter-google-cloud
pip install opentelemetry-exporter-cloud-monitoring opentelemetry-api opentelemetry-sdk
* Run example

Expand Down
4 changes: 1 addition & 3 deletions docs/examples/cloud_trace_exporter/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ To use this exporter you first need to:

.. code-block:: sh
pip install opentelemetry-api
pip install opentelemetry-sdk
pip install opentelemetry-exporter-google-cloud
pip install opentelemetry-exporter-cloud-trace opentelemetry-api opentelemetry-sdk
* Run a basic example locally

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

- Split cloud trace and cloud monitoring exporters into separate packages
([#107](https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/pull/107))

## Version 0.18b0

Released 2021-03-31
Expand Down
File renamed without changes.
65 changes: 65 additions & 0 deletions opentelemetry-exporter-cloud-monitoring/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
OpenTelemetry Google Cloud Monitoring Exporter
==============================================

.. 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 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/>`_. For the
Google Cloud Trace exporter, see `opentelemetry-exporter-cloud-trace
<https://pypi.org/project/opentelemetry-exporter-cloud-trace/>`_.

Installation
------------

.. code:: bash
pip install opentelemetry-exporter-cloud-monitoring
Usage
-----

.. 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 Monitoring <https://cloud.google.com/monitoring>`_
* `OpenTelemetry Project <https://opentelemetry.io/>`_
36 changes: 36 additions & 0 deletions opentelemetry-exporter-cloud-monitoring/setup.cfg
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 =
34 changes: 34 additions & 0 deletions opentelemetry-exporter-cloud-monitoring/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2021 The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.
import os

import setuptools

BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR,
"src",
"opentelemetry",
"exporter",
"cloud_monitoring",
"version.py",
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
exec(f.read(), PACKAGE_INFO)

setuptools.setup(
version=PACKAGE_INFO["__version__"],
package_data={"opentelemetry": ["py.typed"]},
)
74 changes: 74 additions & 0 deletions opentelemetry-exporter-cloud-trace/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Changelog

## Unreleased

- Split cloud trace and cloud monitoring exporters into separate packages
([#107](https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/pull/107))

## Version 0.18b0

Released 2021-03-31

## 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
Loading

0 comments on commit 249ec10

Please sign in to comment.