Giter VIP home page Giter VIP logo

apm-symfony-http-kernel's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

apm-symfony-http-kernel's Issues

500 error when a route does not exist

Description
When there is an exception before the onKernelController method is executed, a 500 error occurs when the variable$this->span is not declared.

How to reproduce
Launch a call to a route that does not exist

Possible Solution
Check if the $this->span variable is defined in onKernelResponse

mapper_parsing_exception on a Symfony 5.3 + PHP 8.0 project

First of all, here is my configuration:

Composer.json

"require": {
   "pccomponentes/apm-symfony-http-kernel": "^0.1.7",
   "zoilomora/elastic-apm-agent-php": "^1.0"
}

Then i have to set APM tracer instance

services.yaml

    apm.configuration:
        class: \ZoiloMora\ElasticAPM\Configuration\CoreConfiguration
        arguments:
            -  { appName: 'Nidum APM Service' }

    apm.reporter:
        class: \ZoiloMora\ElasticAPM\Reporter\ApmServerCurlReporter
        arguments:
            - 'http://192.168.3.44:9200'

    apm.poolFactory:
        class: \ZoiloMora\ElasticAPM\Pool\Memory\MemoryPoolFactory
        calls:
            -   method: create

    apm.tracer:
        class: \ZoiloMora\ElasticAPM\ElasticApmTracer
        arguments:
            $coreConfiguration: '@apm.configuration'
            $reporter: '@apm.reporter'
            $poolFactory: '@apm.poolFactory'

Then, configure the HTTP Kernel APM

services.yaml

    PcComponentes\ElasticAPM\Symfony\Component\HttpKernel\EventSubscriber:
        class: PcComponentes\ElasticAPM\Symfony\Component\HttpKernel\EventSubscriber
        autoconfigure: true
        arguments:
            $router: '@router'
            $elasticApmTracer: '@apm.tracer'

When I make any request to my app, the ApmServerCurlReporter.php is called and this is the response of curl call:

{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"illegal_argument_exception","reason":"Malformed content, found extra data after parsing: START_OBJECT"}},"status":400}

image

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.