Git Product home page Git Product logo

Comments (5)

brett-bim avatar brett-bim commented on July 24, 2024 1

I've confirmed that the extension is running now in the container but logs are never sent to external exporters. Logging and x-ray work fine but my Honeycomb exporter does not send events. I'm sort of at a loss for how to debug this and welcome any insight.

#collector.yaml in the root directory
#Set an environemnt variable 'OPENTELEMETRY_COLLECTOR_CONFIG_FILE' to '/var/task/collector.yaml'

receivers:
  otlp:
    protocols:
      grpc:
      http:
exporters:
  logging:
    loglevel: debug
  awsxray:
  otlp:
    endpoint: api.honeycomb.io:443
    headers:
      "x-honeycomb-team": "someapikey"
      "x-honeycomb-dataset": "some-dataset"
#enables output for traces to xray
service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [otlp, logging, awsxray]

Dockerfile

FROM alpine:latest as layer-copy 

#ARG AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-"us-east-1"}
#ARG AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-""}
#ARG AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-""}
ENV AWS_DEFAULT_REGION=us-east-1
ENV AWS_ACCESS_KEY_ID=mykeyid
ENV AWS_SECRET_ACCESS_KEY=secret_access_key

RUN apk add aws-cli curl unzip

RUN mkdir -p /opt

RUN curl $(aws lambda get-layer-version-by-arn --arn arn:aws:lambda:\us-east-1:901920570463:layer:aws-otel-python38-ver-1-7-1:1 --query 'Content.Location' --output text) --output layer.zip
RUN unzip layer.zip -d /opt
RUN rm layer.zip

FROM public.ecr.aws/lambda/python:3.8 as application
RUN mkdir -p ${LAMBDA_TASK_ROOT}
WORKDIR ${LAMBDA_TASK_ROOT}

COPY hello_world/requirements.txt ${LAMBDA_TASK_ROOT}/requirements.txt
RUN pip3 install -r ${LAMBDA_TASK_ROOT}/requirements.txt

COPY hello_world/ ${LAMBDA_TASK_ROOT}/hello_world
COPY collector.yaml ${LAMBDA_TASK_ROOT}

WORKDIR /opt
COPY --from=layer-copy /opt .
EXPOSE 55680
EXPOSE 4317
EXPOSE 9464
EXPOSE 55681

CMD [ "hello_world.app.lambda_handler" ]

Lambda is built and deployed via SAM.

from aws-otel-lambda.

brett-bim avatar brett-bim commented on July 24, 2024

Is it possible that a role needs to be assigned to the lambda to allow the GRPC receiver to start up/connect? I haven't seen any thing confirming that but want to rule it out.

NOTE: I'm not trying to call any AWS services yet, just get the layer working inside a container to do basic logging.

from aws-otel-lambda.

brett-bim avatar brett-bim commented on July 24, 2024

Circling back on this, I've discovered that if the AWS_LAMBDA_EXEC_WRAPPER environment variable is set, the exhibited behavior is the timeout starting up the receiver. I deleted this env variable on a whim, leaving the OPENTELEMETRY_COLLECTOR_CONFIG_FILE env var intact and I now have logs being written.

However, I still do not have any events going to external exporters (Honeycomb specifically for some reason. I'm going to try and set up xray and see if the behavior is the same.

from aws-otel-lambda.

osiris43 avatar osiris43 commented on July 24, 2024

Turns out, I had a mistake in the value for AWS_LAMBDA_EXEC_WRAPPER. This was pointing to a non-existent location/script. Once I pointed this at /opt/otel-instrument, traces started flowing. Sorry for the trouble. You can close this issue.

from aws-otel-lambda.

anuraaga avatar anuraaga commented on July 24, 2024

Thanks for confirming @osiris43

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.