diff --git a/opentelemetry-exporter-cloud-monitoring/README.rst b/opentelemetry-exporter-cloud-monitoring/README.rst index 929d0e94..b73a1c66 100644 --- a/opentelemetry-exporter-cloud-monitoring/README.rst +++ b/opentelemetry-exporter-cloud-monitoring/README.rst @@ -1,5 +1,5 @@ -OpenTelemetry Google Cloud Integration -====================================== +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 @@ -8,14 +8,14 @@ OpenTelemetry Google Cloud Integration :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 +This library provides support for exporting metrics to Google Cloud +Monitoring. For resource detection and GCP trace context propagation, see `opentelemetry-tools-google-cloud -`_. +`_. For the +Google Cloud Trace exporter, see `opentelemetry-exporter-cloud-trace +`_. Installation ------------ @@ -27,32 +27,6 @@ Installation 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 @@ -87,5 +61,5 @@ Metrics References ---------- -* `Cloud Trace `_ +* `Cloud Monitoring `_ * `OpenTelemetry Project `_ diff --git a/opentelemetry-exporter-cloud-monitoring/setup.py b/opentelemetry-exporter-cloud-monitoring/setup.py index 23d69973..66060724 100644 --- a/opentelemetry-exporter-cloud-monitoring/setup.py +++ b/opentelemetry-exporter-cloud-monitoring/setup.py @@ -17,7 +17,12 @@ BASE_DIR = os.path.dirname(__file__) VERSION_FILENAME = os.path.join( - BASE_DIR, "src", "opentelemetry", "exporter", "google", "version.py", + BASE_DIR, + "src", + "opentelemetry", + "exporter", + "cloud_monitoring", + "version.py", ) PACKAGE_INFO = {} with open(VERSION_FILENAME) as f: diff --git a/opentelemetry-exporter-cloud-monitoring/src/opentelemetry/exporter/google/version.py b/opentelemetry-exporter-cloud-monitoring/src/opentelemetry/exporter/cloud_monitoring/version.py similarity index 100% rename from opentelemetry-exporter-cloud-monitoring/src/opentelemetry/exporter/google/version.py rename to opentelemetry-exporter-cloud-monitoring/src/opentelemetry/exporter/cloud_monitoring/version.py diff --git a/opentelemetry-exporter-cloud-trace/README.rst b/opentelemetry-exporter-cloud-trace/README.rst index 48bd998b..66b18639 100644 --- a/opentelemetry-exporter-cloud-trace/README.rst +++ b/opentelemetry-exporter-cloud-trace/README.rst @@ -8,14 +8,14 @@ OpenTelemetry Google Cloud Integration :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 +This library provides support for exporting traces to Google Cloud Trace. For resource detection and GCP trace context propagation, see `opentelemetry-tools-google-cloud -`_. +`_. For the +Google Cloud Monitoring exporter, see +`opentelemetry-exporter-cloud-monitoring +`_. Installation ------------ @@ -27,8 +27,6 @@ Installation Usage ----- -Traces - .. code:: python from opentelemetry import trace @@ -51,39 +49,6 @@ Traces 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 ---------- diff --git a/opentelemetry-exporter-cloud-trace/setup.py b/opentelemetry-exporter-cloud-trace/setup.py index 23d69973..07f0cf68 100644 --- a/opentelemetry-exporter-cloud-trace/setup.py +++ b/opentelemetry-exporter-cloud-trace/setup.py @@ -17,7 +17,7 @@ BASE_DIR = os.path.dirname(__file__) VERSION_FILENAME = os.path.join( - BASE_DIR, "src", "opentelemetry", "exporter", "google", "version.py", + BASE_DIR, "src", "opentelemetry", "exporter", "cloud_trace", "version.py", ) PACKAGE_INFO = {} with open(VERSION_FILENAME) as f: diff --git a/opentelemetry-exporter-cloud-trace/src/opentelemetry/exporter/cloud_trace/__init__.py b/opentelemetry-exporter-cloud-trace/src/opentelemetry/exporter/cloud_trace/__init__.py index d93cf455..c3ab6b99 100644 --- a/opentelemetry-exporter-cloud-trace/src/opentelemetry/exporter/cloud_trace/__init__.py +++ b/opentelemetry-exporter-cloud-trace/src/opentelemetry/exporter/cloud_trace/__init__.py @@ -59,9 +59,7 @@ from google.cloud.trace_v2.proto import trace_pb2 from google.protobuf.timestamp_pb2 import Timestamp from google.rpc import code_pb2, status_pb2 -from opentelemetry.exporter.google.version import ( - __version__ as google_ext_version, -) +from opentelemetry.exporter.cloud_trace.version import __version__ from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import Event from opentelemetry.sdk.trace.export import Span, SpanExporter, SpanExportResult @@ -417,7 +415,7 @@ def _extract_attributes( _strip_characters( pkg_resources.get_distribution("opentelemetry-sdk").version ), - _strip_characters(google_ext_version), + _strip_characters(__version__), ) ) return trace_pb2.Span.Attributes( diff --git a/opentelemetry-exporter-cloud-trace/src/opentelemetry/exporter/google/version.py b/opentelemetry-exporter-cloud-trace/src/opentelemetry/exporter/cloud_trace/version.py similarity index 100% rename from opentelemetry-exporter-cloud-trace/src/opentelemetry/exporter/google/version.py rename to opentelemetry-exporter-cloud-trace/src/opentelemetry/exporter/cloud_trace/version.py diff --git a/opentelemetry-exporter-cloud-trace/tests/test_cloud_trace_exporter.py b/opentelemetry-exporter-cloud-trace/tests/test_cloud_trace_exporter.py index 96346b38..57ea5a9e 100644 --- a/opentelemetry-exporter-cloud-trace/tests/test_cloud_trace_exporter.py +++ b/opentelemetry-exporter-cloud-trace/tests/test_cloud_trace_exporter.py @@ -38,9 +38,7 @@ _strip_characters, _truncate_str, ) -from opentelemetry.exporter.google.version import ( - __version__ as google_ext_version, -) +from opentelemetry.exporter.cloud_trace.version import __version__ from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import Event from opentelemetry.sdk.trace import _Span as Span @@ -90,7 +88,7 @@ def setUpClass(cls): _strip_characters( pkg_resources.get_distribution("opentelemetry-sdk").version ), - _strip_characters(google_ext_version), + _strip_characters(__version__), ) ) cls.example_trace_id = "6e0c63257de34c92bf9efcd03927272e"