Dotnet 6.0 log level setting

APM Agent language and version: dotnet, Elastic.Apm.NetCoreAll version 1.17.0

Browser version: N/A

Original install method (e.g. download page, yum, deb, from source, etc.) and version: N/A

Fresh install or upgraded from other version? N/A

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc. N/A

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

We are seeing many (around 10 per minute) log entries like this one for all the services which we enabled apm for and it is clogging our logs.
[12:45:53 INF] {Transaction} Dropping unsampled transaction - unsampled transactions won't be sent on APM Server v8+. TransactionId: 0f1c2e883beec7dc

First of all, why is it logged? What does it mean?

I tried changing the log level of the agent according to Supportability configuration options | APM .NET Agent Reference [1.12] | Elastic, tried out all 3 different ways and none of them worked. The logs are still there.

FYI, we are using serilog for our logs.

Steps to reproduce:

  1. Setup agent and use UseAllElasticApm() method.
  2. Try changing log level behaviour to get rid of unnecessary logs by modifying app settings and/or environment variables.
  3. See that the logs still persist.

Errors in browser console (if relevant): N/A

Provide logs and/or server output (if relevant): N/A

Hi @Simonjanzon,

To answer your first question:

First of all, why is it logged? What does it mean?

This message is an indication that you have a TransactionSampleRate configured for your monitored service.

In case a transaction is not sampled (i.e. it is not reported to APM server), a log message with severity Info is reported. That's what you are encountering.

Can you please check which LogLevel you are using in your service?

Also, which way of configuration are you using (environment variables, config file, ...)?

Thanks,
Wolgang

Hi @Wolfgang_Ziegler

Thanks for your reply.

We have tried setting the LogLevel in three different ways

  1. Environment variable: ELASTIC_APM_LOG_LEVEL, value: None
  2. appsettings.json using Logging setting
"Logging": {
    "LogLevel": { 
      "Default": "Warning",
      "Elastic.Apm": "None"
    }
  },
  1. appsettings using ElasticApm setting
"ElasticApm":
    {
      "LogLevel":  "None"
}

None of these alternatives removed the unsampled transaction log. Could it be overwritten somehow?

Best,
Simon

Hi @Simonjanzon,

since the LogLevel is a dynamic setting it can also be changed via Central Configuration (see here).

Hope this helps,
Wolfgang

Hi,

Thanks. I'll check that out and get back.

Best regards,
Simon

Hi again,

We tried the central configuration as well, but without luck.

These dropped transactions logs are really clogging the readability in our log system. Any chance you could replicate it?

Hi @Simonjanzon

one thing which happened in the meantime is that there was a change in the agent and these logs will be printed on debug level (instead of info) from the next agent version: Use debug log level when dropping spans by z1c0 · Pull Request #1850 · elastic/apm-agent-dotnet · GitHub

Hi Greg,

That sounds like a good solution. Do you have any idea of when it will be released? :slight_smile:

Hi @Simonjanzon,

we just pushed out a new release: Release v1.18.0 · elastic/apm-agent-dotnet · GitHub NuGet packages are getting indexed as well.

The change mentioned above is included in this release.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.