Skip to content

Commit 582b1c1

Browse files
authored
Add telemetry endpoint to trace examples (#395)
* Add telemetry endpoint. * Fix formatting
1 parent 1b76dd2 commit 582b1c1

File tree

3 files changed

+2
-1
lines changed

3 files changed

+2
-1
lines changed

samples/otlptrace/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ gcloud auth application-default login
2424
```sh
2525
# export necessary OTEL environment variables
2626
export OTEL_RESOURCE_ATTRIBUTES="gcp.project_id=<project-id>"
27-
export OTEL_EXPORTER_OTLP_ENDPOINT=<endpoint>
2827

2928
# from the samples/otlptrace repository
3029
python3 example_grpc.py

samples/otlptrace/example_grpc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
processor = BatchSpanProcessor(
4747
OTLPSpanExporter(
4848
credentials=channel_creds,
49+
endpoint="https://telemetry.googleapis.com:443/v1/traces",
4950
)
5051
)
5152
trace_provider.add_span_processor(processor)

samples/otlptrace/example_http.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
processor = BatchSpanProcessor(
3232
OTLPSpanExporter(
3333
session=AuthorizedSession(credentials),
34+
endpoint="https://telemetry.googleapis.com:443/v1/traces",
3435
)
3536
)
3637
trace_provider.add_span_processor(processor)

0 commit comments

Comments
 (0)