|
21 | 21 | export_traces/4,
|
22 | 22 | export_metrics/4,
|
23 | 23 | export_logs/4,
|
| 24 | + export_traces/3, |
| 25 | + export_metrics/3, |
| 26 | + export_logs/3, |
24 | 27 | shutdown/1,
|
25 | 28 | report_cb/1]).
|
26 | 29 |
|
27 |
| -%% Do any initialization of the exporter here and return configuration |
28 |
| -%% that will be passed along with a list of spans to the `export' function. |
| 30 | +%% Kept only for backwards compatibility. Look at `otel_exporter_traces', `otel_exporter_metrics' |
| 31 | +%% and `otel_exporter_logs' instead. |
29 | 32 | -callback init(term()) -> {ok, term()} | ignore.
|
30 | 33 |
|
31 |
| -%% This function is called when the configured interval expires with any |
32 |
| -%% spans that have been collected so far and the configuration returned in `init'. |
33 |
| -%% Do whatever needs to be done to export each span here, the caller will block |
34 |
| -%% until it returns. |
35 |
| --callback export(traces | metrics, ets:tab(), otel_resource:t(), term()) -> ok | |
36 |
| - success | |
37 |
| - failed_not_retryable | |
38 |
| - failed_retryable. |
| 34 | +%% Kept only for backwards compatibility. Look at `otel_exporter_traces', `otel_exporter_metrics' |
| 35 | +%% and `otel_exporter_logs' instead. |
| 36 | +-callback export(traces | logs | metrics, ets:tab(), otel_resource:t(), term()) -> ok | |
| 37 | + success | |
| 38 | + failed_not_retryable | |
| 39 | + failed_retryable. |
| 40 | + |
| 41 | +%% Kept only for backwards compatibility. Look at `otel_exporter_traces', `otel_exporter_metrics' |
| 42 | +%% and `otel_exporter_logs' instead.failed_retryable. |
39 | 43 | -callback shutdown(term()) -> ok.
|
40 | 44 |
|
41 | 45 | -include_lib("kernel/include/logger.hrl").
|
@@ -116,6 +120,17 @@ init(Exporter) when Exporter =:= none ; Exporter =:= undefined ->
|
116 | 120 | init(ExporterModule) when is_atom(ExporterModule) ->
|
117 | 121 | init({ExporterModule, []}).
|
118 | 122 |
|
| 123 | +export_traces({ExporterModule, Config}, SpansTid, Resource) -> |
| 124 | + ExporterModule:export(traces, SpansTid, Resource, Config). |
| 125 | + |
| 126 | +export_metrics({ExporterModule, Config}, MetricsTid, Resource) -> |
| 127 | + ExporterModule:export(metrics, MetricsTid, Resource, Config). |
| 128 | + |
| 129 | +export_logs({ExporterModule, Config}, Batch, Resource) -> |
| 130 | + ExporterModule:export(logs, Batch, Resource, Config). |
| 131 | + |
| 132 | +%% below export_* functions are for backwards compatibility |
| 133 | + |
119 | 134 | export_traces(ExporterModule, SpansTid, Resource, Config) ->
|
120 | 135 | ExporterModule:export(traces, SpansTid, Resource, Config).
|
121 | 136 |
|
|
0 commit comments