We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
newrelic cannot be used with AWS Lambda with the following configuration
newrelic is available and information can be referenced on APM
Sample: doesn't work
package main import ( "fmt" "log" "net/http" "os" "github.com/newrelic/go-agent/v3/integrations/logcontext-v2/logWriter" "github.com/newrelic/go-agent/v3/newrelic" ) var app *newrelic.Application var writer logWriter.LogWriter var logger *log.Logger func usersHandler(rw http.ResponseWriter, req *http.Request) { txn := app.StartTransaction("usersHandler") defer txn.End() fmt.Fprintf(rw, "Hello, World") logger.Printf("receive hello world request") } func main() { app, _ = newrelic.NewApplication( newrelic.ConfigAppName("newrelic-sample"), newrelic.ConfigLicense("mykey"), newrelic.ConfigAppLogForwardingEnabled(true), ) writer = logWriter.New(os.Stdout, app) logger = log.New(&writer, "", log.Default().Flags()) logger.Printf("cold start") http.HandleFunc(newrelic.WrapHandleFunc(app, "/", usersHandler)) http.ListenAndServe(":8000", nil) }
# build FROM golang:1.21 as build WORKDIR /helloworld COPY go.mod go.sum ./ COPY main.go . RUN GOOS=linux CGO_ENABLED=0 go build -o main main.go # Copy artifacts to a clean image FROM alpine:3.9 COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter COPY --from=build /helloworld/main /main ENV PORT=8000 EXPOSE 8000 ENTRYPOINT [ "/main" ]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
newrelic cannot be used with AWS Lambda with the following configuration
Desired Behaviour
newrelic is available and information can be referenced on APM
Possible Solution
A library will be created to work with AWS Lambda Web Adapter like nrlambda
Documents related to settings for operation using the newrelic.NewApplication method will be published.
Additional context
Sample: doesn't work
The text was updated successfully, but these errors were encountered: