Skip to content

Commit 750e405

Browse files
authored
doc: update agent set up doc (#153)
1 parent 8039d8b commit 750e405

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,54 @@ SkyWalking Python SDK requires SkyWalking 8.0+ and Python 3.5+.
4444

4545
> If you want to try out the latest features that are not released yet, please refer to [the guide](docs/FAQ.md#q-how-to-build-from-sources) to build from sources.
4646
47+
By default, SkyWalking Python agent uses gRPC protocol to report data to SkyWalking backend,
48+
in SkyWalking backend, the port of gRPC protocol is `11800`, and the port of HTTP protocol is `12800`,
49+
you should configure `collector_address` (or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`)
50+
according to the protocol you want.
51+
52+
### Report data via gRPC protocol (Default)
53+
54+
For example, if you want to use gRPC protocol to report data, configure `collector_address`
55+
(or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`) to `<oap-ip-or-host>:11800`,
56+
such as `127.0.0.1:11800`:
57+
4758
```python
4859
from skywalking import agent, config
4960

5061
config.init(collector_address='127.0.0.1:11800', service_name='your awesome service')
5162
agent.start()
5263
```
5364

65+
### Report data via HTTP protocol
66+
67+
However, if you want to use HTTP protocol to report data, configure `collector_address`
68+
(or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`) to `<oap-ip-or-host>:12800`,
69+
such as `127.0.0.1:12800`:
70+
71+
> Remember you should install `skywalking-python` with extra requires `http`, `pip install "apache-skywalking[http]`.
72+
73+
```python
74+
from skywalking import agent, config
75+
76+
config.init(collector_address='127.0.0.1:12800', service_name='your awesome service')
77+
agent.start()
78+
```
79+
80+
### Report data via Kafka protocol
81+
82+
Finally, if you want to use Kafka protocol to report data, configure `kafka_bootstrap_servers`
83+
(or environment variable `SW_KAFKA_REPORTER_BOOTSTRAP_SERVERS`) to `kafka-brokers`,
84+
such as `127.0.0.1:9200`:
85+
86+
> Remember you should install `skywalking-python` with extra requires `kafka`, `pip install "apache-skywalking[kafka]`.
87+
88+
```python
89+
from skywalking import agent, config
90+
91+
config.init(kafka_bootstrap_servers='127.0.0.1:9200', service_name='your awesome service')
92+
agent.start()
93+
```
94+
5495
Alternatively, you can also pass the configurations via environment variables (such as `SW_AGENT_NAME`, `SW_AGENT_COLLECTOR_BACKEND_SERVICES`, etc.) so that you don't need to call `config.init`.
5596

5697
All supported environment variables can be found [here](docs/EnvVars.md)

0 commit comments

Comments
 (0)