Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lightstep/lightstep-census-java

Java exporter for OpenCensus
https://github.com/lightstep/lightstep-census-java

opencensus

Last synced: 8 days ago
JSON representation

Java exporter for OpenCensus

Awesome Lists containing this project

README

        

[![Circle CI](https://circleci.com/gh/lightstep/lightstep-census-java.svg?style=shield)](https://circleci.com/gh/lightstep/lightstep-census-java) [![Released Version][maven-img]][maven] [![Apache-2.0 license](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](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