Skip to content
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

Messages not being sent to/received by Azure Insights #42

Open
kf6kjg opened this issue Apr 5, 2021 · 13 comments
Open

Messages not being sent to/received by Azure Insights #42

kf6kjg opened this issue Apr 5, 2021 · 13 comments
Labels
wontfix This will not be worked on

Comments

@kf6kjg
Copy link

kf6kjg commented Apr 5, 2021

🐛 Bug Report

The messages sent to Applications Insights do not appear to be being received.

To Reproduce

Steps to reproduce the behavior:

$ echo '{"level":50,"time":1617656797803,"pid":82,"hostname":"fd712adddba1","msg":"Test at level 50."}' | npx pino-applicationinsights --key REDACTED
logging

The REDACTED value in the above comes from the Application Insights Instrumentation Key line, the location of which on the Azure Portal interface is highlighted in green here:
image

Open an additional terminal and run the following

az login
az monitor app-insights query --app REDACTED --analytics-query 'traces'

The REDACTED value here is the Application ID located under the API Access sidebar.

Alternatively, use the Logs sidebar and query for traces.

Expected behavior

The logger to send the log object to the Azure Insights service and then the latter to be able to show the resulting entry.

Your Environment

  • os: Linux: Alpine 3.11 via the node:14-alpine3.11 Docker image.
@kf6kjg
Copy link
Author

kf6kjg commented Apr 5, 2021

According to the Azure documentation it looks like the instrumentation keys are being phased out in favor of connection strings. It's possible that this is the source of the disconnect?

@gboston
Copy link

gboston commented Apr 27, 2021

@kf6kjg Any fix for this?

@kf6kjg
Copy link
Author

kf6kjg commented Apr 27, 2021

@kf6kjg Any fix for this?

None that I'm aware of at this time.

@stale
Copy link

stale bot commented Jun 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 30, 2021
@kf6kjg
Copy link
Author

kf6kjg commented Jul 1, 2021

AFAICT this is still a problem, though I've not tried reproducing it since I reported it.

@stale stale bot removed the wontfix This will not be worked on label Jul 1, 2021
@stale
Copy link

stale bot commented Sep 3, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 3, 2021
@devinrhode2
Copy link

devinrhode2 commented Feb 19, 2022

I recently got application insights logging working just fine, using next.js and next-logger, pino-ms, and pino-applicationinsights.

I am using the connection string in place of the instrumentation key. The MS docs don't make it very clear. But it seems anywhere you would use an instrumentation key ("iKey") you can use a connection string.

sainsburys-tech/next-logger#12

In next.config.js, if process.env.APPINSIGHTS_CONNECTIONSTRING is not defined, I recommend crashing so a build+deploy does not go through. Unfortunately, why that env var would not come through is an azure issue, has nothing to do with pino-applicationinsights. But if you have that issue, I'm not opposed to comparing your pipeline file to ours.

@stale stale bot removed the wontfix This will not be worked on label Feb 19, 2022
@devinrhode2
Copy link

As I've had this working, I recommend closing the issue. Maybe the issue was solved by some other related dependency, maybe INSTRUMENTATION_KEY just does not work anymore, idk.

@kf6kjg
Copy link
Author

kf6kjg commented Feb 20, 2022

If that be the case, then maybe a documentation update is all that is needful.

@devinrhode2
Copy link

I seem to have been mistaken in my previous analysis. In azure portal under "Diagnose and Solve Problems" it shows "Application Logs" (stdout) from my node server, without any of my logging code.

@kf6kjg
Copy link
Author

kf6kjg commented Mar 4, 2022 via email

@devinrhode2
Copy link

Yeah I noticed when ApplicationInsights setup code runs, there isn't anything printed to stdout except this:

ApplicationInsights:An invalid instrumentation key was provided. There may be resulting telemetry loss [ 'asdf' ]

@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants