-
Notifications
You must be signed in to change notification settings - Fork 33
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
Changes for adding default dimensions in CWSink. #209
Conversation
6d6cc15
to
c13af49
Compare
@vamsi-amazon Would you prefer a seperate commit for AOP or should I contribute to this PR? |
Separate PR. I would minimize the changes in this PR and would limit to just publishing opensearch response code metrics. You can refactor and add AOP. Will publish the PR by end of the day. |
eca7d80
to
791220c
Compare
.../src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedCloudWatchReporter.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedCloudWatchReporter.java
Outdated
Show resolved
Hide resolved
.withDimensions(dimensions) | ||
.withUnit(standardUnit)); | ||
} | ||
} | ||
|
||
@NotNull | ||
private Pair<String, Set<Dimension>> getFinalMetricNameAndDefaultDimensions(DimensionedName dimensionedName) { | ||
final String jobId = System.getenv().getOrDefault("SERVERLESS_EMR_JOB_ID", UNKNOWN); |
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.
what is the cons to add more dimensions in CW?
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.
@vamsi-amazon @penghuo can we assume "SERVERLESS_EMR_JOB_ID" is isolated at job level?
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.
@penghuo Didn't get your question?
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 can add more dimensions in the DimensionedName object while publishing the metric.
.../src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedCloudWatchReporter.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedCloudWatchReporter.java
Outdated
Show resolved
Hide resolved
flint-core/src/main/java/org/opensearch/flint/core/metrics/reporter/DimensionedName.java
Show resolved
Hide resolved
private Pair<String, Set<Dimension>> getFinalMetricNameAndDefaultDimensions(DimensionedName dimensionedName) { | ||
final String jobId = System.getenv().getOrDefault("SERVERLESS_EMR_JOB_ID", UNKNOWN); | ||
final String applicationId = System.getenv().getOrDefault("SERVERLESS_EMR_VIRTUAL_CLUSTER_ID", UNKNOWN); | ||
final String domainId = System.getenv().getOrDefault("FLINT_CLUSTER_NAME", UNKNOWN); |
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.
Also shall we include this in skip index mapping? https://github.com/opensearch-project/sql/blob/efb159a8cb0560fbde996cdf7c72ce82deb15681/spark/src/test/resources/flint-index-mappings/flint_mys3_default_http_logs_skipping_index.json#L20
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.
@noCharger Didn't get you.
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.
@vamsi-amazon do we persist cluster name in index meta field?
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.
Not sure. I guess no. What are you trying to get to?
flint-core/src/main/scala/org/apache/spark/metrics/source/FlintMetricSource.scala
Outdated
Show resolved
Hide resolved
fa73a34
to
7f40f4d
Compare
Signed-off-by: Vamsi Manohar <[email protected]>
This fix the backport issue #230 |
public static final String DIMENSION_JOB_ID = "jobId"; | ||
|
||
public static final String DIMENSION_APPLICATION_ID = "applicationId"; | ||
|
||
public static final String DIMENSION_DOMAIN_ID = "domainId"; | ||
|
||
public static final String DIMENSION_INSTANCE_ROLE = "instanceRole"; |
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.
although it's good to provide insights, DIMENSION_JOB_ID / DIMENSION_APPLICATION_ID / DIMENSION_DOMAIN_ID / DIMENSION_INSTANCE_ROLE are actually high cardinality dimensions which considered as seperate metrics. It will bring extra cost setting them as default dimensions. Ref: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_billing.html
Description
Previous Metric Name:
driver.00fg29jd50i99g0m.LiveListenerBus.queue.appStatus.listenerProcessingTime
Current Metric Name:
LiveListenerBus.queue.appStatus.listenerProcessingTime
Sample Metrics Testing:
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.