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.

[BUG] Apm Agent 1.14.0 event sending error on composite span validation - validation rule 'min(2)' violated

See original GitHub issue

APM Agent version

1.14.0

Environment

Operating system and version: Docker on Linux

.NET Framework/Core name and version : NET 6

Application Target Framework(s) : net6.0

Elastic/APM Server Version: 7.16.2

Describe the bug

We see a lot of event sending errors after upgrading to 1.14.0 with SpanCompressionEnabled feature enabled.

Expected behavior

The agent should send event with valid payload .

Actual behavior

Sometimes the agent send composite span with less than 2 so we get the following error:

validation error: span: composite: 'count': validation rule 'min(2)' violated

In the error log I can see composite object with count 0

"composite":{"count":0,"sum":0.0}

[Error] {"PayloadSenderV2"} Failed sending event. Events intake API absolute URL: https://xxxxxx.apm.eu-central-1.aws.cloud.es.io/intake/v2/events. APM Server response: status code: BadRequest, content: 
"{\"accepted\":7,\"errors\":[{\"message\":\"validation error: span: composite: 'count': validation rule 'min(2)' violated\",\"document\":\"{\\"span\\":{\\"action\\":\\"query\\",\\"context\\":{\\"db\\":{\\"instance\\":\\"x-test\\",\\"statement\\":\\"{ \\\\"find\\\\" : \\\\"Site__c\\\\", \\\\"filter\\\\" : { \\\\"ExternalSiteId__c\\\\" : \\\\"SIT-01558837\\\\" }, \\\\"limit\\\\" : 2, \\\\"$db\\\\" : \\\\"x-test\\\\", \\\\"lsid\\\\" : { \\\\"id\\\\" : CSUUID(\\\\"93a9632d-002e-4ce4-8383-ebe0017dbf51\\\\") }, \\\\"$clusterTime\\\\" : { \\\\"clusterTime\\\\" : Timestamp(1645627898, 7), \\\\"signature\\\\" : { \\\\"hash\\\\" : new BinData(0, \\\\"MBgrvDORMQHYS3DbIuoInQPWzNE=\\\\"), \\\\"keyId\\\\" : NumberLong(\\\\"7029680227286515718\\\\") } } }\\",\\"type\\":\\"mongo\\"},\\"destination\\":{\\"address\\":\\"pxxxx.mongodb.net\\",\\"port\\":1026,\\"service\\":{\\"name\\":\\"\\",\\"resource\\":\\"mongo\\",\\"type\\":\\"\\"}}},\\"duration\\":9.043,\\"id\\":\\"b10fe1610ca9a0b8\\",\\"name\\":\\"find\\",\\"outcome\\":\\"success\\",\\"parent_id\\":\\"adfd318b558d0c6c\\",\\"composite\\":{\\"count\\":0,\\"sum\\":0.0}............

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gregkalaposcommented, Mar 2, 2022

Managed to figure this out without logs - fix is merged.

0reactions
kruskallcommented, Aug 2, 2023

Hi @gregkalapos 👋 ,

Sorry for the ping, we bumped into the same issue. As part of the ops KPI review for APM Server, we’re seeing the same error.message: validation error: span: composite: 'count': validation rule 'min(2)' violated, validation error: span: composite: 'count': validation rule 'min(2)' violated in the ecs logs

This seem to affect multiple versions including 1.22.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common problems | APM Server Reference [7.15]
This error occurs when APM Server attempts to write to an index instead of an alias. One way this can happen, is when...
Read more >
Bug listing with status RESOLVED with resolution TEST- ...
Error in sched.c line 961." status:RESOLVED resolution:TEST-REQUEST severity:major · Bug:22815 - "Gentoo fails to reboot after changes are made to the ...
Read more >
Jquery Validation ShowErrors method shows error in a ...
Valid/Invalid status is based solely on how the entered value of a field compares to the declared validation rules.
Read more >
How to Optimize Elastic APM
This specifies the maximum number of spans that can be collected by the APM agent in a single transaction. The higher the value,...
Read more >
C#, PHP, C++, iOS, MySQL, SQL, ASP.NET, Objective-C, ...
NET MVC 3, UITableView, CodeIgniter, validation, shell, API, Google Maps, Cordova, JSP, REST, TSQL, Cocoa, Maven, ASP.NET MVC 4, XAML, jQuery UI, ...
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