https://github.com/lightstep/lightstep-census-java
Java exporter for OpenCensus
https://github.com/lightstep/lightstep-census-java
opencensus
Last synced: 20 days ago
JSON representation
Java exporter for OpenCensus
- Host: GitHub
- URL: https://github.com/lightstep/lightstep-census-java
- Owner: lightstep
- License: apache-2.0
- Created: 2018-10-15T14:33:27.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-14T03:42:25.000Z (about 5 years ago)
- Last Synced: 2024-12-29T06:46:30.316Z (about 1 year ago)
- Topics: opencensus
- Language: Java
- Homepage: https://lightstep.com
- Size: 37.1 KB
- Stars: 0
- Watchers: 71
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/lightstep/lightstep-census-java) [![Released Version][maven-img]][maven] [](https://opensource.org/licenses/Apache-2.0)
# LightStep OpenCensus Trace Exporter
The LightStep OpenCensus Trace Exporter is a trace exporter that exports data to LightStep.
## Installation
pom.xml
```xml
com.lightstep.opencensus
lightstep-opencensus-exporter
VERSION
io.opencensus
opencensus-impl
0.19.0
runtime
```
Also add dependencies required for LightStep tracer
## Usage
### Initialization
```java
// Instantiate LightStep tracer
JRETracer jreTracer = ...
// Register the exporter
LightStepTraceExporter.createAndRegister(jreTracer);
// Optionally configure 100% sample rate, otherwise, few traces will be sampled
TraceConfig traceConfig = Tracing.getTraceConfig();
traceConfig.updateActiveTraceParams(
traceConfig.getActiveTraceParams()
.toBuilder()
.setSampler(Samplers.probabilitySampler(1))
.build());
```
### Shutdown
```java
// To shutdown the exporter
Tracing.getExportComponent().shutdown();
// Close the tracer, so that it'll flush queued traces
jreTracer.close();
```
### Example
There is an [example](./example) which demonstrate basic usage of the exporter.
## License
[Apache 2.0 License](./LICENSE).
[maven-img]: https://img.shields.io/maven-central/v/com.lightstep.opencensus/lightstep-opencensus-exporter.svg
[maven]: http://search.maven.org/#search%7Cga%7C1%7Clightstep-opencensus-exporter