question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dotnet-Monitor returns Http 401 on endpoints other than /metrics

See original GitHub issue

Description

Currently Dotnet-Monitor is returning HTTP 401 Unauthorized for endpoints other than /metrics. We can’t find documentation either on what the value the Authorization header should be set, if that is a requirement.

The following endpoints are affected.

/processes
/dump/{pid?}
/gcdump/{pid?}
/trace/{pid?}
/logs/{pid?}

For example: Request:

GET /gcdump HTTP/1.1
Host: analytics.integration:52323
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Connection: keep-alive
Upgrade-Insecure-Requests: 1

Response:

HTTP/1.1 401 Unauthorized
Date: Tue, 02 Mar 2021 18:22:05 GMT
Server: Kestrel
Content-Length: 0

Configuration

The dotnet-monitor container configuration within AWS Fargate is as follows: Image: mcr.microsoft.com/dotnet/nightly/monitor:latest

Entry point ["dotnet-monitor","collect"]
Command ["--urls","http://*:52323","--metricUrls","http://*:52325"]

Regression?

Yes, this worked in a previous build or release

Other information

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
josalemcommented, Mar 2, 2021

We do not recommend turning off authentication in production environments, but if you want to entirely disable authentication, you can pass the --no-auth flag when dotnet-monitor starts.

1reaction
CraigHeadcommented, Mar 2, 2021

@josalem thank you for the new setting. We will work towards configuring authorization long-term and appreciate that input about production environments. We actually only keep the metrics urls enabled for Production, so the actual diagnostics stuff isn’t enabled for the time being (since this tool is still preview).

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet-monitor/documentation/api/metrics.md at main
NET Monitor - a tool that allows you to gather diagnostic data from running applications using HTTP endpoints - dotnet-monitor/documentation/api/metrics.md ...
Read more >
Introducing dotnet-monitor, an experimental tool - .NET Blog
dotnet -monitor is an experimental tool that makes it easier to get access to diagnostics information in a dotnet process.
Read more >
ASP.NET Web API : Correct way to return a 401 ...
On the client besides the 401 response you will have the passed data too. For example on most clients you can await response.json()...
Read more >
Troubleshoot Pub/Sub with the .NET SDK
Troubleshooting Pub/Sub. The most common problem with pub/sub is that the pub/sub endpoint in your application is not being called.
Read more >
Report Manager - Error 401 unauthorized when generating ...
The following error message appears when trying to generate a report within Report Manager: Error: The request failed with HTTP status 401: Unauthorized....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found