# Tracing

`Janus` uses [OpenCensus](https://opencensus.io) as the standard way to trace requests. It can be used for monitoring microservices-based distributed systems:

* Distributed context propagation
* Distributed transaction monitoring
* Root cause analysis
* Service dependency analysis
* Performance / latency optimization

OpenCensus supports several tracing backend systems (i.e. [exporters](https://opencensus.io/exporters/supported-exporters/go/)) which are:

* Azure Monitor
* Honeycomb.io
* AWS X-Ray
* Datadog
* Jaeger
* Stackdriver
* Zipkin

Currently, only Jaeger exporter is available in `Janus`.

```
# Tracing Configuration

[tracing]
  # Backend system to export traces to
  #
  # Default: None
  #
  Exporter = "jaeger"

  # Service name used in the backend
  #
  # Default: "janus"
  #
  ServiceName = "janus"

  # If set to false, trace metadata set in incoming requests will be
  # added as the parent span of the trace.
  #
  # See the following link for more details:
  # https://godoc.org/go.opencensus.io/plugin/ochttp#Handler 
  #
  # Default: true
  #
  IsPublicEndpoint = true

  # SamplingStrategy specifies the sampling strategy
  #
  # Valid Values: "probabilistic", "always", "never"
  #
  # Default: "probabilistic"
  #
  SamplingStrategy = "probabilistic"

  # SamplingParam is an additional value passed to the sampler.
  #
  # Valid Values:
  #   - for "always" and "never" sampler, this value is unused
  #   - for "probabilistic" sampler, a probability between 0 and 1
  #
  # Default: "0.15"
  #
  SamplingParam = "0.15"

  [tracing.jaeger]
    # SamplingServerURL is the address to the sampling server
    #
    # Default: None
    #
    SamplingServerURL: "localhost:6832"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://motivlabs.gitbook.io/janus/misc/tracing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
