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

Failed to insert statistics. Cause:SpanEvent has invalid format #9178

Open
liucx1201 opened this issue Sep 13, 2022 · 4 comments
Open

Failed to insert statistics. Cause:SpanEvent has invalid format #9178

liucx1201 opened this issue Sep 13, 2022 · 4 comments

Comments

@liucx1201
Copy link

liucx1201 commented Sep 13, 2022

I'm always asking this question. Please help me look

pinpoint-collector.log:
09-13 11:42:18.018 [Span-Worker-172] WARN c.n.p.c.s.TraceService : Failed to insert statistics. Cause:SpanEvent has invalid format.(application:dfds/5656699999-d5rct[SPRING_BOOT], spanEventApplication:null[MYSQL]) 09-13 11:42:25.025 [Span-Worker-466] WARN c.n.p.c.s.TraceService : Failed to insert statistics. Cause:SpanEvent has invalid format.(application:dfds/5656699999-d5rct[SPRING_BOOT], spanEventApplication:null[MYSQL]) 09-13 11:42:25.025 [Span-Worker-466] WARN c.n.p.c.s.TraceService : Failed to insert statistics. Cause:SpanEvent has invalid format.(application:dfds/5656699999-d5rct[SPRING_BOOT], spanEventApplication:null[MYSQL])

pinpoint

@ga-ram
Copy link
Contributor

ga-ram commented Sep 14, 2022

These logs are printed when spanEventApplicationName is null.

If you are using custom database plugin you implemented, please check if the service code is within DATABASE((short)2000, (short)2999) range.

final String spanEventApplicationName = normalize(spanEvent.getDestinationId(), spanEventType);
final String spanEventEndPoint = spanEvent.getEndPoint();
// if terminal update statistics
final int elapsed = spanEvent.getEndElapsed();
final boolean hasException = spanEvent.hasException();
if (applicationId == null || spanEventApplicationName == null) {
logger.warn("Failed to insert statistics. Cause:SpanEvent has invalid format.(application:{}/{}[{}], spanEventApplication:{}[{}])",
applicationId, agentId, applicationServiceType, spanEventApplicationName, spanEventType);
continue;
}

private String normalize(String spanEventApplicationName, ServiceType spanEventType) {
if (spanEventType.getCategory() == ServiceTypeCategory.DATABASE) {
// empty database id
if (spanEventApplicationName == null) {
return "UNKNWON_DATABASE";
}
}
return spanEventApplicationName;
}

@dyingtime
Copy link

similar error was encountered, and didn't use any custom database plugin.

11-24 09:41:39.039 [Span-Worker-298] WARN c.n.p.c.s.TraceService : Failed to insert statistics. Cause:SpanEvent has invalid format.(application:demo/5_B-KwFzRLqGVXMTnq8U6Q[STAND_ALONE], spanEventApplication:null[REDIS])

@jaehong-kim
Copy link
Contributor

@dyingtime
The redis WARN log was patched to version 2.5.1-SNAPSHOT. - #9606

@dyingtime
Copy link

@dyingtime The redis WARN log was patched to version 2.5.1-SNAPSHOT. - #9606

cool,thanks you for your work. i will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants