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