• This repository has been archived on 31/Aug/2022
  • Stars
    star
    137
  • Rank 256,982 (Top 6 %)
  • Language
    C++
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ›‘ This library is DEPRECATED!

πŸ›‘ This library is DEPRECATED!

There will be no new releases of this library.

We urge all users to migrate to OpenTelemetry. Please refer to the notice in the documentation for details.


Build Status Coverage Status Appveyor Build OpenTracing 1.0 Enabled

Ubuntu MacOS Windows

jaeger-client-cpp

Jaeger SDK with OpenTracing API for C++ binding.

Contributing

Please see CONTRIBUTING.md.

Building

jaeger-client-cpp is built using CMake. It will automatically download needed dependencies using Hunter.

To build:

    mkdir build
    cd build
    cmake ..
    make

After building, the example program can be run with:

    ./app ../examples/config.yml

To run tests:

    make test

To install the library:

    make install

Generated files

This project uses Apache Thrift for wire-format protocol support code generation. It currently requires Thrift 0.11.0.

The code can be re-generated with

    $ git submodule update --init
    $ find idl/thrift/ -type f -name \*.thrift -exec thrift -gen cpp -out src/jaegertracing/thrift-gen {} \;
    $ git apply scripts/thrift-gen.patch

Updating Agent Host and Port

The default host and port for Jaeger Agent is 127.0.0.1:6831. When the application and Jaeger Agent are running in different containers on the same host, the application's notion of localhost/127.0.0.1 it restriced to its own container, so in this case it's usually necessary to override the Agent's host/port by updating your reporter configuration:

YAML configuration:

reporter:
  localAgentHostPort: jaeger-agent:6831

NOTE: It is not recommended to use a remote host for UDP connections.

Connecting directly to the Collector

In case the client should connect directly to the collector instead of going through an agent, it's necessary update the reporter configuration

reporter:
  endpoint: http://${collectorhost}:${collectorport}/api/traces

Note that if both localAgentHostPort and endpoint are specified, the endpoint will be used.

Updating Sampling Server URL

The default sampling collector URL is http://127.0.0.1:5778/sampling. Similar to UDP address above, you can use a different URL by updating the sampler configuration.

sampler:
  samplingServerURL: http://jaeger-agent.local:5778/sampling

Configuration via Environment

It's possible to populate the tracer configuration from the environement variables by calling jaegertracing::Config::fromEnv.

The following property names are currently available:

Property Description
JAEGER_SERVICE_NAME The service name
JAEGER_DISABLED (not recommended) Instructs the Configuration to return a no-op tracer
JAEGER_AGENT_HOST The hostname for communicating with agent via UDP
JAEGER_AGENT_PORT The port for communicating with agent via UDP
JAEGER_ENDPOINT The traces endpoint, in case the client should connect directly to the Collector, like http://jaeger-collector:14268/api/traces
JAEGER_PROPAGATION The propagation format used by the tracer. Supported values are jaeger and w3c
JAEGER_REPORTER_LOG_SPANS Whether the reporter should also log the spans
JAEGER_REPORTER_MAX_QUEUE_SIZE The reporter's maximum queue size
JAEGER_REPORTER_FLUSH_INTERVAL The reporter's flush interval (ms)
JAEGER_SAMPLER_TYPE The sampler type
JAEGER_SAMPLER_PARAM The sampler parameter (double)
JAEGER_SAMPLING_ENDPOINT The url for the remote sampling conf when using sampler type remote. Default is http://127.0.0.1:5778/sampling
JAEGER_TAGS A comma separated list of name = value tracer level tags, which get added to all reported spans. The value can also refer to an environment variable using the format ${envVarName:default}, where the :default is optional, and identifies a value to be used if the environment variable cannot be found

SelfRef

Jaeger Tracer supports an additional reference type call 'SelfRef'. It returns an opentracing::SpanReference which can be passed to Tracer::StartSpan to influence the SpanContext of the newly created span. Specifically, the new span inherits the traceID and spanID from the passed SELF reference. It can be used to pass externally generated IDs to the tracer, with the purpose of recording spans from data generated elsewhere (e.g. from logs), or by augmenting the data of the existing span (Jaeger backend will merge multiple instances of the spans with the same IDs). Must be the lone reference, can be used only for root spans.

Usage example:

  jaegertracing::SpanContext customCtx { {1, 2}, 3, 0, 0, jaegertracing::SpanContext::StrMap() }; // TraceId and SpanID must be != 0
  auto span = tracer->StartSpan("spanName", { jaegertracing::SelfRef(&customCtx) });

License

Apache 2.0 License.

More Repositories

1

jaeger

CNCF Jaeger, a Distributed Tracing Platform
Go
19,236
star
2

jaeger-client-go

πŸ›‘ This library is DEPRECATED!
Go
1,366
star
3

jaeger-ui

Web UI for Jaeger
JavaScript
1,039
star
4

jaeger-operator

Jaeger Operator for Kubernetes simplifies deploying and running Jaeger on Kubernetes.
Go
980
star
5

jaeger-client-node

πŸ›‘ This library is DEPRECATED!
JavaScript
553
star
6

jaeger-client-java

πŸ›‘ This library is DEPRECATED!
Java
491
star
7

jaeger-kubernetes

Support for deploying Jaeger into Kubernetes
Java
446
star
8

jaeger-client-python

πŸ›‘ This library is DEPRECATED!
Python
408
star
9

jaeger-client-csharp

πŸ›‘ This library is DEPRECATED!
C#
304
star
10

helm-charts

Helm Charts for Jaeger backend
Mustache
248
star
11

jaeger-clickhouse

Jaeger ClickHouse storage plugin implementation
Go
227
star
12

spark-dependencies

Spark job for dependency links
Java
119
star
13

docker-protobuf

An all-inclusive protoc Docker image for the Jaeger project
Dockerfile
85
star
14

jaeger-idl

A set of shared data model definitions used by Jaeger components.
Thrift
77
star
15

jaeger-analytics-flink

Big data analytics for Jaeger using Apache Flink
Java
67
star
16

jaeger-lib

A collection of shared infrastructure libraries used by different components of Jaeger.
Go
64
star
17

documentation

Documentation/website for the Jaeger Distributed Tracing project.
HTML
62
star
18

jaeger-openshift

Support for deploying Jaeger into OpenShift
Groovy
56
star
19

jaeger-analytics-java

Data analytics pipeline and models for tracing data
Java
43
star
20

jaeger-client-javascript

Note: this SDK is not implemented yet, see https://github.com/jaegertracing/jaeger-client-javascript/issues/1.
JavaScript
32
star
21

jaeger-performance

Home of the Jaeger Performance tests
Java
21
star
22

jaeger-opentelemetry-collector

Experimental: components needed to build Jaeger on top of OpenTelemetry Collector
Makefile
12
star
23

jaeger-otelcol

Jaeger's OpenTelemetry Collector distribution
Go
7
star
24

legacy-client-java

Legacy com.uber.jaeger java client
Java
5
star
25

jaeger-vscode

VSCode extension for Jaeger
TypeScript
5
star
26

security-audits

Jaeger security audits
3
star
27

vertx-create-span

Demo application used in e2e tests for the Jaeger Operator
Java
3
star
28

jaeger-opentelemetry-releases

Go
3
star
29

artwork

Jaeger Logo and Artwork
2
star