From 9d65db7641b44625c308a740e0fce3f1011516e4 Mon Sep 17 00:00:00 2001 From: arunk1988 Date: Wed, 3 Jul 2024 23:16:28 -0400 Subject: [PATCH 1/8] test --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test diff --git a/test b/test new file mode 100644 index 0000000000..e69de29bb2 From 40583d6f0a25641a0ee5e32fb0d2b6edba1ec914 Mon Sep 17 00:00:00 2001 From: arunk1988 Date: Thu, 4 Jul 2024 00:20:38 -0400 Subject: [PATCH 2/8] Update opentracing and opencesus docs examples to not use JaegerExporter #3970 --- docs/examples/opencensus-shim/README.rst | 8 ++++---- docs/examples/opencensus-shim/app.py | 7 +++---- docs/examples/opencensus-shim/requirements.txt | 2 +- docs/examples/opentracing/README.rst | 8 ++++---- docs/examples/opentracing/main.py | 17 ++++++++++------- docs/examples/opentracing/requirements.txt | 2 +- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/docs/examples/opencensus-shim/README.rst b/docs/examples/opencensus-shim/README.rst index 9c24440172..f620fdc086 100644 --- a/docs/examples/opencensus-shim/README.rst +++ b/docs/examples/opencensus-shim/README.rst @@ -20,10 +20,10 @@ Start Jaeger .. code-block:: sh docker run --rm \ - -p 6831:6831/udp \ - -p 6832:6832/udp \ + -p 4317:4317 \ + -p 4318:4318 \ -p 16686:16686 \ - jaegertracing/all-in-one:1.13 \ + jaegertracing/all-in-one:latest \ --log-level=debug Python Dependencies @@ -43,7 +43,7 @@ Alternatively, you can install the Python dependencies separately: pip install \ opentelemetry-api \ opentelemetry-sdk \ - opentelemetry-exporter-jaeger \ + opentelemetry-exporter-otlp \ opentelemetry-opencensus-shim \ opentelemetry-instrumentation-sqlite3 \ opencensus \ diff --git a/docs/examples/opencensus-shim/app.py b/docs/examples/opencensus-shim/app.py index 5c8b7f744b..06e5f6fb13 100644 --- a/docs/examples/opencensus-shim/app.py +++ b/docs/examples/opencensus-shim/app.py @@ -18,7 +18,7 @@ from opencensus.ext.flask.flask_middleware import FlaskMiddleware from opentelemetry import trace -from opentelemetry.exporter.jaeger.thrift import JaegerExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter from opentelemetry.instrumentation.sqlite3 import SQLite3Instrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider @@ -40,9 +40,8 @@ # Configure OTel to export traces to Jaeger tracer_provider.add_span_processor( BatchSpanProcessor( - JaegerExporter( - agent_host_name="localhost", - agent_port=6831, + OTLPSpanExporter( + endpoint="localhost:4317", ) ) ) diff --git a/docs/examples/opencensus-shim/requirements.txt b/docs/examples/opencensus-shim/requirements.txt index da9f0f3f96..9e619db7c9 100644 --- a/docs/examples/opencensus-shim/requirements.txt +++ b/docs/examples/opencensus-shim/requirements.txt @@ -1,6 +1,6 @@ opentelemetry-api opentelemetry-sdk -opentelemetry-exporter-jaeger +opentelemetry-exporter-otlp opentelemetry-opencensus-shim opentelemetry-instrumentation-sqlite3 opencensus diff --git a/docs/examples/opentracing/README.rst b/docs/examples/opentracing/README.rst index 0bf5f8dca3..d811c36fd4 100644 --- a/docs/examples/opentracing/README.rst +++ b/docs/examples/opentracing/README.rst @@ -26,10 +26,10 @@ Start Jaeger .. code-block:: sh docker run --rm \ - -p 6831:6831/udp \ - -p 6832:6832/udp \ + -p 4317:4317 \ + -p 4318:4318 \ -p 16686:16686 \ - jaegertracing/all-in-one:1.13 \ + jaegertracing/all-in-one:latest \ --log-level=debug Redis @@ -61,7 +61,7 @@ Alternatively, you can install the Python dependencies separately: pip install \ opentelemetry-api \ opentelemetry-sdk \ - opentelemetry-exporter-jaeger \ + opentelemetry-exporter-otlp \ opentelemetry-opentracing-shim \ redis \ redis_opentracing diff --git a/docs/examples/opentracing/main.py b/docs/examples/opentracing/main.py index 3975c4a45d..584463e18c 100755 --- a/docs/examples/opentracing/main.py +++ b/docs/examples/opentracing/main.py @@ -3,7 +3,7 @@ from rediscache import RedisCache from opentelemetry import trace -from opentelemetry.exporter.jaeger.thrift import JaegerExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.shim import opentracing_shim @@ -12,13 +12,16 @@ trace.set_tracer_provider(TracerProvider()) tracer_provider = trace.get_tracer_provider() -# Configure the tracer to export traces to Jaeger -jaeger_exporter = JaegerExporter( - agent_host_name="localhost", - agent_port=6831, +# Create an OTLP gRPC span exporter +otlp_exporter = OTLPSpanExporter( + endpoint="localhost:4317", + # For insecure connection, useful for testing + insecure=True +) +# Add the exporter to the tracer provider +trace.get_tracer_provider().add_span_processor( + BatchSpanProcessor(otlp_exporter) ) -span_processor = BatchSpanProcessor(jaeger_exporter) -tracer_provider.add_span_processor(span_processor) # Create an OpenTracing shim. This implements the OpenTracing tracer API, but # forwards calls to the underlying OpenTelemetry tracer. diff --git a/docs/examples/opentracing/requirements.txt b/docs/examples/opentracing/requirements.txt index fa4b520936..db390be5fd 100644 --- a/docs/examples/opentracing/requirements.txt +++ b/docs/examples/opentracing/requirements.txt @@ -1,6 +1,6 @@ opentelemetry-api opentelemetry-sdk -opentelemetry-exporter-jaeger +opentelemetry-exporter-otlp opentelemetry-opentracing-shim redis redis_opentracing From e1f70d3065bd12154f405f9ab0dc75b5e4f33176 Mon Sep 17 00:00:00 2001 From: arunk1988 <84958541+arunk1988@users.noreply.github.com> Date: Thu, 4 Jul 2024 22:25:14 +0530 Subject: [PATCH 3/8] Update docs/examples/opencensus-shim/app.py Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> --- docs/examples/opencensus-shim/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/opencensus-shim/app.py b/docs/examples/opencensus-shim/app.py index 06e5f6fb13..222197d4f3 100644 --- a/docs/examples/opencensus-shim/app.py +++ b/docs/examples/opencensus-shim/app.py @@ -41,7 +41,7 @@ tracer_provider.add_span_processor( BatchSpanProcessor( OTLPSpanExporter( - endpoint="localhost:4317", + endpoint="localhost:4317", ) ) ) From 13d0dd9171f5f162a2f1f47eb6dab0df994d50ee Mon Sep 17 00:00:00 2001 From: arunk1988 <84958541+arunk1988@users.noreply.github.com> Date: Fri, 5 Jul 2024 06:53:01 +0530 Subject: [PATCH 4/8] Delete test --- test | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test diff --git a/test b/test deleted file mode 100644 index e69de29bb2..0000000000 From 69a9b96b6d04b9f7ebc48cde174564ceb648715f Mon Sep 17 00:00:00 2001 From: arunk1988 <84958541+arunk1988@users.noreply.github.com> Date: Fri, 5 Jul 2024 06:53:35 +0530 Subject: [PATCH 5/8] Update docs/examples/opentracing/main.py Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> --- docs/examples/opentracing/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/opentracing/main.py b/docs/examples/opentracing/main.py index 584463e18c..3fad786125 100755 --- a/docs/examples/opentracing/main.py +++ b/docs/examples/opentracing/main.py @@ -14,7 +14,7 @@ # Create an OTLP gRPC span exporter otlp_exporter = OTLPSpanExporter( - endpoint="localhost:4317", + endpoint="http://localhost:4317", # For insecure connection, useful for testing insecure=True ) From dd1419f3ed725833122b6c8e0bce5f11c9278ffc Mon Sep 17 00:00:00 2001 From: arunk1988 <84958541+arunk1988@users.noreply.github.com> Date: Fri, 5 Jul 2024 23:47:24 +0530 Subject: [PATCH 6/8] Update docs/examples/opencensus-shim/app.py Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> --- docs/examples/opencensus-shim/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/examples/opencensus-shim/app.py b/docs/examples/opencensus-shim/app.py index 222197d4f3..9103ba5333 100644 --- a/docs/examples/opencensus-shim/app.py +++ b/docs/examples/opencensus-shim/app.py @@ -18,7 +18,9 @@ from opencensus.ext.flask.flask_middleware import FlaskMiddleware from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import ( + OTLPSpanExporter, +) from opentelemetry.instrumentation.sqlite3 import SQLite3Instrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider From 606e3de1f9de6dc0ccbd91d8dc8ff838c25466c1 Mon Sep 17 00:00:00 2001 From: arunk1988 <84958541+arunk1988@users.noreply.github.com> Date: Fri, 5 Jul 2024 23:47:35 +0530 Subject: [PATCH 7/8] Update docs/examples/opentracing/main.py Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> --- docs/examples/opentracing/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/examples/opentracing/main.py b/docs/examples/opentracing/main.py index 3fad786125..b4a80ee0df 100755 --- a/docs/examples/opentracing/main.py +++ b/docs/examples/opentracing/main.py @@ -16,7 +16,7 @@ otlp_exporter = OTLPSpanExporter( endpoint="http://localhost:4317", # For insecure connection, useful for testing - insecure=True + insecure=True, ) # Add the exporter to the tracer provider trace.get_tracer_provider().add_span_processor( From f262108606370a578165a2a414945cee4d8bbdd8 Mon Sep 17 00:00:00 2001 From: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:29:42 -0700 Subject: [PATCH 8/8] Update docs/examples/opentracing/main.py --- docs/examples/opentracing/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/examples/opentracing/main.py b/docs/examples/opentracing/main.py index b4a80ee0df..f8a9c55cc5 100755 --- a/docs/examples/opentracing/main.py +++ b/docs/examples/opentracing/main.py @@ -3,7 +3,9 @@ from rediscache import RedisCache from opentelemetry import trace -from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter +from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import ( + OTLPSpanExporter, +) from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.shim import opentracing_shim