-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
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
Bref New Relic Extension - Logs #389
Comments
Hi @tormodmacleod, I experimented with the Log Forwarder feature and it did work. However, the PHP Agent only supports this when you use Monolog, see https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-php/#automatic-logs-in-context FYI: |
thanks for getting back to me @starred-gijs we've installed monolog and newrelic log enricher. we were having no luck getting this to work in lambda so we running it in docker locally. we can see in wireguard that it's sending the logs to
|
Sorry to hear it's not working, that must be frustrating. You mention you switched to local docker for testing purposes. What is the local setup? Do you use the bref docker dev image? I dont have any experience with that one. I suggest to take 1 step at the time. You want to run this on lambda eventually, so start with that setup. Initially you mentioned APM worked, so that is a great first step. https://docs.newrelic.com/docs/logs/logs-context/configure-logs-context-php/ Deamon: newrelic.application_logging.enabled = true
newrelic.application_logging.metrics.enabled = true
newrelic.application_logging.forwarding.enabled = true
newrelic.application_logging.forwarding.log_level = info Cloudwatch newrelic.application_logging.enabled = false
newrelic.application_logging.forwarding.enabled = false Log some stuff and look into your cloudwatch log groups for newrelic added data like if all of this fails, contact NR support. |
@starred-gijs thanks very much for your help. it is now working beautifully 🤌 the problem had been that we'd installed the log enricher to your point about whether to use the daemon or cloudwatch to get the logs to new relic... i was thinking that the daemon would be easier in that i'm going to be configuring my functions to talk to the daemon anyway. so long as they can access the daemon for sending telemetry, they'll also be able to send the logs. however, on inspection, it appears that the agent send the logs directly to one other thing i'm interested in is how people typically deploy the daemon? i've currently got it deployed to ecs within the same vpc as my function and that works fine. however, i'd like to deploy it to ecs behind a load balancer and have all of my functions configured to connect to a single daemon. the idea being to have a single daemon deployment that i can scale rather than have to maintain a daemon per vpc. i'd also like to avoid having to deploy all of my functions within vpc's. i'm not sure whether you can load balance the traffic to more than one instance of the daemon. but even if i had to have a single instance of the daemon and scale it vertically i think this would still be better than having to maintain a daemon per project / aws account. i did have some initial success with putting the daemon behind an nlb but now i'm getting an error in cloudwatch
i'm using the dns name directly from ecs which is an A record with a 60 second ttl. i'm not sure why it would wait for the ttl to elapse before resolving the ip 🤷♂️ |
We choose cloudwatch for 2 reasons:
We run the official docker image in ECS within the same VPC as our other ECS containers and lambdas, and we directly connect on private IP address |
@starred-gijs i realised that my lambda was in a vpc subnet with no route to the internet 😞 since i corrected that it's working 🙂 i did notice that some invocations do not show up in the console. i see them established on the daemon
but no data shows up. it's usually the first interaction. ie if my lambda is invoked, i'll see it connect to the daemon but there'll be no logs or metrics in new relic. however, if i wait a couple of minutes and invoke the lambda again, these invocations will show up in new relic. i started playing about with
...this config should
however, no matter what i set
because subsequent invocations within ten minutes of the initial one are showing up in new relic i'm making the assumption that this i should add that i am very grateful for all of the help that you've given me so far and am at the stage where i've got something working and am not too concerned about missing telemetry for the odd invocation here and there. i suspect i've probably not quite got my settings right somewhere but i thought i'd post here anyway in case it was obvious to you. |
Good to hear you got it working! Im not sure what the exact settings should be to fix those timeouts, we run the lamdbas at a higher volume, so those timeouts do not happen. |
Hello
I'm experimenting with the Bref New Relic Extension. So far it's going pretty well. I can see metrics, events and traces in the New Relic console. However, I don't see any logs. I've configured
php/conf.d/newrelic-settings.ini
as belowAs you can see, I've tried to maximise my chances of getting logs through to New Relic. In
index.php
my colleague has addedWe can see this in the Cloudwatch logs
But I don't see any logs for my service in New Relic APM. I've tried looking within the New Relic Logs feature in case they're somehow not linked to the service. I've been unable to find them. Although that may be because I'm not really sure how to query for them.
It did occur to me that perhaps the extension doesn't handle logs. Or maybe I've just mis-configured something somewhere. I'd be very grateful for some advice
The text was updated successfully, but these errors were encountered: