Logging metrics from within Elasticsearch ActionRequestFailureHandler

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Logging metrics from within Elasticsearch ActionRequestFailureHandler

Averell
Good day everyone,

I'm writing to Elasticsearch, and I need to count the number of records that
the process failed to write. The problem that I'm facing is there is no
RunningContext that I can access from within
o.a.f.s.c.elasticsearch.ActionRequestFailureHandler's onFailure method so
that I can trigger getMetricGroup method.

What can I do in this case?
I see one option in rewriting ElasticsearchSink/ElasticsearchSink.Builder,
to override ElasticsearchSinkBase.open() method. But it looks like too much
boilerplate code - the designer of ElasticsearchSink.Builder must have had
some better solution.

Thanks and best regards,
Averell





--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Logging metrics from within Elasticsearch ActionRequestFailureHandler

Dawid Wysakowicz-2
Hi Averell,

I am afraid this is currently not possible without modifying
ElasticsearchSink. Would you like to open jira ticket for metrics access
in the failureHandler?

Best,

Dawid


On 13/09/18 03:50, Averell wrote:

> Good day everyone,
>
> I'm writing to Elasticsearch, and I need to count the number of records that
> the process failed to write. The problem that I'm facing is there is no
> RunningContext that I can access from within
> o.a.f.s.c.elasticsearch.ActionRequestFailureHandler's onFailure method so
> that I can trigger getMetricGroup method.
>
> What can I do in this case?
> I see one option in rewriting ElasticsearchSink/ElasticsearchSink.Builder,
> to override ElasticsearchSinkBase.open() method. But it looks like too much
> boilerplate code - the designer of ElasticsearchSink.Builder must have had
> some better solution.
>
> Thanks and best regards,
> Averell
>
>
>
>
>
> --
> Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/


signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Logging metrics from within Elasticsearch ActionRequestFailureHandler

Averell
Thank you Dawid.
I will open a Jira Wish for this.

Regarding a solution for this, I have another question regarding the current
implementation of ElasticsearchSink classes. Why do we use the Builder
mechanism? Would that make it more inconvenient to solve issues like the one
I'm having?

Thanks and regards,
Averell



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/