diff --git a/docs/examples/opencensus-shim/app.py b/docs/examples/opencensus-shim/app.py index 9103ba53337..6a110d8f0ff 100644 --- a/docs/examples/opencensus-shim/app.py +++ b/docs/examples/opencensus-shim/app.py @@ -31,7 +31,7 @@ # Set up OpenTelemetry tracer_provider = TracerProvider( - resource=Resource( + resource=Resource.create( { "service.name": "opencensus-shim-example-flask", } diff --git a/docs/exporter/prometheus/prometheus.rst b/docs/exporter/prometheus/prometheus.rst index f5c446f1cdf..d7a46793312 100644 --- a/docs/exporter/prometheus/prometheus.rst +++ b/docs/exporter/prometheus/prometheus.rst @@ -27,7 +27,7 @@ Prometheus text format on request:: from opentelemetry.sdk.resources import SERVICE_NAME, Resource # Service name is required for most backends - resource = Resource(attributes={ + resource = Resource.create(attributes={ SERVICE_NAME: "your-service-name" }) diff --git a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/__init__.py index 12275ef481a..93972cc9af4 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/__init__.py @@ -50,7 +50,7 @@ # Resource can be required for some backends, e.g. Jaeger # If resource wouldn't be set - traces wouldn't appears in Jaeger - resource = Resource(attributes={ + resource = Resource.create({ "service.name": "service" }) diff --git a/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/__init__.py b/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/__init__.py index b8f92bd9a87..745a60424e7 100644 --- a/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/__init__.py +++ b/exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/__init__.py @@ -50,7 +50,7 @@ # Resource can be required for some backends, e.g. Jaeger # If resource wouldn't be set - traces wouldn't appears in Jaeger - resource = Resource(attributes={ + resource = Resource.create({ "service.name": "service" })