-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: add consumer group id tag as global metric tag #161
Conversation
import static io.odpf.firehose.metrics.Metrics.SINK_RESPONSE_TIME_MILLISECONDS; | ||
import static io.odpf.firehose.metrics.Metrics.SOURCE_KAFKA_MESSAGES_FILTER_TOTAL; | ||
import static io.odpf.firehose.metrics.Metrics.SOURCE_KAFKA_PULL_BATCH_SIZE_TOTAL; | ||
import static io.odpf.firehose.metrics.Metrics.*; |
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.
don't put asterisk. It will fail the checkstyle.
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.
changes added
import static io.odpf.firehose.metrics.Metrics.FAILURE_TAG; | ||
import static io.odpf.firehose.metrics.Metrics.SOURCE_KAFKA_MESSAGES_COMMIT_TOTAL; | ||
import static io.odpf.firehose.metrics.Metrics.SUCCESS_TAG; | ||
import static io.odpf.firehose.metrics.Metrics.*; |
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.
don't put asterisk. It will fail the checkstyle..expand it like it was before
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.
<module name="AvoidStarImport">
<property name="allowStaticMemberImports" value="true"/>
</module>
it passed the checkstyle because currently the star (.*) import is currently allowed for static import
should we changes the checkstyle config too ?
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. that's fine.
but you don't have to edit current checkstyle or the 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.
you can add your import there, don't delete the previous lines.
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.
changes added
@@ -199,6 +186,12 @@ public void captureGlobalMessageMetrics(Metrics.MessageScope scope, int counter) | |||
statsDReporter.captureCount(GLOBAL_MESSAGES_TOTAL, counter, String.format(MESSAGE_SCOPE_TAG, scope.name())); | |||
} | |||
|
|||
public void captureGlobalMessageMetrics(Metrics.MessageScope scope, int counter, String... tags) { |
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 edit the previous method rather than adding a new one.
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.
changed
@fzrvic Instead of adding consumer_group tag into only one metric, let's think if other metrics can also be benefited from this tag. We can add there too. |
config/checkstyle/checkstyle.xml
Outdated
<module name="AvoidStarImport"> | ||
<property name="allowStaticMemberImports" value="true"/> | ||
</module> | ||
<module name="AvoidStarImport"/> |
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.
could we keep this?
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.
@fzrvic please revert this and changes in the previous files.
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.
reverted
@@ -187,19 +188,21 @@ public void captureErrorMetrics(ErrorType errorType) { | |||
|
|||
// =================== Retry and DLQ Telemetry ====================== | |||
|
|||
public void captureMessageMetrics(String metric, MessageType type, ErrorType errorType, int counter) { | |||
public void captureMessageMetrics(String metric, Metrics.MessageType type, ErrorType errorType, int counter) { |
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.
why this line is changed?
} | ||
|
||
public void captureMessageMetrics(String metric, MessageType type, int counter) { | ||
public void captureMessageMetrics(String metric, Metrics.MessageType type, int counter) { |
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.
revert back this line
config/checkstyle/checkstyle.xml
Outdated
@@ -83,7 +83,7 @@ | |||
<!-- Checks for imports --> | |||
<!-- See http://checkstyle.sf.net/config_import.html --> | |||
<module name="AvoidStarImport"> | |||
<property name="allowStaticMemberImports" value="true"/> | |||
<property name="allowStaticMemberImports" value="true"/> |
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.
there is a space.
@@ -5,7 +5,11 @@ | |||
import java.util.Map; | |||
import java.util.stream.Collectors; | |||
|
|||
import static io.odpf.firehose.sink.prometheus.PromSinkConstants.*; |
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.
there should not be any change in these files
641b46c
to
ae6038b
Compare
c6a95ee
to
40f1c67
Compare
No description provided.