mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-12-04 14:21:50 +00:00
refactor: Delegate otlp_protocol to standard OTLP env variables
This commit is contained in:
6 files changed
+20
-64
No files matched your search
+4
-9
@@ -56,16 +56,11 @@ pub(crate) fn init(
|
||||
|
||||
#[cfg(feature = "otlp_telemetry")]
|
||||
if config.allow_otlp_metrics {
|
||||
use opentelemetry_otlp::{MetricExporter, Protocol, WithExportConfig};
|
||||
use opentelemetry_otlp::MetricExporter;
|
||||
|
||||
let exporter = match config.otlp_protocol.as_str() {
|
||||
| "grpc" => MetricExporter::builder()
|
||||
.with_tonic()
|
||||
.with_protocol(Protocol::Grpc)
|
||||
.build(),
|
||||
| _ => MetricExporter::builder().with_http().build(),
|
||||
}
|
||||
.map_err(|e| err!(Config("allow_otlp_metrics", "{e}")))?;
|
||||
let exporter = MetricExporter::builder()
|
||||
.build()
|
||||
.map_err(|e| err!(Config("allow_otlp_metrics", "{e}")))?;
|
||||
|
||||
builder = builder.with_periodic_exporter(exporter);
|
||||
readers = true;
|
||||
|
||||
Reference in new issue
Block a user