Git Product home page Git Product logo

Comments (3)

anuraaga avatar anuraaga commented on July 24, 2024 1

Hi @cw-kajiwara - ADOT doesn't currently support rust, but it supports Go applications using a custom runtime - essentially the lambda layer only contains a telemetry collector but the app needs to have instrumentation built in due to the lack of auto instrumentation. This will be the same for Rust.

The docs for ADOT Lambda Go and OpenTelemetry rust may be able to get you started.
https://aws-otel.github.io/docs/getting-started/lambda/lambda-go#lambda-layer
https://docs.rs/opentelemetry/latest/opentelemetry/

from aws-otel-lambda.

cw-kajiwara avatar cw-kajiwara commented on July 24, 2024

Hi @anuraaga. Thank you very much for your guidance!

As you taught me, adding aws-otel-collector-amd64-ver-0-43-1:1 to my lambda function worked for me!
I saw the spans sent from my application appeared in log 👍

from aws-otel-lambda.

ymwjbxxq avatar ymwjbxxq commented on July 24, 2024

Hello all,

I tried using the "aws-otel-collector-arm64-ver-0-56-0"
I can see my spans in CloudWatch but I am pretty sure I miss something because I don't see any span in x-ray

fn init_tracer() -> sdkTracer {
    global::set_text_map_propagator(XrayPropagator::

    // Install stdout exporter pipeline to be able to retrieve the e collected spans.
    // For the demonstration, use `Sampler::AlwaysOn` sampler to sample all traces. In a production
    // application, use `Sampler::ParentBased` or `Sampler::TraceIdRatioBased` with a desired ratio.
    stdout::new_pipeline()
        .with_trace_config(
            config()
                .with_sampler(Sampler::AlwaysOn)
                .with_id_generator(XrayIdGenerator::default()),
        )
        .install_simple()
}

#[tokio::main]
async fn main() -> Result<(), Error> {
    let tracer = init_tracer();
    
    tracing_subscriber::fmt()
        .with_ansi(false)
        .without_time()
        .with_max_level(tracing_subscriber::filter::LevelFilter::INFO)
        .init();

    let config = aws_config::load_from_env().await;
    let dynamodb_client = aws_sdk_dynamodb::Client::new(&config);

    // other stuff

    lambda_http::run(service_fn(|event: Request| {
      tracer.in_span("root", |cx| {
           my_handler(event, cx)
      })
    })).await?;
   
    global::shutdown_tracer_provider();
    Ok(())
}

pub async fn my_handler(event: Request, ctx: Context) -> Result<impl IntoResponse, Error> {
   ctx.span().add_event("calling dyanmodb", vec![]);
  //dynamodb query
  ctx.spaIt).add_event("doing something else", vec![]);
}

it is possible to see a working example that maybe instrument one of the aws services? (like DynamoDB).

from aws-otel-lambda.

Related Issues (20)

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.