-
Notifications
You must be signed in to change notification settings - Fork 8k
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
feature: add metric exporter interface #3416
base: 1.8
Are you sure you want to change the base?
Conversation
try { | ||
instance = SpiLoader.of(MetricExporter.class).loadFirstInstance(); | ||
} catch (Throwable t) { | ||
// ignore |
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 would be better to log the exception using RecordLog.
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.
done
try { | ||
metricWriter.write(entry.getKey(), entry.getValue()); | ||
} catch (Exception e) { | ||
RecordLog.warn("[MetricTimerListener] Write metric error", e); |
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.
MetricTimerListener -> DefaultExporter
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.
done
static { | ||
MetricExporter instance = null; | ||
try { | ||
instance = SpiLoader.of(MetricExporter.class).loadFirstInstance(); |
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 may need to discuss whether it's more suitable to get the first implementation or to obtain a list to support multiple exporters.
We may need to discuss whether we should support having multiple exporters active at the same time. I'm not sure about your perspective on this. |
I keep one leave is order to sync the old logic, to be honest, i agree with you that support multiple exporters here. Do i keep more exporters active this pr? |
Describe what this PR does / why we need it
#3314
Does this pull request fix one issue?
Describe how you did it
Describe how to verify it
Special notes for reviews