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
Copy file name to clipboardExpand all lines: README.md
+51-3Lines changed: 51 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,8 +139,10 @@ You can send metrics, histograms, or trace data from your application to the Wav
139
139
* Use a [**Wavefront proxy**](https://docs.wavefront.com/proxies.html), which then forwards the data to the Wavefront service. This is the recommended choice for a large-scale deployment that needs resilience to internet outages, control over data queuing and filtering, and more.
140
140
141
141
You instantiate an object that corresponds to your choice:
142
-
* Option 1: [Create a `WavefrontDirectClient`](#option-1-create-a-wavefrontdirectclient) to send data directly to a Wavefront service.
143
-
* Option 2: [Create a `WavefrontProxyClient`](#option-2-create-a-wavefrontproxyclient) to send data to a Wavefront proxy.
142
+
* Option 1 **(Deprecated)**: [Create a `WavefrontDirectClient`](#option-1-create-a-wavefrontdirectclient) to send data directly to a Wavefront service.
143
+
* Option 2 **(Deprecated)**: [Create a `WavefrontProxyClient`](#option-2-create-a-wavefrontproxyclient) to send data to a Wavefront proxy.
144
+
* Option 3: [Create a `WavefrontClient`](#option-3-create-a-wavefrontclient) to send data to a Wavefront service directly or via proxy.
145
+
> **Deprecated implementations**: *`WavefrontDirectClient` and `WavefrontProxyClient` are deprecated from proxy version 7.0 onwards. We recommend all new applications to use the `WavefrontClient`.*
144
146
145
147
### Option 1: Create a WavefrontDirectClient
146
148
When sending data via direct ingestion, you need to create a `WavefrontDirectClient`, and build it with the Wavefront URL and API token to send data directly to Wavefront.
When sending data via the Wavefront proxy, you need to create a `WavefrontProxyClient`. Include the following information.
189
191
190
192
* The name of the host that will run the Wavefront proxy.
191
-
* One or more proxy listening ports to send data to. The ports you specify depend on the kinds of data you want to send (metrics, histograms, and/or trace data). You must specify at least one listener port.
193
+
* One or more proxy listening ports to send data to. The ports you specify depend on the kinds of data you want to send (metrics, histograms, and/or trace data). You must specify at least one listener port.
192
194
* Optional settings for tuning communication with the proxy.
193
195
194
196
> **Note**: See [Advanced Proxy Configuration and Installation](https://docs.wavefront.com/proxies_configuring.html) for details.
Use `WavefrontClientFactory` to create a `WavefrontClient` instance, which can send data directly to a Wavefront service or send data using a Wavefront Proxy.
226
+
227
+
The `WavefrontClientFactory` supports multiple client bindings. If more than one client configuration is specified, you can create a `WavefrontMultiClient` instance, which can send data to multiple Wavefront services.
228
+
### Prerequisites
229
+
* Sending data via Wavefront proxy?
230
+
<br/>Before your application can use a `WavefrontClient` you must [set up and start a Wavefront proxy](https://docs.wavefront.com/proxies_installing.html).
231
+
* Sending data via direct ingestion?
232
+
* Verify that you have the Direct Data Ingestion permission. For details, see [Examine Groups, Roles, and Permissions](https://docs.wavefront.com/users_account_managing.html#examine-groups-roles-and-permissions).
233
+
* The HTTP URL of your Wavefront instance. This is the URL you connect to when you log in to Wavefront, typically something like `http://<domain>.wavefront.com`.<br/> You can also use HTTP client with Wavefront Proxy version 7.0 or newer. Example: `http://proxy.acme.corp:2878`.
234
+
*[Obtain the API token](http://docs.wavefront.com/wavefront_api.html#generating-an-api-token).
235
+
236
+
### Initialize the WavefrontClient
237
+
```python
238
+
from wavefront_sdk.client_factory import WavefrontClientFactory
239
+
240
+
# Create a sender with:
241
+
# Required Parameter
242
+
# URL format to send data via proxy: "proxy://<your.proxy.load.balancer.com>:<somePort>"
243
+
# URL format to send data via direct ingestion: "https://TOKEN@DOMAIN.wavefront.com"
244
+
# Optional Parameter
245
+
# max queue size (in data points). Default: 50000
246
+
# batch size (in data points). Default: 10000
247
+
# flush interval (in seconds). Default: 1 second
248
+
249
+
client_factory = WavefrontClientFactory()
250
+
client_factory.add_client(
251
+
url="<URL for proxy or direct ingestions>",
252
+
max_queue_size=50000,
253
+
batch_size=10000,
254
+
flush_interval_seconds=5)
255
+
wavefront_sender = client_factory.get_client()
256
+
```
257
+
#### Add multiple clients to client factory to send data to multiple Wavefront services.
258
+
```
259
+
from wavefront_sdk.client_factory import WavefrontClientFactory
# Send traces and spans to the tracing port. If you are directly using the sender SDK to send spans without using any other SDK, use the same port as the customTracingListenerPorts configured in the wavefront proxy. Assume you have installed and started the proxy on <proxy_hostname>.
0 commit comments