Skip to content

Commit 6aa24fb

Browse files
Fix configuration names (#282)
* Refactor configs * fix httpx --------- Co-authored-by: kezhenxu94 <[email protected]>
1 parent f9f3dcd commit 6aa24fb

File tree

81 files changed

+564
-381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+564
-381
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
- **Important Note and Breaking Changes:**
66
- Python 3.6 is no longer supported and may not function properly.
7-
- A number of configuration options (mostly environment variables) are renamed to follow the convention of
8-
'SW_AGENT' prefixes, please check with the latest official documentation before upgrading. (#273)
7+
- A number of common configuration options (environment variables) are renamed to follow the convention of Java agent,
8+
please check with the latest official documentation before upgrading. (#273, #282)
99

1010
https://skywalking.apache.org/docs/skywalking-python/v1.0.0/en/setup/configuration/
1111
- All agent core capabilities are now covered by test cases and enabled by default (Trace, Log, PVM runtime metrics, Profiler)

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ install: gen-basic
6767
# flake8 configurations should go to the file setup.cfg
6868
lint: clean
6969
poetry run flake8 .
70+
poetry run pylint --disable=all --enable=E0602,E0603,E1101 skywalking tests
7071

7172
.PHONY: fix
7273
# fix problems described in CodingStyle.md - verify outcome with extra care

docs/en/setup/Configuration.md

Lines changed: 48 additions & 48 deletions
Large diffs are not rendered by default.

docs/en/setup/Intrusive.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,56 @@ which is by importing SkyWalking into your project and starting the agent.
77
By default, SkyWalking Python agent uses gRPC protocol to report data to SkyWalking backend,
88
in SkyWalking backend, the port of gRPC protocol is `11800`, and the port of HTTP protocol is `12800`,
99

10-
You could configure `collector_address` (or environment variable `SW_AGENT_COLLECTOR_ADDRESS`)
10+
You could configure `collector_address` (or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`)
1111
and set `protocol` (or environment variable `SW_AGENT_PROTOCOL` to one of
1212
`gprc`, `http` or `kafka` according to the protocol you would like to use.
1313

1414
### Report data via gRPC protocol (Default)
1515

1616
For example, if you want to use gRPC protocol to report data, configure `collector_address`
17-
(or environment variable `SW_AGENT_COLLECTOR_ADDRESS`) to `<oap-ip-or-host>:11800`,
17+
(or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`) to `<oap-ip-or-host>:11800`,
1818
such as `127.0.0.1:11800`:
1919

2020
```python
2121
from skywalking import agent, config
2222

23-
config.init(collector_address='127.0.0.1:11800', service_name='your awesome service')
23+
config.init(collector_address='127.0.0.1:11800', agent_name='your awesome service')
2424

2525
agent.start()
2626
```
2727

2828
### Report data via HTTP protocol
2929

3030
However, if you want to use HTTP protocol to report data, configure `collector_address`
31-
(or environment variable `SW_AGENT_COLLECTOR_ADDRESS`) to `<oap-ip-or-host>:12800`,
31+
(or environment variable `SW_AGENT_COLLECTOR_BACKEND_SERVICES`) to `<oap-ip-or-host>:12800`,
3232
such as `127.0.0.1:12800`, further set `protocol` (or environment variable `SW_AGENT_PROTOCOL` to `http`):
3333

3434
> Remember you should install `skywalking-python` with extra requires `http`, `pip install "apache-skywalking[http]`.
3535
3636
```python
3737
from skywalking import agent, config
3838

39-
config.init(collector_address='127.0.0.1:12800', service_name='your awesome service', protocol='http')
39+
config.init(collector_address='127.0.0.1:12800', agent_name='your awesome service', protocol='http')
4040

4141
agent.start()
4242
```
4343

4444
### Report data via Kafka protocol
4545

4646
Finally, if you want to use Kafka protocol to report data, configure `kafka_bootstrap_servers`
47-
(or environment variable `SW_AGENT_KAFKA_BOOTSTRAP_SERVERS`) to `kafka-brokers`,
47+
(or environment variable `SW_KAFKA_BOOTSTRAP_SERVERS`) to `kafka-brokers`,
4848
such as `127.0.0.1:9200`, further set `protocol` (or environment variable `SW_AGENT_PROTOCOL` to `kafka`):
4949

5050
> Remember you should install `skywalking-python` with extra requires `kafka`, `pip install "apache-skywalking[kafka]"`.
5151
5252
```python
5353
from skywalking import agent, config
5454

55-
config.init(kafka_bootstrap_servers='127.0.0.1:9200', service_name='your awesome service', protocol='kafka')
55+
config.init(kafka_bootstrap_servers='127.0.0.1:9200', agent_name='your awesome service', protocol='kafka')
5656

5757
agent.start()
5858
```
5959

60-
Alternatively, you can also pass the configurations via environment variables (such as `SW_AGENT_SERVICE_NAME`, `SW_AGENT_COLLECTOR_ADDRESS`, etc.) so that you don't need to call `config.init`.
60+
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`.
6161

6262
All supported environment variables can be found in the [Environment Variables List](Configuration.md).

docs/en/setup/advanced/LogReporter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To utilize this feature, you will need to add some new configurations to the age
88
```Python
99
from skywalking import agent, config
1010

11-
config.init(collector_address='127.0.0.1:11800', service_name='your awesome service',
11+
config.init(collector_address='127.0.0.1:11800', agent_name='your awesome service',
1212
log_reporter_active=True) # defaults to grpc protocol
1313
agent.start()
1414
```

docs/en/setup/faq/How-to-disable-plugin.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ and disable one or more plugins by following methods.**
66
```python
77
from skywalking import config
88

9-
config.disable_plugins = ['sw_http_server', 'sw_urllib_request'] # can be also CSV format, i.e. 'sw_http_server,sw_urllib_request'
9+
config.agent_disable_plugins = ['sw_http_server',
10+
'sw_urllib_request'] # can be also CSV format, i.e. 'sw_http_server,sw_urllib_request'
1011
```
1112

1213
You can also disable the plugins via environment variables `SW_AGENT_DISABLE_PLUGINS`,

docs/en/setup/faq/How-to-use-with-uwsgi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ from skywalking import agent, config
1717

1818
@postfork
1919
def init_tracing():
20-
config.init(collector_address='127.0.0.1:11800', service_name='your awesome service')
20+
config.init(collector_address='127.0.0.1:11800', agent_name='your awesome service')
2121

2222
agent.start()
2323

0 commit comments

Comments
 (0)