Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Feature Idea: Tracking .NET applications running on Mono/Docker

tag

#1

We are currently experimenting with moving some of our .NET applications (Web API and background services) into Docker, where they will run on top of Mono. Your documentation states that your .NET agent does not support Mono, and this is sad to us, since we really like the insights that NewRelic gives us. Therefore:

  1. With the general shift towards Linux, Mono, open-source from Microsoft’s side, are you guys looking into Mono, and do you think you will be able to support it in the future?

  2. Is it only the automatic instrumentation which is unavailable on Mono, due to the lack of the Profiling API? In other words: would we be able to collect at least some data by doing manual instrumentation, or is this also impossible?

  3. What do you think about workarounds such as the one by Thomas V James, shown as one of the first results for “mono newrelic” on Google (it seems I am not allowed to post a link here)?

  4. Will your (currently in beta?) Docker instrumentation be able to identify and monitor key transactions such as HTTP requests to a Web API hosted in a container?

Feel free to answer my questions one by one if some of them are easier than other.

And thanks in advance :slight_smile:


New Relic edit

  • I want this, too
  • I have more info to share (reply below)
  • I have a solution for this

0 voters

We take feature ideas seriously and our product managers review every one when plotting their roadmaps. However, there is no guarantee this feature will be implemented. This post ensures the idea is put on the table and discussed though. So please vote and share your extra details with our team.


#2

Hey @schourode

We are always looking at new and emergent technologies to provide our customers with a high quality monitoring solution that suits their needs. I’m not certain about any progress we have made in that area however I will look into it.

The method in which Thomas James used seems OK. Ultimately, we do not support Mono because we have not extensively tested against it and cannot assist with any pitfalls or lack of instrumentation you may notice. Go ahead and give it a try. If it works for you great, and if not just know that we are always trying to improve. Sharing your results with us would be helpful for our development team as well as any other users who read this post.

Regarding our Docker instrumentation, applications which are installed in docker containers should behave much like applications installed in any other server. In your situation, an application running on Mono installed directly to a server instead of a container should behave for the most part identically. The issue would be the agents behavior in Mono.

I will look into this further on your behalf.


#3

It seems that your .NET Agent has changed quite a lot since Thomas James was experimenting with getting it running on Mono. As of yet, I have been able to get only an application name to show up in the APM interface.

What I have done:

  1. Extract NewRelicDotNetAgent_x64.msi.
  2. Reference NewRelic.Agent.Core assembly in application.
  3. Copy newrelic.config into project and add license key.
  4. Calling Agent.Instance.Connect() makes my application and machine show up in APM.
  5. Calling any method on AgentApi does nothing :unamused:

I have tried a ton of different things, attempting to determine where the ball is being dropped, but the Agent is a very opaque black box, and does not really allow me to see what is going on.

Any obvious steps I have missed? Does the agent need to run as some kind of background service, or should the mere presence of the assembly and its configuration be sufficient?


#4

@schourode - I know the agent internals have changed a lot since Thomas’s post so his technique may no longer work. You might try his ideas with agent version 2.8 which can be downloaded here. Note the config file was named newrelic.xml in that version.


#5

Thanks for getting back to me on this. I have now repeated my experiments with version 2.8 of the .NET agent, but I am stilling getting the same results. My machine appears in the APM when the application is running, but I have not been able to push any actual data using the AgentApi.

Thomas is using a HTTP Module to collect transaction data, and this is slightly different from what I am doing. My application is a console application (specifically a OWIN hosted ASP.NET app), so I am trying to do the instrumentation manually.

Am I wrong in expecting that the following lines should push data to the APM?

AgentApi.SetTransactionName("Custom", "/health-check");
AgentApi.RecordResponseTimeMetric("DoIt2", 42);

#6

@schourode

SetTransactionName only works in the context of an ongoing transaction and console applications have no concept of transactions so that call won’t work.

The data sent by RecordResponseTimeMetric can only viewed in a custom dashboard so you might look to see if the metric can be viewed there.


#7

Thanks for clearing this out. It would explain the lack of data I have been
experiencing.

If my application does indeed have a concept of transactions, can I tell
the API this somehow? That was what I was hoping to be able to do with
SetTransactionName.


#8

@schourode - The agent does include a “tracer factory” for creating custom transactions in non web (or even web contexts). But this won’t work under mono because of it’s lack of a profiler API we can use. There is not an API call for signaling the begin and end of a transaction.


#9

@schourode Did you ever make any more progress on this? My team is running ServiceStack APIs in docker containers and we would also like to use the .Net Agent.


#10

Unfortunately, no. After throwing several days of experimenting after this I gave up :unamused:

We will be moving forward with our transition to Docker and Mono without NewRelic monitoring/profiling. Hopefully NewRelic will catch up soon, or we will have to look into alternatives.

Related: the Profiling API is being implemented in Core CLR. See issue #445 on Github dotnet/coreclr. (I am still not allowed to post a link in this discussion board.)


#11

I’m interested if there has been any more progress on this front. With MS recent open source and linux for deployment strategies, I was hoping that NewRelic would be jumping on board.

We have a C#/.Net app we’re going to be deploying on mono/docker and would love to use NewRelic to monitor it.


#12

Hi @kwerle,

Thanks for sharing your experience, as you know we don’t support this at the moment https://docs.newrelic.com/docs/agents/net-agent/getting-started/compatibility-requirements-net-agent#app-frameworks

I’ve gone ahead and submitted a feature request on your behalf to our product managers.


#13

Is there any way that I can add a vote for this feature? I am currently running mono on aws and would love to get insights into our application.


#14

Consider it done! Feel free to vote in the poll at the top of this post, @rich.wandell! :blush: