Git Product home page Git Product logo

tracing-elastic-apm's People

Contributors

damianochini avatar dependabot[bot] avatar forgerpl avatar keeganmyers avatar krojew avatar ufoscout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tracing-elastic-apm's Issues

Error: relative URL without a base with example configuration

I am trying this library with the example code from readme.md file, anyway, it keeps printing this error at runtime:

ERROR tracing_elastic_apm::apm_client: Error sending batch to APM! error=builder error: relative URL without a base

My Code:

    let apm_layer = tracing_elastic_apm::new_layer(
        "ServiceName".to_string(),
        tracing_elastic_apm::config::Config::new("127.0.0.1:8200".to_string())
    );

    let subscriber = tracing_subscriber::registry()
        .with(apm_layer);

I am using version 2.1

Infinite loop?

Hey there,

seems like I'm to dump to configure the lib properly. For me it seems like there is an infinite loop as the ApmClient is sending a network request for closed spans and hyper is opening new spans for each network request. Is it only me observing this? I also would like to see in the readme an example which integrates with the formatter example from the tracing lib.

Here is my dump code

#[tracing::instrument]
pub async fn run_traced_test_task() {
    info!("Some task");
    thread::sleep(Duration::from_secs(10));
    info!("Another log");
}

#[tokio::main]
async fn main() {
    let apm_layer = tracing_elastic_apm::new_layer(
        "monitor-helper".to_string(),
        Config::new("http://127.0.0.1:8200".to_string()),
    )
    .expect("APM Layer to be created");

    tracing_subscriber::registry().with(apm_layer).init();

    info!("Started!");

    let handle = tokio::spawn(async {
        std::thread::sleep(Duration::from_secs(5));
        run_traced_test_task().await;
    });

    tokio::try_join!(handle).unwrap();

    std::thread::sleep(Duration::from_secs(5));
    info!("Goodbye");
}

Formatting Incorrect in apm

I am currently using layers in my subscriber from this crate and fmt::Layer::default(). But noticed that the transactions only show on elastic apm as "HTTP Request" rather than something like "POST /route", additionally there is no http meta data shown on the transaction. Do I need to add another layer to format the trace correctly for apm? If so, what layer should I be including?

Is there any way to update the name of the outer transaction span at the end of a request?

Using axum I have a very early middleware that attaches a span with a propegated request id from a header.

          let span = info_span!("request", %request_id);
          next.run(req).instrument(span).await

Since this is the first outermost span it becomes the Transaction for elastic APM, so it shows up as simply request in the UI for Elastic Observability.

From Elastic examples it seems usually these out transaction spans are annotated as HTTP 5xx POST /service/endpoint but much of that information is not known unitl after next.run(req).instrument(span).await has run.

Is there any way to update the transaction name?

I was about to try something like the following

            let span = info_span!("request", %request_id);
            let _enter = span.enter();
            let res = next.run(req).in_current_span().await;
            if let Some(id) = span.id() {
                let mut extensions = req.extensions_mut();
                if let Some(mut transaction) = extensions.get_mut::<tracing_elastic_apm::model::Transaction>() {
                    transaction.name= Some(.../*rest of logic here*/);
                }
            };
            res
 ``

but since Transaction is not `pub` outside the `tracing_elastic_apm` crate a gave up fairly quickly.
Any thoughts?

tracing-elastic-apm does not work without a global subscriber

The tracing-elastic-apm layer does nothing if used with a default subscriber. E.g.:

let stdout_layer = ...;
let another_layer = ...;
let another_another_layer = ...;

let tracing_elastic_apm_layer = tracing_elastic_apm::new_layer(
    "ServiceName".to_string(),
    tracing_elastic_apm::Config::new("APM address".to_string())
)?;

// The order of registration of the layers has no impact on this bug
    let subscriber = tracing_subscriber::registry()
        .with(stdout_layer)
        .with(another_layer)
        .with(another_another_layer)
        .with(tracing_elastic_apm_layer);

// Using a default subscriber all layers work as expected except 
// the tracing_elastic_apm_layer that does NOT work at all
let _guard = tracing::subscriber::set_default(subscriber);

// It works as expected if we use a global subscriber instead:
// tracing::subscriber::set_global_default(subscriber).unwrap()

Any idea why?

Errors in send_batch() will cause infinite errors to be logged

I accidentally messed up the destination URL when initializing my tracing_elastic_apm layer and my console was flooded with an infinite stream of logs:

Failed to create shared memory: Too many open files
Failed to create shared memory: Too many open files
2022-06-30T11:22:26.457546Z ERROR tracing_elastic_apm::apm_client: Error sending batch to APM! error=error sending request for url (http://localhost:9200/intake/v2/events): error trying to connect: tcp open error: Too many open files (os error 24)
2022-06-30T11:22:26.457532Z ERROR tracing_elastic_apm::apm_client: Error sending batch to APM! error=error sending request for url (http://localhost:9200/intake/v2/events): error trying to connect: tcp open error: Too many open files (os error 24)
Failed to create shared memory: Too many open files

After some digging, it appears that whenever ApmClient::send_batch() fails it will log the error... which in turn triggers another call to send_batch(), which also errors out, ad infinitum. This is the line responsible:

error!(error = %error, "Error sending batch to APM!");

Do we need to log errors that occurred when posting messages upstream, or would it be okay to fail silently?

I'm guessing the "Too many open files" part of the error message is just because we keep trying to connect to the same port and run out of file descriptors, so it's just a symptom of this infinite logging problem.

Random Mutex poisoned Error

Bug Report

Description

After upgrading to tracing-elastic-apm 3.2 we are experiencing random PoisonError:

thread 'main' panicked at 'Mutex poisoned: PoisonError { .. }', /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.2/src/registry/sharded.rs:433:58

As you can see below, the tracing-elastic-apm crate is in the full panic stacktrace (at line 19), so, it could be the cause of it.
We don't have this error when tracing-elastic-apm is not used.

Full error stack:

thread 'main' panicked at 'Mutex poisoned: PoisonError { .. }', /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.2/src/registry/sharded.rs:433:58
stack backtrace:
   0:     0x562e06d0e0ec - std::backtrace_rs::backtrace::libunwind::trace::h3fea1eb2e0ba2ac9
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
   1:     0x562e06d0e0ec - std::backtrace_rs::backtrace::trace_unsynchronized::h849d83492cbc0d59
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x562e06d0e0ec - std::sys_common::backtrace::_print_fmt::he3179d37290f23d3
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x562e06d0e0ec - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h140f6925cad14324
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:46:22
   4:     0x562e06d3642c - core::fmt::write::h31b9cd1bedd7ea38
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/fmt/mod.rs:1150:17
   5:     0x562e06d06455 - std::io::Write::write_fmt::h1fdf66f83f70913e
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/io/mod.rs:1667:15
   6:     0x562e06d10120 - std::sys_common::backtrace::_print::he7ac492cd19c3189
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:49:5
   7:     0x562e06d10120 - std::sys_common::backtrace::print::hba20f8920229d8e8
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:36:9
   8:     0x562e06d10120 - std::panicking::default_hook::{{closure}}::h714d63979ae18678
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:210:50
   9:     0x562e06d0fcd7 - std::panicking::default_hook::hf1afb64e69563ca8
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:227:9
  10:     0x562e06d107d4 - std::panicking::rust_panic_with_hook::h02231a501e274a13
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:624:17
  11:     0x562e06d102b0 - std::panicking::begin_panic_handler::{{closure}}::h5b5e738edf361af7
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:521:13
  12:     0x562e06d0e5b4 - std::sys_common::backtrace::__rust_end_short_backtrace::h601a115def7987b1
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:141:18
  13:     0x562e06d10219 - rust_begin_unwind
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5
  14:     0x562e04f56b31 - core::panicking::panic_fmt::h7a58c8fffc5559a4
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:101:14
  15:     0x562e04f56c23 - core::result::unwrap_failed::h1036b5c6eb8030dd
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/result.rs:1617:5
  16:     0x562e056c0cf3 - core::result::Result<T,E>::expect::h0ce9e6744269e6a1
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/result.rs:1259:23
  17:     0x562e056e5606 - <tracing_subscriber::registry::sharded::Data as tracing_subscriber::registry::SpanData>::extensions_mut::h4870693d8bfe011a
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.2/src/registry/sharded.rs:433:28
  18:     0x562e05641753 - tracing_subscriber::registry::SpanRef<R>::extensions_mut::ha3f890a315d68235
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.2/src/registry/mod.rs:496:9
  19:     0x562e0561c262 - <tracing_elastic_apm::layer::ApmLayer as tracing_subscriber::layer::Layer<S>>::on_exit::h63c2ea3cb6c653bd
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-elastic-apm-3.2.0/src/layer.rs:178:30
  20:     0x562e0563d3de - <my_app_common_logger::filter::FilteredLayer<S,L,F> as tracing_subscriber::layer::Layer<S>>::on_exit::h0ba0bda406dc5192
                               at /home/ufo/workspaces/wuerth_phoenix/bitbucket/my_app/common/logger/src/filter.rs:66:9
  21:     0x562e056111b7 - <tracing_subscriber::layer::layered::Layered<L,S> as tracing_core::subscriber::Subscriber>::exit::hcf3cd6cefac912c0
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.2/src/layer/layered.rs:126:9
  22:     0x562e06685e53 - <alloc::sync::Arc<dyn tracing_core::subscriber::Subscriber+core::marker::Send+core::marker::Sync> as tracing_core::subscriber::Subscriber>::exit::h7faed99e28bd9d0d
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-core-0.1.21/src/subscriber.rs:725:9
  23:     0x562e06685df3 - tracing_core::dispatcher::Dispatch::exit::h8c98dfbfc8461200
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-core-0.1.21/src/dispatcher.rs:541:9
  24:     0x562e0667044f - tracing::span::Span::do_exit::hd67c76fefff3714b
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-0.1.29/src/span.rs:1051:13
  25:     0x562e0666fd6d - <tracing::span::Entered as core::ops::drop::Drop>::drop::hdbb8d64da9ff7a74
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-0.1.29/src/span.rs:1561:9
  26:     0x562e066f491a - core::ptr::drop_in_place<tracing::span::Entered>::habb3e2bc37aff0ac
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ptr/mod.rs:188:1
  27:     0x562e0656551c - <tower::buffer::worker::Worker<T,Request> as core::future::future::Future>::poll::hfaad80d70b903a64
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tower-0.4.11/src/buffer/worker.rs:228:17
  28:     0x562e06444331 - tokio::runtime::task::core::CoreStage<T>::poll::{{closure}}::h18d9d908398675c6
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/core.rs:161:17
  29:     0x562e064815a9 - tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut::ha0e6c532f7650a25
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/loom/std/unsafe_cell.rs:14:9
  30:     0x562e06444138 - tokio::runtime::task::core::CoreStage<T>::poll::he1f729e00c0c00c7
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/core.rs:151:13
  31:     0x562e06569cbe - tokio::runtime::task::harness::poll_future::{{closure}}::h0450fbc1f9a027c9
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/harness.rs:461:19
  32:     0x562e0654c2d4 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h294ee385e323a242
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panic/unwind_safe.rs:271:9
  33:     0x562e06544f72 - std::panicking::try::do_call::h7e9142765e18dedd
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:403:40
  34:     0x562e06549b8b - __rust_try
  35:     0x562e0654031a - std::panicking::try::h5c00845ded0caa72
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:367:19
  36:     0x562e06496bbb - std::panic::catch_unwind::h4b94e6db9a27de38
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panic.rs:129:14
  37:     0x562e0656957c - tokio::runtime::task::harness::poll_future::hd06b8ab6bc1bb1bb
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/harness.rs:449:18
  38:     0x562e0656cc74 - tokio::runtime::task::harness::Harness<T,S>::poll_inner::hcd6da9ae6fa1f3a4
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/harness.rs:98:27
  39:     0x562e06579854 - tokio::runtime::task::harness::Harness<T,S>::poll::h5cba77c74ed204ba
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/harness.rs:53:15
  40:     0x562e063fe472 - tokio::runtime::task::raw::poll::h5c902ccf3d63c396
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/raw.rs:113:5
  41:     0x562e06abbcef - tokio::runtime::task::raw::RawTask::poll::h27802c2e8fe891ac
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/raw.rs:70:18
  42:     0x562e06a28b62 - tokio::runtime::task::LocalNotified<S>::run::h160741df12699d0c
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/task/mod.rs:343:9
  43:     0x562e052a418b - tokio::runtime::basic_scheduler::Inner<P>::block_on::{{closure}}::{{closure}}::hdc1ba347e036a682
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/basic_scheduler.rs:297:52
  44:     0x562e050af735 - tokio::coop::with_budget::{{closure}}::he024bbb9917280d7
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/coop.rs:106:9
  45:     0x562e04ffc8b3 - std::thread::local::LocalKey<T>::try_with::h4c3ebfd21fc2f05e
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/thread/local.rs:399:16
  46:     0x562e04ffb8d6 - std::thread::local::LocalKey<T>::with::h547f61f1feeaba0a
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/thread/local.rs:375:9
  47:     0x562e052a3d9f - tokio::coop::with_budget::h1b83192f2c324c72
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/coop.rs:99:5
  48:     0x562e052a3d9f - tokio::coop::budget::hb77aa344f75ba46d
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/coop.rs:76:5
  49:     0x562e052a3d9f - tokio::runtime::basic_scheduler::Inner<P>::block_on::{{closure}}::hdba09d4cccab0dea
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/basic_scheduler.rs:297:29
  50:     0x562e052a4bf1 - tokio::runtime::basic_scheduler::enter::{{closure}}::h94b7ba6385d09d99
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/basic_scheduler.rs:349:29
  51:     0x562e04f86f23 - tokio::macros::scoped_tls::ScopedKey<T>::set::heb6aa0ba53ac80c8
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/macros/scoped_tls.rs:61:9
  52:     0x562e052a4b45 - tokio::runtime::basic_scheduler::enter::he163431da3930bc9
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/basic_scheduler.rs:349:5
  53:     0x562e052a350d - tokio::runtime::basic_scheduler::Inner<P>::block_on::h8d9d567a0a5966b7
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/basic_scheduler.rs:230:9
  54:     0x562e052a42b6 - tokio::runtime::basic_scheduler::InnerGuard<P>::block_on::hc84bf88ddced6ead
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/basic_scheduler.rs:501:9
  55:     0x562e052a43c2 - tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on::h8d6de1af4ba9924d
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/basic_scheduler.rs:186:24
  56:     0x562e04f775e9 - tokio::runtime::Runtime::block_on::hcfaa97f52cb8b3a7
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/runtime/mod.rs:461:46
  57:     0x562e0512e0a3 - tokio::task::local::LocalSet::block_on::h1b6b5717f95e5a43
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.14.0/src/task/local.rs:466:9
  58:     0x562e05255c33 - actix_rt::runtime::Runtime::block_on::h4c06a00833e8760c
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-2.4.0/src/runtime.rs:80:9
  59:     0x562e05197650 - actix_rt::system::SystemRunner::block_on::h534225cea3e1abcc
                               at /home/ufo/.cargo/registry/src/github.com-1ecc6299db9ec823/actix-rt-2.4.0/src/system.rs:215:9
  60:     0x562e052b49f9 - my_app_engine::main::h65d0c8326e2f7ebd
                               at /home/ufo/workspaces/wuerth_phoenix/bitbucket/my_app/my_app/engine/src/main.rs:12:1
  61:     0x562e04fa14bb - core::ops::function::FnOnce::call_once::h99ede25baa77eac7
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:227:5
  62:     0x562e050b492e - std::sys_common::backtrace::__rust_begin_short_backtrace::h9d272d6c9bbb1748
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/sys_common/backtrace.rs:125:18
  63:     0x562e050719f1 - std::rt::lang_start::{{closure}}::h5804c1b2810cb633
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:63:18
  64:     0x562e06d10dda - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h2790017aba790142
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/ops/function.rs:259:13
  65:     0x562e06d10dda - std::panicking::try::do_call::hd5d0fbb7d2d2d85d
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:403:40
  66:     0x562e06d10dda - std::panicking::try::h675520ee37b0fdf7
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:367:19
  67:     0x562e06d10dda - std::panic::catch_unwind::h803430ea0284ce79
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panic.rs:129:14
  68:     0x562e06d10dda - std::rt::lang_start_internal::{{closure}}::h3a398a8154de3106
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:45:48
  69:     0x562e06d10dda - std::panicking::try::do_call::hf60f106700df94b2
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:403:40
  70:     0x562e06d10dda - std::panicking::try::hb2022d2bc87a9867
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:367:19
  71:     0x562e06d10dda - std::panic::catch_unwind::hbf801c9d61f0c2fb
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panic.rs:129:14
  72:     0x562e06d10dda - std::rt::lang_start_internal::hdd488b91dc742b96
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:45:20
  73:     0x562e050719c0 - std::rt::lang_start::h1a95014defcb13ce
                               at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/rt.rs:62:5
  74:     0x562e052b4a7c - main
  75:     0x7f368c1d5565 - __libc_start_main
  76:     0x562e04f57dce - _start
  77:                0x0 - <unknown>

Version

$ cargo tree | grep tracing
    │   │   │   └── tracing v0.1.29
    │   │   │       ├── tracing-attributes v0.1.18 (proc-macro)
    │   │   │       └── tracing-core v0.1.21
    │   │   ├── tracing v0.1.29 (*)
    ├── tracing v0.1.29 (*)
    ├── tracing-appender v0.2.0
    │   └── tracing-subscriber v0.3.2
    │       ├── tracing-core v0.1.21 (*)
    │       └── tracing-log v0.1.2
    │           └── tracing-core v0.1.21 (*)
    ├── tracing-elastic-apm v3.2.0
    │   ├── tracing v0.1.29 (*)
    │   ├── tracing-subscriber v0.3.2 (*)
    ├── tracing-futures v0.2.5
    │   └── tracing v0.1.29 (*)
    ├── tracing-log v0.1.2 (*)
    └── tracing-subscriber v0.3.2 (*)
├── tracing v0.1.29 (*)
└── tracing-futures v0.2.5 (*)
│   │   │   │   │   │   └── tracing v0.1.29 (*)
│   │   │   │   │   ├── tracing v0.1.29 (*)
│   │   │   │   │   └── tracing-futures v0.2.5 (*)
│   │   │   ├── tracing v0.1.29 (*)
│   │   │   ├── tracing v0.1.29 (*)
│   │   │   ├── tracing-futures v0.2.5 (*)
├── tracing v0.1.29 (*)
└── tracing-subscriber v0.3.2 (*)

Platform

$ uname -a
Linux ufo-lap-1 5.11.0-40-generic #44-Ubuntu SMP Wed Oct 20 16:16:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Authorization header for ApiKey authentication is wrongly formatted

Bug description

It is not possible to authenticate to the APM Server via ApiKey.

Details

The HTTP Authorization header for authenticating via ApiKey should be in the form:
Authorization: ApiKey <base64_encoded_credentials
see: Elastic documentation (I could not find APM Server specific doc for the ApiKey authentication).

Here instead the ApiKey identifier is also base64 encoded. So the authentication does not work.

base64::encode(format!("ApiKey {}:{}", key.id, key.key))

No event are reported except for `ERROR`

I tried to instrument my code and use this library. I was not able to make it works until I started looking directly into the code of the library and stumble on that line.

It happens that the code I was running was never reporting on ERROR level. I'm wondering why only ERROR events are reported and not the other type of Level. Or maybe I missed something else?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.