Skip to content

Commit 43b5eb1

Browse files
committed
fix lint
1 parent 2c12da3 commit 43b5eb1

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

core/collection_pipeline/serializer/JsonSerializer.cpp

+5-11
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@
1414

1515
#include "collection_pipeline/serializer/JsonSerializer.h"
1616

17-
#include "constants/SpanConstants.h"
18-
// TODO: the following dependencies should be removed
19-
#include "protobuf/sls/LogGroupSerializer.h"
20-
21-
#include "rapidjson/writer.h"
2217
#include "rapidjson/stringbuffer.h"
18+
#include "rapidjson/writer.h"
2319

2420
using namespace std;
2521

2622
namespace logtail {
2723

28-
const char* JSON_KEY_TIME = "__time__";
29-
3024
// Helper function to serialize common fields (tags and time)
3125
template <typename WriterType>
3226
void SerializeCommonFields(const SizedMap& tags, uint64_t timestamp, WriterType& writer) {
@@ -36,7 +30,7 @@ void SerializeCommonFields(const SizedMap& tags, uint64_t timestamp, WriterType&
3630
writer.String(tag.second.to_string().c_str());
3731
}
3832
// Serialize time
39-
writer.Key(JSON_KEY_TIME);
33+
writer.Key("__time__");
4034
writer.Uint64(timestamp);
4135
}
4236

@@ -92,18 +86,18 @@ bool JsonEventGroupSerializer::Serialize(BatchedEvents&& group, string& res, str
9286
writer.StartObject();
9387
SerializeCommonFields(group.mTags, e.GetTimestamp(), writer);
9488
// __labels__
95-
writer.Key(METRIC_RESERVED_KEY_LABELS.c_str());
89+
writer.Key("__labels__");
9690
writer.StartObject();
9791
for (auto tag = e.TagsBegin(); tag != e.TagsEnd(); tag++) {
9892
writer.Key(tag->first.to_string().c_str());
9993
writer.String(tag->second.to_string().c_str());
10094
}
10195
writer.EndObject();
10296
// __name__
103-
writer.Key(METRIC_RESERVED_KEY_NAME.c_str());
97+
writer.Key("__name__");
10498
writer.String(e.GetName().to_string().c_str());
10599
// __value__
106-
writer.Key(METRIC_RESERVED_KEY_VALUE.c_str());
100+
writer.Key("__value__");
107101
if (e.Is<UntypedSingleValue>()) {
108102
writer.Double(e.GetValue<UntypedSingleValue>()->mValue);
109103
} else if (e.Is<UntypedMultiDoubleValues>()) {

core/plugin/flusher/file/FlusherFile.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "spdlog/async.h"
1818
#include "spdlog/sinks/rotating_file_sink.h"
19-
#include "spdlog/sinks/stdout_color_sinks.h"
2019

2120
#include "collection_pipeline/queue/SenderQueueManager.h"
2221

0 commit comments

Comments
 (0)