Skip to content

Commit 2acb426

Browse files
author
Lingling Peng
committed
update signoz export documentation
1 parent 41b0c30 commit 2acb426

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

.env.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Here are the environment variables you can set for the Synapse Python client to configure OpenTelemetry tracing and metrics:
22
# You can copy this file to `.env` and fill in the values as needed.
33
# OTEL_SERVICE_NAME=my-service-using-synapse-python-client
4-
# OTEL_EXPORTER_OTLP_ENDPOINT=http://fill-me-in
5-
# OTEL_SERVICE_INSTANCE_ID=local_development_testing
6-
# OTEL_EXPORTER_OTLP_HEADERS=# Authorization
4+
# OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.us.signoz.cloud
5+
# OTEL_SERVICE_INSTANCE_ID=local
6+
# OTEL_EXPORTER_OTLP_HEADERS=signoz-ingestion-key=<your key>

README.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -280,43 +280,42 @@ OpenTelemetry (OTEL)
280280

281281
Read more about OpenTelemetry in Python [here](https://opentelemetry.io/docs/instrumentation/python/)
282282

283-
### Quick-start
284-
The following shows an example of setting up [jaegertracing](https://www.jaegertracing.io/docs/1.50/deployment/#all-in-one) via docker and executing a simple python script that implements the Synapse Python client.
283+
### Exporting Synapse Client Traces to SigNoz Cloud for developers
285284

286-
#### Running the jaeger docker container
287-
Start a docker container with the following options:
288-
```
289-
docker run --name jaeger \
290-
-e COLLECTOR_OTLP_ENABLED=true \
291-
-p 16686:16686 \
292-
-p 4318:4318 \
293-
jaegertracing/all-in-one:latest
294-
```
295-
Explanation of ports:
296-
* `4318` HTTP port for OTLP data collection
297-
* `16686` Jaeger UI for visualizing traces
298-
299-
Once the docker container is running you can access the Jaeger UI via: `http://localhost:16686`
285+
#### Prerequisites
286+
1. Create an account and obtain access to Signoz Cloud.
287+
2. Create an ingestion key by following the step [here](https://signoz.io/docs/ingestion/signoz-cloud/keys/).
300288

301289
#### Environment Variable Configuration
302-
303-
By default, the OTEL exporter sends trace data to `http://localhost:4318/v1/traces`. You can customize the behavior through environment variables:
304-
305-
* `OTEL_SERVICE_NAME`: Defines a unique identifier for your application or service in telemetry data (defaults to 'synapseclient'). Set this to a descriptive name that represents your specific implementation, making it easier to filter and analyze traces in your monitoring system.
306-
* `OTEL_EXPORTER_OTLP_ENDPOINT`: Specifies the destination URL for sending telemetry data (defaults to 'http://localhost:4318'). Configure this to direct data to your preferred OpenTelemetry collector or monitoring service.
290+
The following environment variables are required to be set:
291+
- `OTEL_EXPORTER_OTLP_HEADERS`: `signoz-ingestion-key=<key>`
292+
- `OTEL_EXPORTER_OTLP_ENDPOINT`: `https://ingest.us.signoz.cloud`
293+
- `OTEL_SERVICE_NAME`: `your-service-name`
294+
295+
Explanation of both required and optional environment variables:
296+
##### Required
297+
* `OTEL_EXPORTER_OTLP_ENDPOINT`: The OTLP endpoint to which telemetry is exported.
298+
* `OTEL_EXPORTER_OTLP_HEADERS`: Authentication/metadata for exports (e.g., API keys, tokens). For SigNoz, use `signoz-ingestion-key=<key>`.
299+
300+
##### Optional
301+
* `OTEL_SERVICE_NAME`: Unique identifier for your app/service in telemetry data (defaults to synapseclient). Use a descriptive name so you can easily filter and analyze traces per service.
307302
* `OTEL_DEBUG_CONSOLE`: Controls local visibility of telemetry data. Set to 'true' to output trace information to the console, which is useful for development and troubleshooting without an external collector.
308303
* `OTEL_SERVICE_INSTANCE_ID`: Distinguishes between multiple instances of the same service (e.g., 'prod', 'development', 'local'). This helps identify which specific deployment or environment generated particular traces.
309-
* `OTEL_EXPORTER_OTLP_HEADERS`: Configures authentication and metadata for telemetry exports. Use this to add API keys, authentication tokens, or custom metadata when sending traces to secured collectors or third-party monitoring services.
310-
311304

312305
#### Enabling OpenTelemetry in your code
306+
You can copy `.env.example` file to `.env` and fill in the values as needed
307+
313308
To enable OpenTelemetry with the Synapse Python client, simply call the
314309
`enable_open_telemetry()` method on the Synapse class. Additionally you can access an
315310
instance of the OpenTelemetry tracer via the `get_tracer()` call. This will allow you
316311
to create new spans for your code.
317312

318313
```python
319314
import synapseclient
315+
from dotenv import load_dotenv
316+
317+
# load environment variables from .env file
318+
load_dotenv()
320319

321320
# Enable OpenTelemetry with default settings
322321
synapseclient.Synapse.enable_open_telemetry()

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ dev =
9090
black
9191
pre-commit
9292
pandas>=1.5,<3.0
93+
dotenv
9394

9495
tests =
9596
pytest~=8.2.0

0 commit comments

Comments
 (0)