-
Notifications
You must be signed in to change notification settings - Fork 394
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
[WIP] support span serializing and data routing #1878
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: qianlu.kk <[email protected]>
Signed-off-by: qianlu.kk <[email protected]>
if (telemetryType == "arms") { | ||
// Parse Match segment | ||
const char* key = "Match"; | ||
const Json::Value* itr = config.find(key, key + strlen(key)); | ||
if (!itr) { | ||
// Error | ||
LOG_WARNING(sLogger, ("invalid config!", "telemetry arms need add match tags!")); | ||
return false; | ||
} | ||
// Type | ||
string type; | ||
// Key | ||
std::string tagKey; | ||
// Value | ||
std::string tagValue; | ||
const std::set<std::string> supportDataTypes = { | ||
"trace", | ||
"metric", | ||
"agent_info", | ||
}; | ||
if (!itr->isObject() || !GetMandatoryStringParam(*itr, "Type", type, errorMsg) || type != "tag" || | ||
!GetMandatoryStringParam(*itr, "Key", tagKey, errorMsg) || | ||
!GetMandatoryStringParam(*itr, "Value", tagValue, errorMsg) || | ||
tagKey != "data_type" || !supportDataTypes.count(tagValue)) { | ||
// error | ||
LOG_WARNING(sLogger, ("invalid config!", "telemetry arms need add match tags!")("type",type)("key", tagKey)("value", tagValue)); | ||
return false; | ||
} | ||
if (tagValue == "trace") { | ||
mSubpath = "/apm/trace/arms/v1/trace_log"; | ||
mLogstore = "__arms_default_trace__"; | ||
LOG_WARNING(sLogger, ("successfully set subpath", mSubpath) ("logstore", mLogstore)); | ||
} else if (tagValue == "metric") { | ||
mSubpath = "/apm/metric/arms/v1/metric_log"; | ||
mLogstore = "__arms_default_metric__"; | ||
LOG_WARNING(sLogger, ("successfully set subpath", mSubpath) ("logstore", mLogstore)); | ||
} else if (tagValue == "agent_info") { | ||
mSubpath = "/apm/meta/arms/v1/meta_log/AgentInfo"; | ||
mLogstore = "__arms_default_agentinfo__"; | ||
LOG_WARNING(sLogger, ("successfully set subpath", mSubpath) ("logstore", mLogstore)); | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这边telemetrytype要不干脆写成三种,arms_xxx这样子的,这样就不用这段逻辑了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -84,14 +83,29 @@ Json::Value SpanEvent::SpanLink::ToJson() const { | |||
root["traceState"] = mTraceState.to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
字段的标准要统一
mContext->GetLogstoreName(), | ||
mContext->GetRegion()); | ||
} | ||
if (telemetryType == "metrics") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
telemetryType if逻辑的层次是并列的,if else 顺序 log、metirc、span
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的我修改一下
No description provided.