Comments (6)
@tsantos84 Are you trying to work on something similar to this? https://packagist.org/packages/goksagun/elastic-apm-bundle
When I was trying to set it up, I found it a bit inflexible for my needs, but it could be useful for you.
from elastic-apm-php-agent.
Yes, it's a bit inflexible and I decided to write a new bundle for my company purposes (fit php versions, new spans and etc). After this experience, I'm planning to write a public bundle or contribute with goksagun/elastic-apm-bundle
.
Anyway, the question here is about flushing the agent automatically. I think it'd be an optional process given the problems I've mentioned on the initial thread.
from elastic-apm-php-agent.
Perhaps what you need is something where if it is running in the symfony console, set the active config to false? That could be done in your symfony config, and not require a change in the agent code.
from elastic-apm-php-agent.
I've thought about this approach, but didn't saw an easy way to do that. And thinking better, unit testing could cause the same side effect depending how they were written. In a bundle, it's better to let it flush the events instead of on __destruct
. There is another side effect on it. If some error happens (e.g request failure), we can't see the error on __destruct
.
from elastic-apm-php-agent.
You may be able to do it through native php functions, so if you had a php config file, it could override the active config for the agent on runtime.
https://electrictoolbox.com/determine-php-run-via-http-or-cli/
https://www.php.net/manual/en/function.php-sapi-name.php
I will say, there is a lot of power in using php configuration files, but they are only documented in some circumstances.
from elastic-apm-php-agent.
If the apm server is not running or there is some network issue, then destruct function would throw an uncaught exception, would it be better to add a try catch here?
from elastic-apm-php-agent.
Related Issues (20)
- How can I get the data of apm-services?【apm server7.4】 HOT 16
- Span context HOT 2
- Transaction sampling rate
- setMeta, setTags, ...
- Elastic Breakdown graph requiring aggregation metrics HOT 1
- Time spent by span type chart is empty HOT 1
- Transactions using "Distributed Tracing" do not show spans HOT 1
- APM agent not found error HOT 2
- Compatibile issue HOT 2
- Compatibility with OpenDistro ELK HOT 1
- Include response status code HOT 2
- setContext method is missing from span HOT 2
- Error in composer require lib HOT 5
- Span is not indexed when stacktrace is set HOT 1
- Package maintenance proposal HOT 10
- Is maintainer alive?
- Return value of PhilKra\Events\EventBean::getTimestamp() must be of the type integer, float returned HOT 1
- Can't connect to apm-agent version 7.3.1 HOT 4
- Deprecate this package
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elastic-apm-php-agent.