-
Notifications
You must be signed in to change notification settings - Fork 66
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
Mila/client side metrics demo2 #1840
base: main
Are you sure you want to change the base?
Conversation
static final String FIRESTORE_LIBRARY_NAME = "firestore_java"; | ||
|
||
// TODO: change to firestore.googleapis.com | ||
public static final String METER_NAME = "custom.googleapis.com/internal/client"; |
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.
Opentelemetry uses dot separation in metrics naming, while monarch uses slash separation. exporting the built-in metrics to other backends might raise naming conflict.
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.
we could have named the metrics with dot seperation, use view to reformat it with slash separation in the default OTEL instance for monarch. But the metrics from Gax uses slash already, using dot separation inside firestore doesn't solves the problem.
google-cloud-firestore/src/main/java/com/google/cloud/firestore/telemetry/MetricsUtil.java
Show resolved
Hide resolved
// that cannot be tracked client side. | ||
return new ServerSideTransactionRunner<>(this, updateFunction, transactionOptions).run(); | ||
MetricsContext metricsContext = | ||
getOptions().getMetricsUtil().createMetricsContext("RunTransaction"); |
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.
some of the function names are not in SPAN_NAME.. list. add them on.
@@ -97,6 +104,10 @@ public ApiFuture<AggregateQuerySnapshot> get() { | |||
@Nonnull | |||
public ApiFuture<ExplainResults<AggregateQuerySnapshot>> explain(ExplainOptions options) { | |||
TraceUtil.Span span = getTraceUtil().startSpan(TraceUtil.SPAN_NAME_AGGREGATION_QUERY_GET); | |||
|
|||
MetricsContext metricsContext = | |||
getMetricsUtil().createMetricsContext(TraceUtil.SPAN_NAME_AGGREGATION_QUERY_GET); |
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.
Metrics shares the same SPAN_NAME for most of the cases, but it should not directly grab and use. Move the constants out to a shared file/class.
@@ -249,6 +250,9 @@ public void onResponse(BatchGetDocumentsResponse response) { | |||
DocumentReference documentReference; | |||
DocumentSnapshot documentSnapshot; | |||
|
|||
// TODO(metrics): record first_response_latency here. Need to come up with a way to |
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.
Some methods in this calls should have added monitoring info, like recursiveDelete
, getAll
, runTransaction
. discuss with Ehsan.
No description provided.