You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/08/12 07:18:14 UTC

[skywalking-python] branch master updated: doc: update agent set up doc (#153)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-python.git


The following commit(s) were added to refs/heads/master by this push:
     new 750e405  doc: update agent set up doc (#153)
750e405 is described below

commit 750e4058d3b8be03e32b6a806c597924df1d74b4
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Thu Aug 12 15:18:12 2021 +0800

    doc: update agent set up doc (#153)
---
 README.md | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/README.md b/README.md
index 0a50452..674146e 100755
--- a/README.md
+++ b/README.md
@@ -44,6 +44,17 @@ SkyWalking Python SDK requires SkyWalking 8.0+ and Python 3.5+.
 
 > 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.
 
+By default, SkyWalking Python agent uses gRPC protocol to report data to SkyWalking backend,
+in SkyWalking backend, the port of gRPC protocol is `11800`, and the port of HTTP protocol is `12800`,
+you should configure `collector_address` (or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`)
+according to the protocol you want.
+
+### Report data via gRPC protocol (Default)
+
+For example, if you want to use gRPC protocol to report data, configure `collector_address`
+(or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`) to `<oap-ip-or-host>:11800`,
+such as `127.0.0.1:11800`:
+
 ```python
 from skywalking import agent, config
 
@@ -51,6 +62,36 @@ config.init(collector_address='127.0.0.1:11800', service_name='your awesome serv
 agent.start()
 ```
 
+### Report data via HTTP protocol
+
+However, if you want to use HTTP protocol to report data, configure `collector_address`
+(or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`) to `<oap-ip-or-host>:12800`,
+such as `127.0.0.1:12800`:
+
+> Remember you should install `skywalking-python` with extra requires `http`, `pip install "apache-skywalking[http]`.
+
+```python
+from skywalking import agent, config
+
+config.init(collector_address='127.0.0.1:12800', service_name='your awesome service')
+agent.start()
+```
+
+### Report data via Kafka protocol
+
+Finally, if you want to use Kafka protocol to report data, configure `kafka_bootstrap_servers`
+(or environment variable `SW_KAFKA_REPORTER_BOOTSTRAP_SERVERS`) to `kafka-brokers`,
+such as `127.0.0.1:9200`:
+
+> Remember you should install `skywalking-python` with extra requires `kafka`, `pip install "apache-skywalking[kafka]`.
+
+```python
+from skywalking import agent, config
+
+config.init(kafka_bootstrap_servers='127.0.0.1:9200', service_name='your awesome service')
+agent.start()
+```
+
 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`.
 
 All supported environment variables can be found [here](docs/EnvVars.md)