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
metrics, java: add support for Micrometer metrics #2496
Conversation
I know that this is in draft, and I like the idea of gathering telemetry, however can we make this feature opt-in? That is, a user needs to add the JAR to the classpath for telemetry to be gathered. My motivations are:
|
client/java/build.gradle
Outdated
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will break the Spark integration tests, as they use JDK 8. Furthermore, upgrading the Spark integration tests to JDK 11 may cause the Spark 2.4.8 integration test to break - though I cannot say for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not worth yet to do full review, I'll revert this back to JDK 8 and let you review once this goes out of draft.
However the questions around whole idea are good and worth having, just not particular lines of code :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @d-m-h it's ready for review.
@d-m-h yes - it will be optional, and not collected when not enabled, except in case of debug context, when the metrics would get attached to
The goal is to the contrary to what you've said in the first sentence - with telemetry we aim to make using OpenLineage integration easier operationally. Some large organizations want answers for questions like:
Additionally, we've seen some cases where lineage extraction was taking a long time. Having timing metrics around lineage extraction would help us understand where the things are slow, besides obvious candidates. It will be also easier for some of us to debug cases where things go wrong, as compared to you, we usually don't have access to people's jobs, just what they decide to send to us, which are mostly logs and events.
It's not bespoke - you can send it to OLTP: https://docs.micrometer.io/micrometer/reference/implementations/otlp.html as well as other implementations like StatsD/Datadog which one of our clients use. |
62ce7a0
to
eeae970
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Primo PR. Beside other comments and questions, my major concern is: does it make sense to combine in a single PR for general metrics feature + metrics per builder/visitor to be included in debug facet? I would say it can be easier to split it into 2 PRs.
client/java/src/main/java/io/openlineage/client/OpenLineageClient.java
Outdated
Show resolved
Hide resolved
client/java/src/main/java/io/openlineage/client/OpenLineageClient.java
Outdated
Show resolved
Hide resolved
integration/spark/app/src/test/java/io/openlineage/spark/agent/DatabricksUtils.java
Outdated
Show resolved
Hide resolved
...n/spark/shared/src/main/java/io/openlineage/spark/api/InternalConvertedQueryPlanVisitor.java
Outdated
Show resolved
Hide resolved
client/java/src/test/java/io/openlineage/client/ConfigTest.java
Outdated
Show resolved
Hide resolved
client/java/src/test/java/io/openlineage/client/metrics/MetricsTest.java
Outdated
Show resolved
Hide resolved
@Override | ||
public void onApplicationStart(SparkListenerApplicationStart applicationStart) { | ||
initializeContextFactoryIfNotInitialized(applicationStart.appName()); | ||
appStartCounter.increment(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it make sense to implement similar counter for other event types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
7c013ee
to
f673013
Compare
f673013
to
bf9e8bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mobuchowski thank you for updating docs and splitting PRs.
Left few minor wording comments - are we using properly meter
vs metric
through class naming?
client/java/src/main/java/io/openlineage/client/metrics/CompositeMetricsBuilder.java
Outdated
Show resolved
Hide resolved
client/java/src/main/java/io/openlineage/client/metrics/MetricsResolver.java
Outdated
Show resolved
Hide resolved
client/java/src/main/java/io/openlineage/client/metrics/SimpleMetricsBuilder.java
Outdated
Show resolved
Hide resolved
client/java/src/main/java/io/openlineage/client/metrics/StatsDMetricsBuilder.java
Outdated
Show resolved
Hide resolved
9e4581f
to
448bd7d
Compare
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
448bd7d
to
fd38050
Compare
Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com>
…eage#2496) Signed-off-by: Maciej Obuchowski <obuchowski.maciej@gmail.com> Signed-off-by: Fabio Manganiello <fabio@manganiello.tech>
This PR adds support for Micrometer-based telemetry. This comprises of:
MeterRegistryFactory
mechanism that allows to construct Micrometer'sMeterRegistry
based on passed configurationMicrometerProvider
mechanism that allows you to configure metrics from any OpenLineage integration and get configuredMeterRegistry
instanceStatsDMetricsBuilder
The metrics mechanism can forward metrics to any Micrometer compatible implementation - list here - however compatible wrapper
MeterRegistryFactory
needs to be added. This PR adds only support for StatsD based one, as well as in-memorySimpleMetricsBuilder
andCompositeMetricsBuilder
that allows you to configure multiple backends. However, global registry provided byMicrometerProvider
is aCompositeMetricsBuilder
, so that using it manually is generally unadvisable.