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 2020/12/30 16:00:30 UTC

[skywalking-nodejs] branch master updated: Polish the readme to clarify the init options (#17)

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-nodejs.git


The following commit(s) were added to refs/heads/master by this push:
     new c491d5c  Polish the readme to clarify the init options (#17)
c491d5c is described below

commit c491d5cbdbea965a4ed640a93d9c232fafb99056
Author: Zhenxu Ke <ke...@apache.org>
AuthorDate: Thu Dec 31 00:00:22 2020 +0800

    Polish the readme to clarify the init options (#17)
---
 README.md | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 541215a..bcb42e3 100644
--- a/README.md
+++ b/README.md
@@ -20,15 +20,25 @@ SkyWalking NodeJS SDK requires SkyWalking backend (OAP) 8.0+ and NodeJS >= 10.
 ```typescript
 import agent from 'skywalking';
 
+agent.start();
+```
+
+This will use default configurations to start the SkyWalking agent above, if you want to specify your own configurations, here are two methods.
+
+- Pass those values to `agent.start` method, such as:
+
+```typescript
 agent.start({
-  serviceName: '',
-  serviceInstance: '',
-  collectorAddress: '',
-  authorization: '',
-  maxBufferSize: 1000,
+  serviceName: 'my-service-name',
+  serviceInstance: 'my-service-instance-name',
+  collectorAddress: 'my.collector.address:port',
 });
 ```
 
+note that all options given (including empty/null values) will override the corresponding default values, e.g. `agent.start({ collectorAddress: '' })` will override the default value of `collectorAddress` to empty string, causing errors like `DNS resolution failed`.
+
+- Use environment variables.
+
 The supported environment variables are as follows:
 
 Environment Variable | Description | Default