Git Product home page Git Product logo

opentelemetry's People

Contributors

ahbrown41 avatar chradcliffe avatar k4leung4 avatar li-jin-gou avatar rfyiamcool avatar rusherman avatar zstone12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

opentelemetry's Issues

Is context propagated automatically without using the function WithContext?

Your Question

As other tracing methods like sqlx, it is not necessary to call a function to pass the context as a parameter. But in the examples folder, you call WithContext and pass the context there.

I have seen in the code that the tracing plugin is called in the hooks so, do I need to call the method WithContext when we want to trace the SQL query?

The document you expected this should be explained

The README.md should have an example after its initialization.

Expected answer

Two possibilities:

  • Yes you need to use the method WithContext every time you want to execute any query
  • No, it is not

Add config option to trace raw `tx.Statement.SQL.String()` without applying `tx.Dialector.Explain`

Describe the feature

I'd like to add a config option to skip the tx.Dialector.Explain step step when tracing the query (i.e. just record the result of tx.Statement.SQL.String()). This can either be its own option or it could replace the WithoutQueryVariables() option, which has some significant performance issues for some uses (see below). I'm not sure that there's a good use case for WithoutQueryVariables() that wouldn't be solved with the proposed option.

I have a working version of the option in a fork I created here: master...tonalfitness:gorm-opentelemetry:master

If you're open to this request, I can open a PR for this change.

Motivation

I'm using this plugin in a production environment, configured with the WithoutQueryVariables() option. We originally configured the overall tracing with a relatively low sampling rate (10%) and there wasn't a noticeable change in performance. When we switch to 100% tracing (in order to tail sample our traces), we noticed a very large increase in latency and high CPU utilization that we traced back to the use of this plugin (by disabling it and re-testing).

We traced the actual performance issue to the use of tx.Dialector.Explain, which substitutes the actual parameters into the query string. This results in a lot of string copies, which I think makes sense given what it's doing. We use the WithoutQueryVariables() option, but all that does is substitute ? for the variable values -- it still does the string interpolation.

My preliminary performance testing of the forked version mentioned above shows that the high CPU utilization and latency goes away but we still get a useful representation of the SQL query used.

Related Issues

How to use this plugin to receive the parent span passed from the istio sidecar

I developed a http service using gin framework. The service has an interface to call gorm's framework for database queries. The telemetry of the entire service is generated through istio sidecar and reported to jaeger. Using the plugin alone, it is impossible to associate gorm's telemetry with the http service call.

How to pass the parent span and gorm association generated by istio

Related Issues

Can we use it for production ?

Your Question

We are looking for gorm tool for tracing and metrics, and , can we use it for production now?

The document you expected this should be explained

Expected answer

404 on https://gorm.io/plugin/opentelemetry?go-get=1

Description

Looks like the plugin doesn't exist on gorm.io:

go get gorm.io/plugin/opentelemetry
go: unrecognized import path "gorm.io/plugin/opentelemetry": reading https://gorm.io/plugin/opentelemetry?go-get=1: 404 Not Found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.