Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update docs #1548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/basic_tracer/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ There are two different examples:

* basic_trace: Shows how to configure a SpanProcessor and Exporter, and how to create a tracer and span.

* resources: Shows how to add resource information to a Provider. Note that this must be run on a Google Compute Engine instance.
* resources: Shows how to add resource information to a Provider.

The source files of these examples are available :scm_web:`here <docs/examples/basic_tracer/>`.

Expand Down
7 changes: 3 additions & 4 deletions docs/examples/basic_tracer/resources.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from opentelemetry import trace
from opentelemetry.sdk.resources import get_aggregated_resources
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import (
ConsoleSpanExporter,
SimpleExportSpanProcessor,
)
from opentelemetry.tools.resource_detector import GoogleCloudResourceDetector

resources = get_aggregated_resources([GoogleCloudResourceDetector()])
resource = Resource.create({"service.name": "basic_service"})

trace.set_tracer_provider(TracerProvider(resource=resources))
trace.set_tracer_provider(TracerProvider(resource=resource))

trace.get_tracer_provider().add_span_processor(
SimpleExportSpanProcessor(ConsoleSpanExporter())
Expand Down