Repository navigation
Conversation
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
|
Yeah, I did some work on the OTel factor stuff; however, I won't be able to spare the cycles to help out with this 😞. Maybe @calebschoepp can offer some insight? He and I worked on wasi-otel together. |
calebschoepp
left a comment
There was a problem hiding this comment.
Regarding testing I don't recall what we have in repo for tests around wasi-otel. If there is nothing then just ship it I guess.
One thing you could do is point an agent at the integration tests in https://github.com/bytecodealliance/opentelemetry-wasi and pin it to this version of Spin to confirm it still works.
| let (mut record, scope) = spin_world::wasi_otel::parse_wasi_log_record(data); | ||
| log_processor.emit(&mut record, &scope); | ||
| let (record, scope) = spin_world::wasi_otel::parse_wasi_log_record(data); | ||
| let log_processor = sdk_log_provider.logger_with_scope(scope); |
There was a problem hiding this comment.
| let log_processor = sdk_log_provider.logger_with_scope(scope); | |
| let logger = sdk_log_provider.logger_with_scope(scope); |
The logger is something that feeds into the log processor.
|
|
||
| // OTel is mad about our Arc. Dammit OTel | ||
| #[derive(Debug)] | ||
| struct DammitOTel(Arc<BatchLogProcessor<Tokio>>); |
There was a problem hiding this comment.
Nit: Not quite enough condemnation for my taste
| } | ||
|
|
||
| let sdk_logger_provider = self.log_processor.as_ref().map(|lp| { | ||
| let log_processor = DammitOTel(lp.clone()); |
There was a problem hiding this comment.
Could this just be done inline? If you purposely did this hear according to your stylistic sense that is fine too.
It looks like we should not be calling the LogProcessor directly, but instead interposing a SdkLogger. This is needed because OTel packs an absolutely massive tanty if a log doesn't have an observed timestamp, and SdkLogger adds one if it's missing. (You are correct. This is indeed suboptimal.)
Draft because:
cc @asteurer who I think is also familiar with the OTel factor, is that right Andrew?