blob: 8c4defb1e36d239dc17dfdfb3a10c40ff46b0eb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# OpenCensus SignalFx Stats Exporter
The _OpenCensus SignalFx Stats Exporter_ is a stats exporter that
exports data to [SignalFx](https://signalfx.com), a real-time monitoring
solution for cloud and distributed applications. SignalFx ingests that
data and offers various visualizations on charts, dashboards and service
maps, as well as real-time anomaly detection.
## Quickstart
### Prerequisites
To use this exporter, you must have a [SignalFx](https://signalfx.com)
account and corresponding [data ingest
token](https://docs.signalfx.com/en/latest/admin-guide/tokens.html).
#### Java versions
This exporter requires Java 7 or above.
### Add the dependencies to your project
For Maven add to your `pom.xml`:
```xml
<dependencies>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-api</artifactId>
<version>0.10.1</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-exporter-stats-signalfx</artifactId>
<version>0.10.1</version>
</dependency>
<dependency>
<groupId>io.opencensus</groupId>
<artifactId>opencensus-impl</artifactId>
<version>0.10.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
```
For Gradle add to your dependencies:
```
compile 'io.opencensus:opencensus-api:0.10.1'
compile 'io.opencensus:opencensus-exporter-stats-signalfx:0.10.1'
runtime 'io.opencensus:opencensus-impl:0.10.1'
```
### Register the exporter
```java
public class MyMainClass {
public static void main(String[] args) {
// SignalFx token is read from Java system properties.
// Stats will be reported every second by default.
SignalFxStatsExporter.create();
}
}
```
If you want to pass in the token yourself, or set a different reporting
interval, use:
```java
// Use token "your_signalfx_token" and report every 5 seconds.
SignalFxStatsExporter.create(
SignalFxStatsExporter.DEFAULT_SIGNALFX_ENDPOINT,
"your_signalfx_token",
Duration.create(5, 0));
```
|