# Intermittent metric registration error: worker\_millis\_per\_event

**URL:** <https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [December 3, 2025, 9:36am UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836 "2025-12-03T09:36:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariyabanatic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mariyabanatic/32/146029_2.png) [@mariyabanatic](https://discuss.elastic.co/u/mariyabanatic)\
**Post date:** [December 3, 2025, 9:36am UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/1 "2025-12-03T09:36:48Z")

</div>

#### **Issue**

Intermittent warning during pipeline startup. The `worker_millis_per_event` metric fails to register but pipeline functions normally.

```auto
[org.logstash.execution.AbstractPipelineExt] Metric registration error: `worker_millis_per_event` could not be registered in namespace `[:stats, :pipelines, :logstash, :plugins, :filters, :c13c16377fd9a15e6e691284665f2da3494b42273b1fc6e37b6330fff12eb5ab, :flow]`

```

#### **Observed Behavior**

- **Not consistently reproducible** - Occurs intermittently during startup

- **No functional impact** - Pipeline processes events normally

- **Metrics not available - P** ipeline stats are empty from endpoint localhost:9600/\_node/stats/pipelines  
`{`  
` "host": "log-transformer",`  
` "version": "9.0.3",`  
` "http_address": "0.0.0.0:9600",`  
` "id": "5fbd8fxxxxxxxxxxxx5602",`  
` "name": "log-transformer",`  
` "ephemeral_id": "36axxxxxxxxxxxxxxxxx2348a7",`  
` "snapshot": false,`  
` "status": "unknown",`  
` "pipeline": {`  
` "workers": 2,`  
` "batch_size": 2048,`  
` "batch_delay": 50`  
` },`  
` "pipelines": {}`  
`}`

- **Self-resolving** : Logstash process restart with same configuration succeeds without error. No warning message and stats are also available in `/_node/stats/pipelines` endpoint.

#### **Versions**

- Logstash: 9.0.3
- JRuby: 9.4.9.0
- JVM: OpenJDK17

#### **Questions**

1. Is this a known race condition during pipeline initialization?

2. Any recommended configuration to prevent this?

#### **Logs**

Full startup logs attached - [Logstash Logs - Metrics registration error · GitHub](https://gist.github.com/Mariyabanatic/70f79f24f3cb10eff92bbc24829ce12e)

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [December 3, 2025, 8:26pm UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/2 "2025-12-03T20:26:57Z")

</div>

Your LS conf is OK. Listeners have been started correctly. Have you set [legacy monitoring settings](https://www.elastic.co/docs/reference/logstash/monitoring-internal-collection-legacy#configure-internal-collectors-legacy)?

```auto
xpack.monitoring.allow_legacy_collection: true
xpack.monitoring.enabled: true

```

Do you have the LS\_JAVA\_HOME environment variable?  
Have you installed JDK or you are using LS JDK bundled?

---

<div class="post-metadata">

**Author:** ![mariyabanatic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mariyabanatic/32/146029_2.png) [@mariyabanatic](https://discuss.elastic.co/u/mariyabanatic)\
**Post date:** [December 4, 2025, 10:29am UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/3 "2025-12-04T10:29:27Z")

</div>

Thanks for responding. PFB details.

No, legacy monitoring is not set. PFB contents from `logstash.yaml` file. Hope those two settings are set to false by default.

> api.http.host: "0.0.0.0"  
> api.http.port: 9600  
> log.level: "info"  
> pipeline.workers: 2  
> pipeline.batch.size: 2048  
> pipeline.batch.delay: 50  
> path.logs: /opt/logstash/resource  
> pipeline.ecs\_compatibility: disabled

LS\_JAVA\_HOME is also not set. Logstash using default Java path which is `/usr/bin/java`

Installed JDK is used and not the Logstash bundled one.

Let me know if you need more details.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [December 4, 2025, 12:38pm UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/4 "2025-12-04T12:38:09Z")

</div>

Can you try at least add: `xpack.monitoring.allow_legacy_collection: true`

You can check [the line](https://github.com/elastic/logstash/blob/main/logstash-core/src/main/java/org/logstash/execution/AbstractPipelineExt.java#L776) which raise an error. Not sure what's happening here because of Java. Long time ago I had a case, which was resolved by installing Oracle JDK not OpenJDK.

Anyone other had similar issues? Badger, Leandro, any suggestions?

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [December 11, 2025, 10:23am UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/5 "2025-12-11T10:23:19Z")

</div>

I don't know has been this solved, a few more tips:

- Set `LS_JAVA_PATH`. Check [this topic](https://discuss.elastic.co/t/logstash-setting-ls-java-home/307538) about Java path issues.
- Review `jvm.options`, `log4j2.properties` and JVM settings. Do you have upgraded LS version? Like from older 7.x or something? Check [this](https://www.elastic.co/guide/en/logstash/8.19/getting-started-with-logstash.html#jdk-upgrade) for any case.
- Maybe to try ​TAR.GZ version without docker, if is possible, at least temporarily.

---

<div class="post-metadata">

**Author:** ![mariyabanatic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mariyabanatic/32/146029_2.png) [@mariyabanatic](https://discuss.elastic.co/u/mariyabanatic)\
**Post date:** [January 5, 2026, 8:06am UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/6 "2026-01-05T08:06:16Z")

</div>

Hi @Rios

Sorry for the delay here.

Currently, testing Logstash with `xpack.monitoring.allow_legacy_collection: true` parameter. Will share the observations shortly.

Regarding `log4j2.properties`, we are not using any properties related to routing/rolling/json\_rolling. So those changes are not relevant to us at least. Snippet from our `log4j2.properties` file.

```auto
monitorInterval = 1
appender.console.type = Console
appender.console.name = plain_console
appender.console.layout.type = PatternLayout

```

Thanks,  
Mariya

---

<div class="post-metadata">

**Author:** ![mariyabanatic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mariyabanatic/32/146029_2.png) [@mariyabanatic](https://discuss.elastic.co/u/mariyabanatic)\
**Post date:** [January 5, 2026, 9:25am UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/7 "2026-01-05T09:25:11Z")

</div>

@Rios Tried adding above mentioned properties in logstash.yml file but it’s not supported since we are using `logstash-oss` version.

`Your settings are invalid. Reason: Setting "xpack.monitoring.allow_legacy_collection" doesn't exist. Please check if you haven't made a typo.`

Kindly suggest here.

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [January 8, 2026, 11:29pm UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/8 "2026-01-08T23:29:31Z")

</div>

Yes you have abs. right, OSS doesn't support x-pack.  
However, I found info that APIs should work, but cannot find an official confirmation.

Regarding log4j2.properties params, this can be related if LS was upgraded from older version and miss paramters. In case there was no upgrade or nobody has been changed params, leave aside.

Again, according to the s.code on GitHub, an issue might be related to Java. Have you tried to set LS\_JAVA\_HOME?

Have you tried with [.gz version](https://artifacts.elastic.co/downloads/logstash/logstash-9.0.3-linux-x86_64.tar.gz)? Just for test purpose. Extract, test, later can be removed.

---

<div class="post-metadata">

**Author:** ![mariyabanatic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mariyabanatic/32/146029_2.png) [@mariyabanatic](https://discuss.elastic.co/u/mariyabanatic)\
**Post date:** [September 2, 2026, 6:02am UTC](https://discuss.elastic.co/t/intermittent-metric-registration-error-worker-millis-per-event/383836/9 "2026-09-02T06:02:11Z")

</div>

Hi @Rios ,

Apologies. Missed to provide an update here.

We have tried setting LS\_JAVA\_HOME env variable as well. But unfortunately, we are still seeing the same metrics registration error. We are using only oss version and doesn't have setup to test with non-oss version which includes commercial elastic license.
