| 58 | |
| 59 | #[tokio::main] |
| 60 | async fn main() -> Result<(), Error> { |
| 61 | tracing::init_default_subscriber(); |
| 62 | |
| 63 | {% if logs -%} |
| 64 | let logs_processor = SharedService::new(service_fn(logs_extension)); |
| 65 | {% endif -%} |
| 66 | {% if telemetry -%} |
| 67 | let telemetry_processor = SharedService::new(service_fn(telemetry_extension)); |
| 68 | {% endif %} |
| 69 | Extension::new() |
| 70 | {%- if use_events %} |
| 71 | .with_events_processor(service_fn(events_extension)) |
| 72 | {%- endif -%} |
| 73 | {%- if logs %} |
| 74 | .with_logs_processor(logs_processor) |
| 75 | {%- endif -%} |
| 76 | {%- if telemetry %} |
| 77 | .with_telemetry_processor(telemetry_processor) |
| 78 | {%- endif %} |
| 79 | .run() |
| 80 | .await |
| 81 | } |