Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,24 +258,9 @@ tests:
- class: org.elasticsearch.repositories.azure.AzureBlobContainerRetriesTests
method: testWriteBlobWithRetries
issue: https://github.com/elastic/elasticsearch/issues/144025
- class: org.elasticsearch.test.apmintegration.MetricsApmIT
method: testJvmMetrics {withOTel=true}
issue: https://github.com/elastic/elasticsearch/issues/144166
- class: org.elasticsearch.test.apmintegration.MetricsApmIT
method: testJvmMetrics {withOTel=false}
issue: https://github.com/elastic/elasticsearch/issues/144167
- class: org.elasticsearch.test.apmintegration.MetricsApmIT
method: testApmIntegration {withOTel=false}
issue: https://github.com/elastic/elasticsearch/issues/144282
- class: org.elasticsearch.reindex.management.ReindexGetRelocationIT
method: testGetReindexFollowsRelocation
issue: https://github.com/elastic/elasticsearch/issues/144364
- class: org.elasticsearch.server.cli.APMJvmOptionsTests
method: testAPMAgentMetricsDisabledWhenOtelMetricsEnabled
issue: https://github.com/elastic/elasticsearch/issues/144357
- class: org.elasticsearch.server.cli.APMJvmOptionsTests
method: testAPMAgentAlwaysAttached
issue: https://github.com/elastic/elasticsearch/issues/144358
- class: org.elasticsearch.xpack.application.OpenAiServiceUpgradeIT
method: testOpenAiEmbeddings {upgradedNodes=3}
issue: https://github.com/elastic/elasticsearch/issues/144440
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.elasticsearch.monitor.metrics;

import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.monitor.process.ProcessProbe;
import org.elasticsearch.telemetry.InstrumentType;
import org.elasticsearch.telemetry.RecordingMeterRegistry;
import org.elasticsearch.test.ESTestCase;
Expand Down Expand Up @@ -48,17 +49,19 @@ private static void testSystemMetrics(boolean emitOTelMetrics) {
systemMetrics.start();

List<String> registeredGauges = registry.getRecorder().getRegisteredMetrics(InstrumentType.LONG_GAUGE);
assertTrue("jvm.fd.used should always be registered", registeredGauges.contains("jvm.fd.used"));
assertTrue("jvm.fd.max should always be registered", registeredGauges.contains("jvm.fd.max"));
boolean openFdSupported = ProcessProbe.getOpenFileDescriptorCount() >= 0;
boolean maxFdSupported = ProcessProbe.getMaxFileDescriptorCount() >= 0;
assertEquals("jvm.fd.used should be registered if supported", openFdSupported, registeredGauges.contains("jvm.fd.used"));
assertEquals("jvm.fd.max should be registered if supported", maxFdSupported, registeredGauges.contains("jvm.fd.max"));
assertEquals(
"jvm.file_descriptor.count should be registered if emitting OTel metrics",
registeredGauges.contains("jvm.file_descriptor.count"),
emitOTelMetrics
openFdSupported && emitOTelMetrics,
registeredGauges.contains("jvm.file_descriptor.count")
);
assertEquals(
"jvm.file_descriptor.limit should be registered if emitting OTel metrics",
registeredGauges.contains("jvm.file_descriptor.limit"),
emitOTelMetrics
maxFdSupported && emitOTelMetrics,
registeredGauges.contains("jvm.file_descriptor.limit")
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package org.elasticsearch.test.apmintegration;

import org.apache.lucene.util.Constants;
import org.elasticsearch.client.Request;
import org.elasticsearch.logging.LogManager;
import org.elasticsearch.logging.Logger;
Expand Down Expand Up @@ -179,6 +180,12 @@ public void testJvmMetrics() throws Exception {
)
);

if (Constants.WINDOWS) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this check for Windows, while the other one checks ProcessProbe? I would have expected both of them to check the same thing.

// JVM file descriptor metrics are not emitted on Windows.
valueAssertions.remove("jvm.fd.used");
valueAssertions.remove("jvm.fd.max");
}

CountDownLatch finished = new CountDownLatch(1);

Consumer<ReceivedTelemetry> messageConsumer = (ReceivedTelemetry msg) -> {
Expand Down
Loading