pccomponentes / apm-symfony-http-kernel Goto Github PK
View Code? Open in Web Editor NEWElastic APM for Symfony HttpKernel
License: MIT License
Elastic APM for Symfony HttpKernel
License: MIT License
Hi guys!
I have a question, how do you can pass some options for example the secret token?
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
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}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.