Use our AWS FireLens integration is built on our Fluentbit output plugin to connect your FireLens monitored log data to New Relic. Read on to learn how to enable this feature.
Requirements
To forward logs to New Relic using FireLens, ensure your configuration meets the following requirements:
- New Relic Insert API key
- Amazon EC2 Container Service (ECS) cluster
Enable FireLens for log management
To enable log management with FireLens:
- Configure the FireLens log router container to run as a sidecar.
- Configure the Application container.
- Generate some traffic and wait a few minutes, then check your account for data.
Configure the FireLens log router container
New Relic uses a Fluent Bit image to configure the FireLens Log Router container. This container handles all log routing from application plugins.
To enable FireLens with Logs, you need to add a sidecar container to your pre-existing ECS task definition that will act as the Firelens log router. For help configuring ECS log routing, see Custom Log Routing, substituting the recommended images with the New Relic Fluentbit Output plugin image for your AWS region.
AWS Region | Full Image Name |
---|---|
us-east-1 |
|
us-east-2 |
|
us-west-1 |
|
us-west-2 |
|
ca-central-1 |
|
eu-central-1 |
|
eu-west-1 |
|
eu-west-2 |
|
eu-west-3 |
|
eu-north-1 |
|
For example:
{ "essential": true, // Image below is New Relic's fluentbit output plugin available on ECR "image": "533243300146.dkr.ecr.us-east-2.amazonaws.com/newrelic/logging-firelens-fluentbit", "name": "log_router", "firelensConfiguration": { "type": "fluentbit", "options": { "enable-ecs-log-metadata": "true" } }}
Note: EC2-type clusters will require setting the "memoryReservation" attribute for this container as well
Configure the application container
AWS Secrets Manager (recommended)
To prevent exposing your Insights Insert key in your task definition, we strongly recommend using the AWS Secrets Manager service.
When adding the secret, use the Plaintext tab. Once you've added the secret to the Secrets Manager, you can then reference it using the logConfiguration
block suggested below, replacing SECRET_NAME with the name of your AWS secret.
"logConfiguration": {
"logDriver":"awsfirelens",
"options": {
"Name": "newrelic"
},
"secretOptions": [{
"name": "apiKey",
"valueFrom": "arn:aws:secretsmanager:region:aws_account_id:secret:SECRET_NAME"
}]
}
Plaintext Key Configuration
During configuration, outlined in FireLens Task Definitions, use the logConfiguration
block suggested below, replacing INSERT_API_KEY with your New Relic Insert API key.
"logConfiguration": {
"logDriver":"awsfirelens",
"options": {
"Name": "newrelic",
"apiKey": "INSERT_API_KEY"
}
Example configuration
Sending logs to an EU New Relic account
If you want to send logs from Firelens to an EU account then you need to add an additional property to the options
field of the logConfiguration
object in your application containers.
"endpoint": "https://log-api.eu.newrelic.com/log/v1"
View log data
If everything is configured correctly and your data is being collected, you should see data logs in both of these places:
New Relic tools for running NRQL queries. For example, you can execute a query like this:
SELECT * FROM Log
What's next?
Now that you've enabled Logs, here are some potential next steps:
- Explore your data using the Logs UI.
- Configure your agent to see contextual log data, such as distributed tracing, stack traces, application logs, and more.
- Query your data and create custom dashboards or alerts.
If no data appears after you enable log management, follow the troubleshooting procedures.
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicのデータセキュリティとライセンスドキュメント をご確認ください。