You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Of course, you can use docker in production or install etcd using your favorite package manager.
26
+
Of course, you can use Docker in production or install etcd using your favorite package manager.
27
27
Just remember that the example above is for testing purposes!
28
28
29
29
## How does it work?
30
30
31
-
All you need to do is give your server a name. When it starts, it will automatically select a free port and run on it (unless you specify otherwise).
32
-
All clients will connect to this server by its name. If there are multiple servers with the same name, load balancing will be performed between them.
31
+
All you need to do is assign a name to your server. When it starts, it will automatically select a free port and listen on it (unless you specify otherwise).
32
+
All clients will connect to this server by its name. If there are multiple servers with the same name, load balancing is distributed among them.
33
33
34
-
> In the following code examples, error handling will be removed to improve readability. A pre-built [proto](examples/quickstart/proto) will also be used.
34
+
> In the following code examples, error handling is omitted to improve readability. A pre-built [proto](examples/quickstart/proto) will also be used.
Now let's create a new server named `myServerName`, give it the implementation of our `Sum` service and run it on the localhost (`sumServer` implementation will be omitted):
46
+
Now let's create a new server named `myServerName`, register the implementation of our `Sum` service and run it on localhost (`sumServer` implementation is omitted):
And finally, we create a client that connects to our `myServerName` (`sumClient` usage will be omitted):
54
+
And finally, we create a client that connects to our `myServerName` (`sumClient` usage is omitted):
55
55
56
56
```go
57
57
client, err:= rpcp.NewClient("myServerName")
58
58
sumClient:= proto.NewSumClient(client.Client())
59
-
````
59
+
```
60
60
61
-
This is already enough for everything to work, we can add or remove copies of our server and add new clients — everything will work!
61
+
This setup is fully functional: you can add or remove copies of your server and create new clients dynamically.
62
62
But to see our **service graph** and get **telemetry for all gRPC methods**, we need to run containers with telemetry services and enable telemetry in `rpcplatform`.
Copy file name to clipboardExpand all lines: examples/attributes/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## Adding attributes
2
2
3
-
This example is very similar to [QuickStart](../quickstart), but now we will use additional attributes for the server and will receive them on every update in the channel.
3
+
This example is similar to the [QuickStart](../quickstart) example, but it uses additional server attributes that are sent with every channel update.
4
4
5
5
## Launching this demo
6
6
@@ -19,6 +19,6 @@ cd examples/opentelemetry/client
19
19
go run .
20
20
```
21
21
22
-
## Additional comments
22
+
## Additional notes
23
23
24
-
Currently there are two servers and one client running. If you launch another server, then one of the three servers will become a backup server, and the client will continue to interact with only two servers. If we want active servers to be selected using priority, we can use the `BalancerPriority`option for server attributes. Each server receives requests based on its weight, so by changing the value of `BalancerWeight` attribute we will distribute load the way we need.
24
+
Currently, two servers and one client are running. If another server is launched, one becomes a backup server, and the client continues interacting with only two servers. To select active servers by priority, use the `BalancerPriority` server attribute. Each server receives requests based on its weight, so changing the `BalancerWeight` attribute value distributes load as needed.
0 commit comments