Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

feat: Add support for BYO tracing_subscriber #779

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

justinabrahms
Copy link
Contributor

Allows exfiltration of instrumentation from noosphere into handy places like otel syncs like:

    let tracer = opentelemetry_otlp::new_pipeline()
        .tracing()
        .with_trace_config(
            trace::config().with_resource(Resource::new(vec![KeyValue::new(
                "service.name",
                "my service",
            )])),
        )
        .with_exporter(opentelemetry_otlp::new_exporter().tonic())
        .install_batch(opentelemetry_sdk::runtime::Tokio)?;

    let otel = tracing_opentelemetry::layer().with_tracer(tracer);

    initialize_tracing_with_layer(None, "multi-tenant gateway", otel);

@justinabrahms justinabrahms requested a review from jsantell January 9, 2024 21:58
@cdata
Copy link
Collaborator

cdata commented Jan 9, 2024

This looks like a good step in the right direction, although I still think we want a pattern where Noosphere-specific tracing behavior is encapsulated as its own Layer, and configuration of the Subscriber happens outside of this code.

Copy link
Contributor

github-actions bot commented Jan 9, 2024

Test flake analysis

status platform features toolchain
🟢 macos-13 test-kubo,headers,rocksdb stable
🟢 windows-latest test-kubo,headers stable
🟡 macos-13 test-kubo,headers stable
🟢 ubuntu-latest test-kubo,headers stable
🟢 ubuntu-latest test-kubo,headers,rocksdb stable
🟢 ubuntu-latest test-kubo,headers nightly

Flake summary for macos-13, test-kubo,headers, stable

     Summary [ 127.663s] 176 tests run: 176 passed (1 flaky), 1 skipped
   FLAKY 2/5 [  52.103s] noosphere::distributed_stress latency::clients_can_sync_when_there_is_a_lot_of_content

jsantell
jsantell previously approved these changes Jan 10, 2024
Copy link
Contributor

@jsantell jsantell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the wrangling of the multiple layer types, this is a nice & simple way of extending functionality. LGTM with lint passing!

@justinabrahms justinabrahms merged commit 0213b51 into main Jan 10, 2024
22 checks passed
@justinabrahms justinabrahms deleted the byo-tracing_subscriber branch January 10, 2024 18:50
@github-actions github-actions bot mentioned this pull request Jan 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants