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

Feat/otel #160

Merged
merged 9 commits into from
Aug 7, 2024
Merged

Feat/otel #160

merged 9 commits into from
Aug 7, 2024

Conversation

niklastreml
Copy link
Collaborator

@niklastreml niklastreml commented Aug 5, 2024

Motivation

Partially addresses #111

This is mostly a port of @lvlcn-t's open telemetry implementation to the latest commit to prepare for implementing the metrics in primarily the traceroute check, which is tracked in #111.

From @lvlcn-t in #111 for reference:

I've started to implement the first step of completing this issue in feat/otel-provider. I've added a otel provider setup depending on the user's (startup) configuration.
To be able to keep the provider selection dynamic, I'm using the OpenTelemetry Protocol (OTLP) to communicate with the collector. This way, the user can choose the provider and the collector to use.

The following configuration options will be available for the user (naming is not final):

# Configures the telemetry exporter.
telemetry:
  # The telemetry exporter to use.
  # Options:
  # grpc: Exports telemetry using OTLP via gRPC.
  # http: Exports telemetry using OTLP via HTTP.
  # stdout: Prints telemetry to stdout.
  # noop | "": Disables telemetry.
  exporter: grpc
  # The address to export telemetry to.
  url: localhost:4317
  # The token to use for authentication.
  # If the exporter does not require a token, this can be left empty.
  token: ""
  # The path to the tls certificate to use.
  # To disable tls, either set this to an empty string or set it to insecure.
  certPath: ""

Since the OpenTelemetry Protocol (OTLP) is a standard, the user can choose any collector that supports this protocol. The user can also choose to use the stdout exporter to see the traces in the console (for debugging purposes) or the noop exporter to disable the telemetry. If the user chooses an external collector, the user can also provide a bearer token for authentication. The user can also provide a path to a tls certificate to use for secure communication.

Next I'm wondering if I should already open the PR even though the actual traces are not yet implemented. This way we can split the issue into smaller parts and everyone can instrument one part of the codebase. What do you think?

Changes

For additional information look at the commits.

Tests done

Created a couple traces for testing with a local jaeger instance:
image

To run your very own jaeger instance for local testing you can use this command:

docker run --rm --name jaeger \
  -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 -e COLLECTOR_OTLP_GRPC_HOST_PORT=0.0.0.0:4317 -e COLLECTOR_OTLP_HTTP_HOST_PORT=0.0.0.0:4318 \
  -p 6831:6831/udp \
  -p 6832:6832/udp \
  -p 5778:5778 \
  -p 16686:16686 \
  -p 4317:4317 \
  -p 4318:4318 \
  -p 14250:14250 \
  -p 14268:14268 \
  -p 14269:14269 \
  -p 9411:9411 \
  jaegertracing/all-in-one:1.59
  • Unit tests succeeded
  • E2E tests succeeded

TODO

  • I've assigned this PR to myself
  • I've labeled this PR correctly

@niklastreml niklastreml added feature Introduces a new feature area/metrics Issues/PRs related to metrics labels Aug 5, 2024
@niklastreml niklastreml self-assigned this Aug 5, 2024
@lvlcn-t lvlcn-t self-assigned this Aug 6, 2024
@niklastreml niklastreml merged commit f4107bb into main Aug 7, 2024
13 checks passed
@niklastreml niklastreml deleted the feat/otel branch August 7, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics Issues/PRs related to metrics feature Introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants