2020-05-27 19:11:04 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <common/types.h>
|
|
|
|
#include <Common/StackTrace.h>
|
|
|
|
|
2020-05-27 20:15:33 +00:00
|
|
|
#include <Poco/Util/LayeredConfiguration.h>
|
|
|
|
|
2020-05-27 19:11:04 +00:00
|
|
|
#include <string>
|
|
|
|
|
2020-06-16 12:56:28 +00:00
|
|
|
/// \brief Sends crash reports to ClickHouse core developer team via https://sentry.io
|
|
|
|
///
|
|
|
|
/// This feature can enabled with "send_crash_reports.enabled" server setting,
|
|
|
|
/// in this case reports are sent only for official ClickHouse builds.
|
|
|
|
///
|
|
|
|
/// It is possible to send those reports to your own sentry account or account of consulting company you hired
|
|
|
|
/// by overriding "send_crash_reports.endpoint" setting. "send_crash_reports.debug" setting will allow to do that for
|
2020-05-27 19:11:04 +00:00
|
|
|
class SentryWriter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SentryWriter() = delete;
|
|
|
|
|
2020-05-27 20:15:33 +00:00
|
|
|
static void initialize(Poco::Util::LayeredConfiguration & config);
|
2020-05-27 19:11:04 +00:00
|
|
|
static void shutdown();
|
2020-06-16 12:56:28 +00:00
|
|
|
|
|
|
|
/// Not signal safe and can't be called from a signal handler
|
2020-05-27 19:11:04 +00:00
|
|
|
static void onFault(
|
|
|
|
int sig,
|
|
|
|
const siginfo_t & info,
|
|
|
|
const ucontext_t & context,
|
2020-06-23 21:27:04 +00:00
|
|
|
const StackTrace & stack_trace,
|
|
|
|
const String & build_id_hex
|
2020-05-27 19:11:04 +00:00
|
|
|
);
|
|
|
|
};
|