Under the general trend of cloud-native, more and more developers have adopted container and serverless technologies when creating and deploying applications. New Relic is always paying attention to the evolution of cloud-native technology and the new challenges in the field of observability.
Traditional servers, virtual machines, containers, serverless functions, and developers' operation and maintenance burdens are gradually reduced or eliminated. However, the demand for observable and observable insights continues to increase:
In order to facilitate the integration of the third-party APM platform such as NewRelic, FC released Lifecycle Capability which allows APM agent to better monitor Serverless applications.
Next we introduce how to integrate NewRelic in FC, follow our steps and you will get your own serverless observability dashboard.
An easy and simple way to install Funcraft is to download the executable binary files.
fun --versionto check whether the installation is successful.
fun configto configure Funcraft. Then configure Account ID, Access Key ID, Access Key Secret, and Default region name as prompted.
$ fun config Aliyun Account ID 1234xxx Aliyun Access Key ID xxxx Aliyun Access Key Secret xxxx Default region name cn-xxxx The timeout in seconds for each SDK client invoking 300 The maximum number of retries for each SDK client 5 Allow to anonynously report usage statistics to improve the tool over time? (Y/n)
Run the following command to clone the sample project to your local machine.
git clone https://github.com/awesome-fc/fc-newrelic-demo.git
Run the following command to access the cloned sample project:
Replace licence key in template.yml with your own license key
EnvironmentVariables: NEW_RELIC_LICENSE_KEY: your-license-key
Run the following command to deploy the function:
The following result is returned:
➜ newrelic make deploy docker build -t fc-go-runtime -f build-image/Dockerfile build-image Sending build context to Docker daemon 2.048kB Step 1/5 : FROM golang:1.12.16-stretch ---> 7ad03a8aece5 Step 2/5 : RUN mkdir -p $GOPATH/src/golang.org/x/ ---> Using cache ---> 5678ac31beda Step 3/5 : RUN cd $GOPATH/src/golang.org/x/ && git clone https://github.com/golang/net.git ---> Using cache ---> 77d355f1730b Step 4/5 : RUN cd $GOPATH/src/golang.org/x/ && git clone https://github.com/golang/sys.git ---> Using cache ---> 414d3e786a8e Step 5/5 : RUN go get github.com/newrelic/go-agent ---> Using cache ---> 5c983a67a451 Successfully built 5c983a67a451 Successfully tagged fc-go-runtime:latest docker run --rm -it -v $(pwd):/tmp fc-go-runtime bash -c "go build -o /tmp/code//bootstrap /tmp/code/main.go" chmod +x code/bootstrap fun deploy -y using template: template.yml using region: cn-shenzhen using accountId: ***********3743 using accessKeyId: ***********Ts6J using timeout: 20 Collecting your services information, in order to caculate devlopment changes... Resources Changes(Beta version! Only FC resources changes will be displayed): ┌─────────────────────┬──────────────────────────────┬────────┬──────────┐ │ Resource │ ResourceType │ Action │ Property │ ├─────────────────────┼──────────────────────────────┼────────┼──────────┤ │ newrelic-integration │ Aliyun::Serverless::Function │ Modify │ CodeUri │ └─────────────────────┴──────────────────────────────┴────────┴──────────┘ Waiting for service fc-integrate-with-third-apm to be deployed... make sure role 'aliyunfcgeneratedrole-cn-shenzhen-xxx' is exist role 'aliyunfcgeneratedrole-cn-shenzhen-xxx' is already exist Waiting for function newrelic-integration to be deployed... Waiting for packaging function newrelic-integration code... The function newrelic-integration has been packaged. A total of 2 files were compressed and the final size was 4.16 MB function newrelic-integration deploy success service xxx deploy success
Application has been deployed successfully, and your function can be monitored by newrelic.
The application template has time trigger by dafault, it is triggerd every minite, and you can view a default dashboard with 1tps invocation.
You can also invoke function by
fun invoke command or API calls.
Alibaba Cloud Serverless - December 17, 2020
Alibaba Clouder - April 29, 2021
Alibaba Clouder - May 17, 2019
DavidZhang - January 15, 2021
Alibaba Developer - July 13, 2021
Aliware - July 22, 2021
Alibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.Learn More
An online computing service that offers elastic and secure virtual cloud servers to cater all your cloud hosting needs.Learn More
Visualization, O&M-free orchestration, and Coordination of Stateful Application ScenariosLearn More
Alibaba Cloud Container Service for Kubernetes is a fully managed cloud container management service that supports native Kubernetes and integrates with other Alibaba Cloud products.Learn More
More Posts by Alibaba Cloud Serverless