Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metering API Implementation #99723

Closed
wants to merge 24 commits into from

Conversation

stu-elastic
Copy link
Contributor

This pulls in @pgomulka's branch stu-elastic-otel-meter-api and adds the elasticsearch versions of the otel instruments.

@stu-elastic stu-elastic added WIP :Core/Infra/Core Core issues without another label labels Sep 20, 2023
with the support of metrics the TracerPlugin name is no longer
adequate. Renaming this to TelemetryPlugin.
Also introducing TelemetryProvider interface. While it is only used in
Node.java at the moment to fetch Tracer instance, it is intended to be
used in Plugin::createComponents (to be done in separate commite due to
the broad scope of this method)
This will allow for plugins to get access to both Tracer and Metric interfaces
without the need to add yet another argument to createComponents

Also adding internal subpackage in module/apm so that it is more obvious
which packages are not exported
update with latest main (package renames)
Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

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

I'm not sure which is the correct PR to look at right now, but I had these comments from yesterday that I thought I would post. I only got through a small portion of the PR; this is not a complete review.

@@ -82,7 +84,7 @@ class APMJvmOptions {
// is doing, leave this value alone.
"log_level", "error",
"application_packages", "org.elasticsearch,org.apache.lucene",
"metrics_interval", "120s",
"metrics_interval", "5s",
Copy link
Member

Choose a reason for hiding this comment

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

5 seconds seems pretty aggressive. Do we really need metric resolution at that granularity?

dependencies {
implementation "io.opentelemetry:opentelemetry-api:${otelVersion}"
implementation "io.opentelemetry:opentelemetry-context:${otelVersion}"
implementation "io.opentelemetry:opentelemetry-semconv:${otelVersion}-alpha"
runtimeOnly "co.elastic.apm:elastic-apm-agent:1.36.0"
implementation "co.elastic.apm:elastic-apm-agent:1.42.1-SNAPSHOT"
Copy link
Member

Choose a reason for hiding this comment

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

We should not commit a snapshot dependency, we'll need to wait until this is released.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good.

AllocationService allocationService,
IndicesService indicesService
) {
final APMTracer apmTracer = tracer.get();
final APMTracer apmTracer = telemetryProvider.get().getTracer();
Copy link
Member

Choose a reason for hiding this comment

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

Why is the provider captured, when it is already passed in? It should be the exact same, so we could avoid the SetOnce?

@@ -50,10 +50,12 @@ class APMJvmOptions {
// by the agent. Don't disable writing to a log file, as the agent will then
// require extra Security Manager permissions when it tries to do something
// else, and it's just painful.
"log_file", "_AGENT_HOME_/../../logs/apm.log",

"log_file", "/Users/przemyslawgomulka/workspace/pgomulka/apm.log",
Copy link
Member

Choose a reason for hiding this comment

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

The log file and level need to be reset back to their original levels.

@stu-elastic
Copy link
Contributor Author

Superseded by #99832

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label v8.11.0 WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants