Coder Social home page Coder Social logo

auxmoney / opentracingbundle-core Goto Github PK

View Code? Open in Web Editor NEW
24.0 6.0 13.0 432 KB

Collection of symfony bundles providing everything needed for a symfony application to enable distributed tracing

License: MIT License

PHP 97.78% Shell 2.22%
auxmoney opentracing symfony symfony-bundle distributed-tracing jaeger zipkin monolog guzzle opentracing-bundle

opentracingbundle-core's People

Contributors

cawolf avatar dependabot[bot] avatar dgafka avatar filisko avatar gromnan avatar l3tum avatar mmross avatar semantic-release-bot avatar ujwaldhakal 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opentracingbundle-core's Issues

Could not finish active span, missing active scope

public static function getSubscribedEvents(): array
{
return [
'kernel.response' => ['onResponse', -2048],
];
}

This event listener is bound to the 'kernel.response' event, but the event listener that starts the corresponding span is bound to the 'kernel.controller' event.

public static function getSubscribedEvents(): array
{
return [
'kernel.controller' => ['onController', 16],
];
}

In some cases, the response is sent before the controller is reached (when an exception is thrown between the request event and the controller event), making the finish span failing with the message Auxmoney\OpentracingBundle\Service\TracingService: could not finish active span, missing active scope.

Add ERROR tag ?

Why not add $this->tracing->setTagOfActiveSpan(ERROR, true); in the following locations:

add possibility to choose sampling strategy

Despite having no consensus on a specification for sampling in general, most tracers are actually providing two basic tracer types:

  • constant samplers (always tracing, never tracing)
  • probabilistic samplers

Right now, we are enabling the constant samplers (always tracing) by default for tracing implementations. However, as high-traffic projects are going to use this bundle, there will be the need of choosing other strategies (probably at configure-time, maybe even at runtime).

In order to provide this feature to bundle users, we should research how current tracer implementations are handling and passing these configurations and maybe come up with an abstraction.

drop support for PHP 7

In November 2022, PHP 7.4 will reach EOL. We should then drop the support and should refactor to PHP 8-only features, like:

  • union types
  • attributes (for replacing annotations only viable since Symfony 5.2)
  • constructor property promotion
  • static return type
  • mixed type
  • nullsafe operator
  • named arguments
  • match expression

We can utilize rector to get a good headstart.

Tracing is not going deeper in the caller code

Hi everyone! I found your libs by searching for a Jeager solution for PHP. Great work! I am testing right now OpentracingBundle-Jaeger for our Symfony Microservices and I am wondering if I have some misunderstandings about the distributed tracing.

I posted also the issue in Stackoverflow: https://stackoverflow.com/questions/77652397/distributed-tracing-with-jaeger-between-symfony-php-microservices

But also here in short. In Jeager I don't see the nested calls (the stacktrace of all the calls) but see only the main call and thats it. The same also for Commands, when I run some command, then I see only one span and not the class/method calls inside the command.

Do I miss some setting for enabling this? Thanks!

create architecture to add and configure tags added to root spans

In order to fine tune the meta information provided with tags in the root spans, we should create the possibility to configure these tags easily.

Besides, we should consider an architecture to easily add new tags with dedicated classes and plug them into the configuration automatically.

Root span names have a high cardinality

Root span names have a high cardinality, because they use the plain request URI:

$this->tracing->startActiveSpan(
$request->getUri(),
$options
);

The names should be more generic according to the docs of OpenTelemetry (which is the successor of OpenTracing):

The span name SHOULD be the most general string that identifies a (statistically) interesting class of Spans, rather than individual Span instances while still being human-readable. That is, “get_user” is a reasonable name, while “get_user/314159”, where “314159” is a user ID, is not a good name due to its high cardinality. Generality SHOULD be prioritized over human-readability. — https://opentelemetry.io/docs/reference/specification/trace/api/#span

and:

Many REST APIs encode parameters into URI path, e.g. /api/users/123 where 123 is a user id, which creates high cardinality value space not suitable for span names. In case of HTTP servers, these endpoints are often mapped by the server frameworks to more concise HTTP routes, e.g. /api/users/{user_id}, which are recommended as the low cardinality span names. — https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/#name

