-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for the OpenTelemetry Logging Pipeline #76
Comments
Ah Okay so I now understand that I'd love to see a discussion on how the logging pipeline could be implemented. |
tracing-log
For any future people looking for the answer, opentelemetry-appender-tracing is the solution. I'm not sure why it's confusingly in a separate crate, but there it is. |
The aspect of the implementation of tracing to open telemetry is so weird, omg!!! I'm really frustating with this, we can blow the entire thing and start a new good integration. |
Yeah it's all still really fresh. People are making progress though, albeit a little slower than I'd hoped. It's a big project and hard to get right. |
Does using opentelemetry-appender-tracing conflict in any way with this library? |
FWIW, after reading this I decided to just try it and at least in Jaeger logs are shipped as is: fn configure_telemetry_otel(env: Environment, endpoint: &Url) -> Result<()> {
let export_config = || ExportConfig {
endpoint: endpoint.as_str().to_string(),
timeout: Duration::from_secs(5),
protocol: Protocol::Grpc,
};
let resources_config = || {
Resource::new(vec![
// https://opentelemetry.io/docs/specs/semconv/resource/
KeyValue::new("service.name", APP_NAME),
KeyValue::new("service.version", APP_VERSION),
KeyValue::new("deployment.environment", env.to_string()),
])
};
let tracer = opentelemetry_otlp::new_pipeline()
.tracing()
.with_exporter(
opentelemetry_otlp::new_exporter()
.tonic()
.with_export_config(export_config()),
)
.with_trace_config(
opentelemetry_sdk::trace::config()
.with_sampler(Sampler::AlwaysOn)
.with_id_generator(RandomIdGenerator::default())
.with_resource(resources_config()),
)
.install_batch(opentelemetry_sdk::runtime::Tokio)
.context("install otel tracer")?;
let metric = opentelemetry_otlp::new_pipeline()
.metrics(opentelemetry_sdk::runtime::Tokio)
.with_exporter(
opentelemetry_otlp::new_exporter()
.tonic()
.with_export_config(export_config()),
)
.with_resource(resources_config())
.with_period(Duration::from_secs(5))
.with_timeout(Duration::from_secs(10))
.with_aggregation_selector(DefaultAggregationSelector::new())
.with_temporality_selector(DefaultTemporalitySelector::new())
.build()
.context("install otel metrics collector")?;
let bridge_tracing = tracing_opentelemetry::layer().with_tracer(tracer);
let bridge_metrics = tracing_opentelemetry::MetricsLayer::new(metric);
tracing_subscriber::registry()
.with(LevelFilter::INFO)
// Export to the otel trace bridge
.with(bridge_tracing)
// Export to the otel metrics bridge
.with(bridge_metrics)
// Collect traces to report with errors
.with(tracing_error::ErrorLayer::default())
// Collect traces to export to the terminal
.with(
tracing_subscriber::fmt::layer()
.pretty()
.with_file(false)
.with_line_number(false),
)
.try_init()
.context("configure local tracing subscriber")
} |
I've tried this too, and the situation is as follows:
|
How does this crate interact, if at all, with the Log Pipeline.
Any info would be of great help for me, and likely also in
README
.Thanks!
The text was updated successfully, but these errors were encountered: