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: replace opentracing with opentelemetry #1053

Merged
merged 6 commits into from
Oct 4, 2022
Merged

feat: replace opentracing with opentelemetry #1053

merged 6 commits into from
Oct 4, 2022

Conversation

GeorgeMac
Copy link
Member

@GeorgeMac GeorgeMac commented Oct 4, 2022

Closes #576

This is an attempt to replace the open-tracing libraries with the open-telemetry alternatives.

The PR does not attempt to change any of the current Flipt configuration for tracing.
Instead, it demonstrates how we can move to the otel abstractions for tracing, without touching existing configuration.

I propose we explore furthering the configurations options in a subsequent PR.
(e.g. support for more exporters and so on).

The most significant change is the slight deviation in the span and trace contents for SQL.
Though, there are some subtle differences in the gRPC ones as well.
See the following images for an illustration:

OpenTracing:
Screenshot 2022-10-04 at 15 27 25

OpenTelemetry:
Screenshot 2022-10-04 at 15 26 05

  • No leading slash on the operation names.
  • No longer producing args as tags.
    I would argue this is preferable. There is no need to index all these traces by the arguments presented to each query.
    Might be favourable down the line to introduce SQL arguments as span log statements.
  • Uses . over - as delimiter when producing span names.
  • query tag becomes db.statement.

To get SQL support, I have added the https://github.com/XSAM/otelsql library.
As this was advised in an otel related issue as the best supported implementation for now.

Take it or leave it: I added a Multistage build alternative Dockerfile.
This was just useful for debugging with docker compose.
Since I could get an equivalent alpine image built with it a little easier.

@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2022

Codecov Report

Merging #1053 (6675cd6) into main (f4a1f50) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1053      +/-   ##
==========================================
+ Coverage   81.33%   81.40%   +0.06%     
==========================================
  Files          17       17              
  Lines        1822     1828       +6     
==========================================
+ Hits         1482     1488       +6     
  Misses        265      265              
  Partials       75       75              
Impacted Files Coverage Δ
storage/sql/db.go 94.64% <100.00%> (+0.30%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

build/Dockerfile.multi Outdated Show resolved Hide resolved
@markphelps
Copy link
Collaborator

🎉 amazing! ty checking this out now!

Copy link
Collaborator

@markphelps markphelps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks again @GeorgeMac !!!

@GeorgeMac GeorgeMac merged commit a319863 into main Oct 4, 2022
@GeorgeMac GeorgeMac deleted the gm/ot-to-otel branch October 4, 2022 18:31
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.

Replace OpenTracing with OpenTelemetry
3 participants