I think using the plain URL also might put necessary stress to the Tracing systems.

As an alternative we could replace the URL we with the route name as soon as it is available in the KernelEvents::CONTROLLER event ($event->getRequest()->attributes->get('_route').

Thank you!

update documentation

update documentation to reflect:

  • the automatic header propagation for PSR-18
  • the limitations of UDP transports (jaeger)
  • the new Doctrine-DBAL plugin
  • new configuration related to sampling

Version constraints

Hi

First off just a thnk you for this great looking set of bundles - just what I was looking for.

I'm trying to install the following bundles

auxmoney/opentracing-bundle-jaeger
auxmoney/OpentracingBundle-Monolog
auxmoney/OpentracingBundle-Guzzle

but there are version mismatches between them as reported by composer

  • Root composer.json requires auxmoney/opentracing-bundle-monolog ^0.4.5 -> satisfiable by auxmoney/opentracing-bundle-monolog[v0.4.5].
    • auxmoney/opentracing-bundle-monolog v0.4.5 requires auxmoney/opentracing-bundle-core ^0.7 -> found auxmoney/opentracing-bundle-core[v0.7.0, ..., v0.7.7] but the package is fixed to v0.8.1 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.

Basically it looks like monolog and guzzle plugins need 0.7 and jaeger needs 0.8. Is there a way to install this, or do the older packages need an update to be compatible?

Thanks

Steve

add Doctrine ORM / DBAL support

In order to reduce manual implementation overhead of bundle users, we should generate spans around SQL queries in Doctrine automatically.

Support for doctrine/dbal 3

Currently it is not possible to install that bundle with doctrine/dbal 3. Can you add support for that?

- auxmoney/opentracing-bundle-doctrine-dbal v1.2.3 requires doctrine/dbal ^2.11 -> found doctrine/dbal[2.11.0, ..., 2.13.9] but the package is fixed to 3.6.2 (lock file version) by a partial update and that version does not match.

segfault when using existing docker networks

When using an existing docker network with a Jaeger service named jaeger, calling any script causes the PHP process to segfault:

$ bin/console
Segmentation fault (core dumped)
$

Further investigation showed, that dns_get_record() does not handle this situation well, but gethostbyname() does. Therefore, we should switch the implementation.

replace composer/package-versions-deprecated

We are currently using composer/package-versions-deprecated to enrich traces with the versions of our packages. According to the package maintainer, this can (and should) be replaced with built in tools of composer 2. We should evaluate this and possibly get rid of this dependency in favor of a dependency on composer 2.

create complete tutorial

In order to show the complete functionality, we should create a tutorial (as wiki page?) on how to set up an example application.

We should include setting up a tracer instance, symfony application and instrumentation. It should also include some fancy screenshots.

How to extract

HI

I need to put the span context into a queuing system and then continue the span when the message comes off the queue.

I can get the span context fine using tracing->injectTracingHeadersIntoCarrier()

But I've searched around and can't find how to do the extract part so that Tracing knows I want to continue using this span context. Any pointers on how to do that?

Many thanks

Steve

Disable automatic tracing for command

I have a use case when my Symfony command are some kinds of worker.
In this context, I want to avoid waiting for my command to finish and only trace the part I want to.
WDYT?

explicitely distinguish between span types

Currently, span types are distinguished only implicitely by operation name and presence or absence of specific tags.

In order to evaluateand filter traces more efficiently, we would like to distinguish between different types of spans explicitely (e.g. with a "opentracing bundle type" tag). This feature should also be implemented across all plugins.

refurbish README

update README reflecting all changes

  • correct CI badges (correct links to platforms)
  • remove some quality badges (esp. software quality)
  • link to tutorial (compare #8 )
  • remove obsolete plugins (emagtech)

Esi support

Do you have an idea of what should be done to support esi requests ?
Currently they are tracked as separate traces, not related to the parent trace.
Thanks

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.