Skip to content

Commit ac5b10f

Browse files
fix readme
1 parent 2260f22 commit ac5b10f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,22 @@ pip install superclient
8787

8888
### Step 2: Run
8989

90-
The package ships with a `sitecustomize.py` entry-point, therefore Python imports the agent automatically before your application's code starts. If `sitecustomize` is disabled in your environment, you can initialize manually:
90+
The package ships with a `sitecustomize.py` entry-point, therefore Python imports the agent automatically before your application's code starts. This is the recommended and default way to use Superclient.
91+
92+
#### Manual Initialization (Only if needed)
93+
94+
If `sitecustomize` is disabled in your environment (e.g., when using `python -S` or when `PYTHONNOUSERSITE` is set), you can initialize manually by adding this import at the very beginning of your application's main entry point (e.g., `main.py`, `app.py`, or `__init__.py`):
9195

9296
```python
9397
import superclient # side-effects automatically enable the agent
98+
99+
# Your application code follows
100+
from kafka import KafkaProducer
101+
# ... rest of your imports and code
94102
```
95103

104+
Note: The manual import must be placed before any Kafka-related imports to ensure proper interception of producer creation.
105+
96106
### Docker Integration
97107

98108
When using Superstream Clients with containerized applications, include the package in your Dockerfile:

0 commit comments

Comments
 (0)