Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opentelemetry support #628

Closed

Conversation

glazychev-art
Copy link
Contributor

@glazychev-art glazychev-art commented Dec 22, 2020

Description

This PR adds opentelemetry support.
At the moment, you can use either opentracing(jaeger) or opentelemetry functional. The latter also provides the ability to work with metrics.

How does it work?

The choice of using one of the functional is made through the environment variable.

Opentracing is used by default (selected as more stable).

Opentelemetry initialization is available through opentelemetry package. It creates tracer and meter providers.
Next, spanlogger uses corresponding spans for tracing, and metrics chain element works with metrics from pathSegment.
Traces and metrics are sent to otel-collector. You can add agents if necessary.

                                                      -----> Jaeger (trace)
App + (SDK + otel-SDK) ---> OpenTelemtry Collector ---|
                                                      -----> Prometheus (metrics)

So you also need to run otel-collector container to receive traces and metrics.

How to enable opentelemetry?

  1. Enable traces.
  2. Set env TELEMETRY = opentelemetry.
  3. Call opentelemetry.Init(...).

Signed-off-by: Artem Glazychev artem.glazychev@xored.com
#584

pkg/networkservice/common/heal/client.go Outdated Show resolved Hide resolved
pkg/networkservice/common/metric/client.go Outdated Show resolved Hide resolved
pkg/networkservice/common/metric/client.go Outdated Show resolved Hide resolved
pkg/tools/metricshelper/metrics_helper.go Outdated Show resolved Hide resolved
pkg/tools/metricshelper/metrics_helper.go Outdated Show resolved Hide resolved
pkg/tools/opentelemetry/opentelemetry.go Outdated Show resolved Hide resolved
pkg/tools/spanhelper/span_helper.go Outdated Show resolved Hide resolved
pkg/tools/spanhelper/span_helper.go Outdated Show resolved Hide resolved
@glazychev-art glazychev-art force-pushed the opentelemetry branch 3 times, most recently from 0620938 to 1c00716 Compare December 25, 2020 09:32
@glazychev-art glazychev-art force-pushed the opentelemetry branch 2 times, most recently from 1c031ce to 471d1e3 Compare December 25, 2020 10:27
@denis-tingaikin denis-tingaikin added the blocked Something is blocking this label Dec 25, 2020
@glazychev-art glazychev-art force-pushed the opentelemetry branch 6 times, most recently from 4dd435a to 537acce Compare February 26, 2021 08:15
@glazychev-art glazychev-art marked this pull request as ready for review March 1, 2021 09:52
@edwarnicke
Copy link
Member

@glazychev-art Is this still blocked? If not, should we remove the blocked tag?

@glazychev-art
Copy link
Contributor Author

@edwarnicke This is still blocked by #744

@glazychev-art glazychev-art force-pushed the opentelemetry branch 3 times, most recently from 004e9a0 to b09998d Compare June 18, 2021 11:28
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
Signed-off-by: Artem Glazychev <artem.glazychev@xored.com>
@glazychev-art glazychev-art removed the blocked Something is blocking this label Aug 13, 2021
@glazychev-art glazychev-art marked this pull request as draft August 13, 2021 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants