Skip to content

Commit 72b775b

Browse files
committed
Enable zend observer by default for PHP 8+
1 parent a7c94f1 commit 72b775b

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

docs/en/configuration/ini-settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This is the configuration list supported in `php.ini`.
1919
| skywalking_agent.ssl_cert_chain_path | The certificate file. Enable mTLS when `ssl_key_path` and `ssl_cert_chain_path` exist. Only available when `reporter_type` is `grpc`. | |
2020
| skywalking_agent.heartbeat_period | Agent heartbeat report period. Unit, second. | 30 |
2121
| skywalking_agent.properties_report_period_factor | The agent sends the instance properties to the backend every heartbeat_period * properties_report_period_factor seconds. | 10 |
22-
| skywalking_agent.enable_zend_observer | Whether to use `zend observer` instead of `zend_execute_ex` to hook the functions, this feature is only available for PHP8+. | Off |
22+
| skywalking_agent.enable_zend_observer | Whether to use `zend observer` instead of `zend_execute_ex` to hook the functions, this feature is only available for PHP8+. | On |
2323
| skywalking_agent.reporter_type | Reporter type, optional values are `grpc`, `kafka` and `standalone`. | grpc |
2424
| skywalking_agent.kafka_bootstrap_servers | A list of host/port pairs to use for connect to the Kafka cluster. Only available when `reporter_type` is `kafka`. | |
2525
| skywalking_agent.kafka_producer_config | Configure Kafka Producer configuration in JSON format `{"key": "value}`. Only available when `reporter_type` is `kafka`. | {} |

docs/en/configuration/zend-observer.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Refer to: <https://www.datadoghq.com/blog/engineering/php-8-observability-baked-right-in/#the-observability-landscape-before-php-8>
44
5-
By default, skywalking-php hooks the `zend_execute_internal` and `zend_execute_ex` functions to implement auto instrumentation.
5+
On PHP 7, skywalking-php hooks the `zend_execute_internal` and `zend_execute_ex` functions to implement auto instrumentation.
66

77
But there are some drawbacks:
88

@@ -28,5 +28,6 @@ opcache.jit = tracing
2828
[skywalking_agent]
2929
extension = skywalking_agent.so
3030
; Switch to use zend observer api to implement auto instrumentation.
31+
; Default is On for PHP 8+.
3132
skywalking_agent.enable_zend_observer = On
3233
```

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ pub fn get_module() -> Module {
187187
10i64,
188188
Policy::System,
189189
);
190-
module.add_ini(SKYWALKING_AGENT_ENABLE_ZEND_OBSERVER, false, Policy::System);
190+
module.add_ini(SKYWALKING_AGENT_ENABLE_ZEND_OBSERVER, true, Policy::System);
191191
module.add_ini(
192192
SKYWALKING_AGENT_REPORTER_TYPE,
193193
"grpc".to_string(),

tests/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub const EXT: &str = if cfg!(target_os = "linux") {
7070
};
7171

7272
pub static ENABLE_ZEND_OBSERVER: Lazy<String> =
73-
Lazy::new(|| env::var("ENABLE_ZEND_OBSERVER").unwrap_or_else(|_| "Off".to_owned()));
73+
Lazy::new(|| env::var("ENABLE_ZEND_OBSERVER").unwrap_or_else(|_| "On".to_owned()));
7474

7575
pub static HTTP_CLIENT: Lazy<reqwest::Client> = Lazy::new(reqwest::Client::new);
7676

0 commit comments

Comments
 (0)