To verify specific metrics or transactions, you can now filter the
output using one or several of the options below. Each of these takes a
comma-separated list of wildcard expressions.
- `-apm-metrics`
- `-apm-transactions`
- `-apm-transactions-excludes`
Relates to ES-10969
Our APMTracer doesn't like nulls - this is a sensible thing, as APM in general does not allow nulls (it only allows a precise set of types).
This PR changes the attribute to a sentinel "" in place of null values. It also makes a small change to APMTracer to give a better error message in case of null values in attributes.
Instrument write access to System properties by means of the `WriteSystemPropertiesEntitlement`.
`System.setProperties(Properties)` is always denied.
Part of #ES-10359
This updates the gradle wrapper to 8.12
We addressed deprecation warnings due to the update that includes:
- Fix change in TestOutputEvent api
- Fix deprecation in groovy syntax
- Use latest ospackage plugin containing our fix
- Remove project usages at execution time
- Fix deprecated project references in repository-old-versions
The most relevant ES changes that upgrading to Lucene 10 requires are:
- use the appropriate IOContext
- Scorer / ScorerSupplier breaking changes
- Regex automaton are no longer determinized by default
- minimize moved to test classes
- introduce Elasticsearch900Codec
- adjust slicing code according to the added support for intra-segment concurrency
- disable intra-segment concurrency in tests
- adjust accessor methods for many Lucene classes that became a record
- adapt to breaking changes in the analysis area
Co-authored-by: Christoph Büscher <christophbuescher@posteo.de>
Co-authored-by: Mayya Sharipova <mayya.sharipova@elastic.co>
Co-authored-by: ChrisHegarty <chegar999@gmail.com>
Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Co-authored-by: Armin Braun <me@obrown.io>
Co-authored-by: Panagiotis Bailis <pmpailis@gmail.com>
Co-authored-by: Benjamin Trent <4357155+benwtrent@users.noreply.github.com>
* Use String.replace() instead of replaceAll() for non-regexp replacements
When arguments do not make use of regexp features replace() is a more efficient option, especially the char-variant.
Telemetry / APM settings are renamed from "tracing.apm.{name}" to "telemetry.tracing.{name}" for tracing related settings. General APM settings are renamed to "telemetry.{name}". The old legacy settings are kept for now and applied as fallback.
This implements metrics for the threadpools.
The aim is to emit metrics for the various threadpools, the metric callback should be created when the threadpool is created, and removed before the threadpool is shutdown.
The PR also includes a test for the new metrics, and some additions to the metrics test plugin.
Finally the metric name check has been modified to allow some of the non compliant threadpools (too long, includes - )
Co-authored-by: Przemyslaw Gomulka <przemyslaw.gomulka@elastic.co>
This implements metrics for the threadpools.
The aim is to emit metrics for the various threadpools, the metric callback should be created when the threadpool is created, and removed before the threadpool is shutdown.
The PR also includes a test for the new metrics, and some additions to the metrics test plugin.
Finally the metric name check has been modified to allow some of the non compliant threadpools (too long, includes - )
---------
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Przemyslaw Gomulka <przemyslaw.gomulka@elastic.co>
Prevent invalid and miss-configuration of APM agent using an explicit allow-list of setting keys.
Additionally, configuration defaults of APMAgentSettings are consolidated in APMJvmOptions to keep defaults in a single location.
(ES-6916)
This commit adds a minimum metric name validation which checks:
metric name starts with es. prefix
metric name is using . as a separator of elements
metric name is using characters from a white list
validate min number of elements = 3 elements ( prefix, group and the suffix name)
validate max number of elements and max characters per element
validate the suffix element in a metric name to be from the enumerated allow list
It also modifies existing metric names to adhere to those rules
`Tracer.startTrace(ThreadContext threadContext, Traceable traceable, String name, Map<String, Object> attributes)` takes in a `ThreadContext` which creates a dependency on `server`. This change adds a new interface, `ThreadContext` with those methods required from `ThreadContext` and uses that as the parameter to `startTrace`.
The methods in the `TraceContext` interface are
```
<T> T getTransient(String key);
void putTransient(String key, Object value);
String getHeader(String key);
void putHeader(String key, String value);
```
which are needed for getting the parent context, the remote headers, the x-opaque-id and setting the remote headers for a trace.
This is an ugly but functional way to remove a dependency on server to be able to move telemetry in to a library for static metric registration.
`Tracer.startTrace` has overloaded methods for accepting `RestRequest` and `Task.` In order to implement static registration, we want to move APM into a library. Accepting these two types as parameters creates a dependency on server that needs to be removed for telemetry into lib.
This change removes the overloaded method in favor of the `Traceable` interface allows `Tracer` to get the `SpanId`.
The `ThreadContext` argument also creates a dependency on server, but that is more involved and will be addressed in another change.
This commit adds a log message at debug level when a metric is registered. This allows to start elasticsearch with a level changed for the apm package and get a list of metric names.
It should be useful when trying to came up with a new meteric name the command to run
./gradlew run -Dtests.es.logger.org.elasticsearch.telemetry.apm=debug
Avoid null pointer error when an observation is null [0].
* To get the tests working, replace the this-escape buildInstrument with a Builder.
* Removes locking around close
{Double,Long}AsyncCounters were not in the registrar list so they were not included when switching providers.
Other changes:
* Moved DoubleAsyncCounter's register and get to match the order of the rest of APMMeterRegistry.
* Fixed RecordingOtelMeter's Histogram and DoubleUpDownCounter
* Fixed String format in RecordingMeter's asserts.