File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ gcloud auth application-default login
2222
2323#### Run the Sample
2424``` sh
25- # export necessary OTEL environment variable
25+ # export necessary OTEL environment variables
2626export OTEL_RESOURCE_ATTRIBUTES=" gcp.project_id=<project-id>"
27+ export OTEL_EXPORTER_OTLP_ENDPOINT=< endpoint>
2728
2829# from the samples/otlptrace repository
2930python3 example_grpc.py
Original file line number Diff line number Diff line change 4646processor = BatchSpanProcessor (
4747 OTLPSpanExporter (
4848 credentials = channel_creds ,
49- endpoint = "https://telemetry.googleapis.com:443/v1/traces" ,
5049 )
5150)
5251trace_provider .add_span_processor (processor )
Original file line number Diff line number Diff line change 2525from opentelemetry .sdk .trace .export import BatchSpanProcessor
2626
2727credentials , project_id = google .auth .default ()
28- trace_provider = TracerProvider (resource = Resource .create (attributes = {SERVICE_NAME : "otlp-gcp-http-sample" }))
28+ trace_provider = TracerProvider (
29+ resource = Resource .create (attributes = {SERVICE_NAME : "otlp-gcp-http-sample" })
30+ )
2931processor = BatchSpanProcessor (
3032 OTLPSpanExporter (
3133 headers = {
3234 "x-goog-user-project" : credentials .quota_project_id ,
3335 },
3436 session = AuthorizedSession (credentials ),
35- endpoint = "https://telemetry.googleapis.com:443/v1/traces" ,
3637 )
3738)
3839trace_provider .add_span_processor (processor )
You can’t perform that action at this time.
0 commit comments