diff --git a/.gitignore b/.gitignore index 06715ad65f..a3ebf3308a 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,7 @@ _deps # Custom /build/ core/build/ -core/protobuf/*/*.pb.* +core/protobuf/sls/*.pb.* core/common/Version.cpp !/Makefile # Enterprise diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 53ef4b1963..8613450034 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -117,7 +117,7 @@ set(SUB_DIRECTORIES_LIST config config/watcher pipeline pipeline/batch pipeline/limiter pipeline/plugin pipeline/plugin/creator pipeline/plugin/instance pipeline/plugin/interface pipeline/queue pipeline/route pipeline/serializer runner runner/sink/http - protobuf/sls protobuf/models + protobuf/sls file_server file_server/event file_server/event_handler file_server/event_listener file_server/reader file_server/polling prometheus prometheus/labels prometheus/schedulers prometheus/async ebpf ebpf/observer ebpf/security ebpf/handler diff --git a/core/dependencies.cmake b/core/dependencies.cmake index 4b3088b706..50d1aec347 100644 --- a/core/dependencies.cmake +++ b/core/dependencies.cmake @@ -131,9 +131,6 @@ logtail_define(protobuf_BIN "Absolute path to protoc" "${DEPS_BINARY_ROOT}/proto set(PROTO_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/protobuf/sls") set(PROTO_FILES ${PROTO_FILE_PATH}/sls_logs.proto ${PROTO_FILE_PATH}/logtail_buffer_meta.proto ${PROTO_FILE_PATH}/metric.proto ${PROTO_FILE_PATH}/checkpoint.proto) execute_process(COMMAND ${protobuf_BIN} --proto_path=${PROTO_FILE_PATH} --cpp_out=${PROTO_FILE_PATH} ${PROTO_FILES}) -set(PROTO_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/protobuf/models") -set(PROTO_FILES ${PROTO_FILE_PATH}/log_event.proto ${PROTO_FILE_PATH}/metric_event.proto ${PROTO_FILE_PATH}/span_event.proto ${PROTO_FILE_PATH}/pipeline_event_group.proto) -execute_process(COMMAND ${protobuf_BIN} --proto_path=${PROTO_FILE_PATH} --cpp_out=${PROTO_FILE_PATH} ${PROTO_FILES}) # re2 macro(link_re2 target_name) diff --git a/core/go_pipeline/LogtailPlugin.cpp b/core/go_pipeline/LogtailPlugin.cpp index 609242ce64..5040db50b1 100644 --- a/core/go_pipeline/LogtailPlugin.cpp +++ b/core/go_pipeline/LogtailPlugin.cpp @@ -616,4 +616,3 @@ K8sContainerMeta LogtailPlugin::GetContainerMeta(const string& containerID) { } return K8sContainerMeta(); } - diff --git a/core/models/LogEvent.cpp b/core/models/LogEvent.cpp index 882bd11a9d..64ee2346d3 100644 --- a/core/models/LogEvent.cpp +++ b/core/models/LogEvent.cpp @@ -56,15 +56,15 @@ void LogEvent::SetContentNoCopy(const StringBuffer& key, const StringBuffer& val } void LogEvent::SetContentNoCopy(StringView key, StringView val) { - auto rst = mIndex.insert(make_pair(key, mContents.size())); - if (!rst.second) { - auto& it = rst.first; + auto it = mIndex.find(key); + if (it != mIndex.end()) { auto& field = mContents[it->second].first; mAllocatedContentSize += key.size() + val.size() - field.first.size() - field.second.size(); field = make_pair(key, val); } else { mAllocatedContentSize += key.size() + val.size(); mContents.emplace_back(make_pair(key, val), true); + mIndex[key] = mContents.size() - 1; } } @@ -78,11 +78,6 @@ void LogEvent::DelContent(StringView key) { } } -void LogEvent::SetLevel(const std::string& level) { - const StringBuffer& b = GetSourceBuffer()->CopyString(level); - mLevel = StringView(b.data, b.size); -} - LogEvent::ContentIterator LogEvent::FindContent(StringView key) { auto it = mIndex.find(key); if (it != mIndex.end()) { diff --git a/core/models/LogEvent.h b/core/models/LogEvent.h index abda7f5b47..02f041854d 100644 --- a/core/models/LogEvent.h +++ b/core/models/LogEvent.h @@ -81,14 +81,11 @@ class LogEvent : public PipelineEvent { void SetContentNoCopy(StringView key, StringView val); void DelContent(StringView key); - void SetPosition(uint64_t offset, uint64_t size) { + void SetPosition(uint32_t offset, uint32_t size) { mFileOffset = offset; mRawSize = size; } - std::pair GetPosition() const { return {mFileOffset, mRawSize}; } - - StringView GetLevel() const { return mLevel; } - void SetLevel(const std::string& level); + std::pair GetPosition() const { return {mFileOffset, mRawSize}; } bool Empty() const { return mIndex.empty(); } size_t Size() const { return mIndex.size(); } @@ -120,9 +117,8 @@ class LogEvent : public PipelineEvent { ContentsContainer mContents; size_t mAllocatedContentSize = 0; std::map mIndex; - uint64_t mFileOffset = 0; - uint64_t mRawSize = 0; - StringView mLevel; + uint32_t mFileOffset = 0; + uint32_t mRawSize = 0; }; } // namespace logtail diff --git a/core/models/SpanEvent.h b/core/models/SpanEvent.h index 27f37dd9d0..a8ad140e5b 100644 --- a/core/models/SpanEvent.h +++ b/core/models/SpanEvent.h @@ -58,9 +58,6 @@ class SpanEvent : public PipelineEvent { void SetTagNoCopy(const StringBuffer& key, const StringBuffer& val); void SetTagNoCopy(StringView key, StringView val); void DelTag(StringView key); - std::map::const_iterator TagsBegin() const { return mTags.mInner.begin(); } - std::map::const_iterator TagsEnd() const { return mTags.mInner.end(); } - size_t TagsSize() const { return mTags.mInner.size(); } std::shared_ptr& GetSourceBuffer(); @@ -98,9 +95,6 @@ class SpanEvent : public PipelineEvent { void SetTagNoCopy(const StringBuffer& key, const StringBuffer& val); void SetTagNoCopy(StringView key, StringView val); void DelTag(StringView key); - std::map::const_iterator TagsBegin() const { return mTags.mInner.begin(); } - std::map::const_iterator TagsEnd() const { return mTags.mInner.end(); } - size_t TagsSize() const { return mTags.mInner.size(); } std::shared_ptr& GetSourceBuffer(); @@ -159,9 +153,6 @@ class SpanEvent : public PipelineEvent { void SetTagNoCopy(const StringBuffer& key, const StringBuffer& val); void SetTagNoCopy(StringView key, StringView val); void DelTag(StringView key); - std::map::const_iterator TagsBegin() const { return mTags.mInner.begin(); } - std::map::const_iterator TagsEnd() const { return mTags.mInner.end(); } - size_t TagsSize() const { return mTags.mInner.size(); } const std::vector& GetEvents() const { return mEvents; } InnerEvent* AddEvent(); @@ -179,9 +170,6 @@ class SpanEvent : public PipelineEvent { void SetScopeTagNoCopy(const StringBuffer& key, const StringBuffer& val); void SetScopeTagNoCopy(StringView key, StringView val); void DelScopeTag(StringView key); - std::map::const_iterator ScopeTagsBegin() const { return mScopeTags.mInner.begin(); } - std::map::const_iterator ScopeTagsEnd() const { return mScopeTags.mInner.end(); } - size_t ScopeTagsSize() const { return mScopeTags.mInner.size(); } size_t DataSize() const override; diff --git a/core/protobuf/models/ProtocolConversion.cpp b/core/protobuf/models/ProtocolConversion.cpp deleted file mode 100644 index 49e49e5bf8..0000000000 --- a/core/protobuf/models/ProtocolConversion.cpp +++ /dev/null @@ -1,325 +0,0 @@ -#include "protobuf/models/ProtocolConversion.h" - -using namespace std; - -namespace logtail { - -bool TransferPBToPipelineEventGroup(const logtail::models::PipelineEventGroup& src, logtail::PipelineEventGroup& dst, std::string& errMsg) { - // events - switch (src.PipelineEvents_case()) - { - case logtail::models::PipelineEventGroup::PipelineEventsCase::kLogs: - if (src.logs().events_size() == 0) { - errMsg = "error transfer PB to PipelineEventGroup: no log events"; - return false; - } - dst.MutableEvents().reserve(src.logs().events_size()); - for (auto& logSrc : src.logs().events()) { - auto logDst = dst.AddLogEvent(); - if (!TransferPBToLogEvent(logSrc, *logDst, errMsg)) { - return false; - } - } - break; - case logtail::models::PipelineEventGroup::PipelineEventsCase::kMetrics: - if (src.metrics().events_size() == 0) { - errMsg = "error transfer PB to PipelineEventGroup: no metric events"; - return false; - } - dst.MutableEvents().reserve(src.metrics().events_size()); - for (auto& metricSrc : src.metrics().events()) { - auto metricDst = dst.AddMetricEvent(); - if (!TransferPBToMetricEvent(metricSrc, *metricDst, errMsg)) { - return false; - } - } - break; - case logtail::models::PipelineEventGroup::PipelineEventsCase::kSpans: - if (src.spans().events_size() == 0) { - errMsg = "error transfer PB to PipelineEventGroup: no span events"; - return false; - } - dst.MutableEvents().reserve(src.spans().events_size()); - for (auto& spanSrc : src.spans().events()) { - auto spanDst = dst.AddSpanEvent(); - if (!TransferPBToSpanEvent(spanSrc, *spanDst, errMsg)) { - return false; - } - } - break; - default: - errMsg = "error transfer PB to PipelineEventGroup: unsupported event type"; - return false; - } - - // tags - for (auto& tag : src.tags()) { - dst.SetTag(tag.first, tag.second); - } - - // metadatas - for (auto& metaData : src.metadata()) { - if (metaData.first == "source_id") { - dst.SetMetadata(logtail::EventGroupMetaKey::SOURCE_ID, metaData.second); - } - } - - return true; -} - -bool TransferPBToLogEvent(const logtail::models::LogEvent& src, logtail::LogEvent& dst, std::string& errMsg) { - // timestamp - std::chrono::nanoseconds tns(src.timestamp()); - std::chrono::seconds ts = std::chrono::duration_cast(tns); - dst.SetTimestamp(ts.count(), tns.count() - ts.count() * 1000000000); - // contents - for (auto& contentPair : src.contents()) { - dst.SetContent(contentPair.key(), contentPair.value()); - } - // level - dst.SetLevel(src.level()); - // fileoffset and rawsize - dst.SetPosition(src.fileoffset(), src.rawsize()); - return true; -} - -bool TransferPBToMetricEvent(const logtail::models::MetricEvent& src, logtail::MetricEvent& dst, std::string& errMsg) { - // timestamp - std::chrono::nanoseconds tns(src.timestamp()); - std::chrono::seconds ts = std::chrono::duration_cast(tns); - dst.SetTimestamp(ts.count(), tns.count() - ts.count() * 1000000000); - // name - dst.SetName(src.name()); - // value - switch (src.Value_case()) { - case logtail::models::MetricEvent::ValueCase::kUntypedSingleValue: - dst.SetValue(logtail::UntypedSingleValue{src.untypedsinglevalue().value()}); - break; - default: - errMsg = "error transfer PB to MetricEvent: unsupported value type"; - return false; - } - // tags - for (auto& tagPair : src.tags()) { - dst.SetTag(tagPair.first, tagPair.second); - } - return true; -} - -bool TransferPBToSpanEvent(const logtail::models::SpanEvent& src, logtail::SpanEvent& dst, std::string& errMsg) { - // timestamp - std::chrono::nanoseconds tns(src.timestamp()); - std::chrono::seconds ts = std::chrono::duration_cast(tns); - dst.SetTimestamp(ts.count(), tns.count() - ts.count() * 1000000000); - - dst.SetTraceId(src.traceid()); - dst.SetSpanId(src.spanid()); - dst.SetTraceState(src.tracestate()); - dst.SetParentSpanId(src.parentspanid()); - dst.SetName(src.name()); - dst.SetKind(static_cast(src.kind())); - dst.SetStartTimeNs(src.starttime()); - dst.SetEndTimeNs(src.endtime()); - - // tags - for (auto& tagPair : src.tags()) { - dst.SetTag(tagPair.first, tagPair.second); - } - // inner events - for (auto& event : src.events()) { - auto dstEvent = dst.AddEvent(); - dstEvent->SetTimestampNs(event.timestamp()); - dstEvent->SetName(event.name()); - for (auto& tagPair : event.tags()) { - dstEvent->SetTag(tagPair.first, tagPair.second); - } - } - // span links - for (auto& link : src.links()) { - auto dstLink = dst.AddLink(); - dstLink->SetTraceId(link.traceid()); - dstLink->SetSpanId(link.spanid()); - dstLink->SetTraceState(link.tracestate()); - for (auto& tagPair : link.tags()) { - dstLink->SetTag(tagPair.first, tagPair.second); - } - } - - dst.SetStatus(static_cast(src.status())); - - // scope tags - for (auto& tagPair : src.scopetags()) { - dst.SetScopeTag(tagPair.first, tagPair.second); - } - - return true; -} - -bool TransferPipelineEventGroupToPB(const logtail::PipelineEventGroup& src, logtail::models::PipelineEventGroup& dst, std::string& errMsg) { - // events - if (src.GetEvents().empty()) { - errMsg = "error transfer PipelineEventGroup to PB: events empty"; - return false; - } - - switch (src.GetEvents()[0]->GetType()) { - case logtail::PipelineEvent::Type::LOG: - dst.mutable_logs()->mutable_events()->Reserve(src.GetEvents().size()); - for (const auto& event : src.GetEvents()) { - if (!event.Is()) { - errMsg = "error transfer PipelineEventGroup to PB: unsupport pipelineEventGroup with multi types of events"; - return false; - } - const auto& logSrc = event.Cast(); - auto logDst = dst.mutable_logs()->add_events(); - if (!TransferLogEventToPB(logSrc, *logDst, errMsg)) { - return false; - } - } - break; - case logtail::PipelineEvent::Type::METRIC: - dst.mutable_metrics()->mutable_events()->Reserve(src.GetEvents().size()); - for (const auto& event : src.GetEvents()) { - if (!event.Is()) { - errMsg = "error transfer PipelineEventGroup to PB: unsupport pipelineEventGroup with multi types of events"; - return false; - } - const auto& metricSrc = event.Cast(); - auto metricDst = dst.mutable_metrics()->add_events(); - if (!TransferMetricEventToPB(metricSrc, *metricDst, errMsg)) { - return false; - } - } - break; - case logtail::PipelineEvent::Type::SPAN: - dst.mutable_spans()->mutable_events()->Reserve(src.GetEvents().size()); - for (const auto& event : src.GetEvents()) { - if (!event.Is()) { - errMsg = "error transfer PipelineEventGroup to PB: unsupport pipelineEventGroup with multi types of events"; - return false; - } - const auto& spanSrc = event.Cast(); - auto spanDst = dst.mutable_spans()->add_events(); - if (!TransferSpanEventToPB(spanSrc, *spanDst, errMsg)) { - return false; - } - } - break; - default: - errMsg = "error transfer PipelineEventGroup to PB: unsupported event type"; - return false; - } - - // tags - for (const auto& tag : src.GetTags()) { - dst.mutable_tags()->insert({tag.first.to_string(), tag.second.to_string()}); - } - - // metadatas - auto sourceId = src.GetMetadata(logtail::EventGroupMetaKey::SOURCE_ID); - if (!sourceId.empty()) { - dst.mutable_metadata()->insert({"source_id", sourceId.to_string()}); - } - return true; -} - -bool TransferLogEventToPB(const logtail::LogEvent& src, logtail::models::LogEvent& dst, std::string& errMsg) { - // timestamp - std::chrono::seconds ts(src.GetTimestamp()); - dst.set_timestamp(ts.count() * 1000000000 + src.GetTimestampNanosecond().value_or(0)); - - // contents - dst.mutable_contents()->Reserve(src.Size()); - for (auto iter = src.begin(); iter != src.end(); iter++) { - auto content = dst.add_contents(); - content->set_key(iter->first.to_string()); - content->set_value(iter->second.to_string()); - } - - // level - dst.set_level(src.GetLevel().to_string()); - - // fileoffset and rawsize - dst.set_fileoffset(src.GetPosition().first); - dst.set_rawsize(src.GetPosition().second); - - return true; -} - -bool TransferMetricEventToPB(const logtail::MetricEvent& src, logtail::models::MetricEvent& dst, std::string& errMsg) { - // timestamp - std::chrono::seconds ts(src.GetTimestamp()); - dst.set_timestamp(ts.count() * 1000000000 + src.GetTimestampNanosecond().value_or(0)); - - // name - dst.set_name(src.GetName().to_string()); - - // value - if (src.Is()) { - auto v = src.GetValue(); - dst.mutable_untypedsinglevalue()->set_value(v->mValue); - } else { - errMsg = "error transfer MetricEvent to PB: unsupported value type"; - return false; - } - - // tags - for (auto iter = src.TagsBegin(); iter != src.TagsEnd(); iter++) { - dst.mutable_tags()->insert({iter->first.to_string(), iter->second.to_string()}); - } - - return true; -} - -bool TransferSpanEventToPB(const logtail::SpanEvent& src, logtail::models::SpanEvent& dst, std::string& errMsg) { - // timestamp - std::chrono::seconds ts(src.GetTimestamp()); - dst.set_timestamp(ts.count() * 1000000000 + src.GetTimestampNanosecond().value_or(0)); - - dst.set_traceid(src.GetTraceId().to_string()); - dst.set_spanid(src.GetSpanId().to_string()); - dst.set_tracestate(src.GetTraceState().to_string()); - dst.set_parentspanid(src.GetParentSpanId().to_string()); - dst.set_name(src.GetName().to_string()); - dst.set_kind(static_cast(src.GetKind())); - dst.set_starttime(src.GetStartTimeNs()); - dst.set_endtime(src.GetEndTimeNs()); - - // tags - for (auto iter = src.TagsBegin(); iter != src.TagsEnd(); iter++) { - dst.mutable_tags()->insert({iter->first.to_string(), iter->second.to_string()}); - } - - // inner events - for (const auto& event : src.GetEvents()) { - auto dstEvent = dst.add_events(); - dstEvent->set_timestamp(event.GetTimestampNs()); - dstEvent->set_name(event.GetName().to_string()); - for (auto iter = event.TagsBegin(); iter != event.TagsEnd(); iter++) { - dstEvent->mutable_tags()->insert({iter->first.to_string(), iter->second.to_string()}); - } - } - - // span links - for (const auto& link : src.GetLinks()) { - auto dstLink = dst.add_links(); - dstLink->set_traceid(link.GetTraceId().to_string()); - dstLink->set_spanid(link.GetSpanId().to_string()); - dstLink->set_tracestate(link.GetTraceState().to_string()); - for (auto iter = link.TagsBegin(); iter != link.TagsEnd(); iter++) { - dstLink->mutable_tags()->insert({iter->first.to_string(), iter->second.to_string()}); - } - } - - // status - dst.set_status(static_cast(src.GetStatus())); - - // scope tags - for (auto iter = src.ScopeTagsBegin(); iter != src.ScopeTagsEnd(); iter++) { - dst.mutable_scopetags()->insert({iter->first.to_string(), iter->second.to_string()}); - } - - return true; -} - -} // namespace logtail diff --git a/core/protobuf/models/ProtocolConversion.h b/core/protobuf/models/ProtocolConversion.h deleted file mode 100644 index aac227cfc2..0000000000 --- a/core/protobuf/models/ProtocolConversion.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2024 iLogtail Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "models/PipelineEventGroup.h" -#include "models/LogEvent.h" -#include "models/MetricEvent.h" -#include "models/SpanEvent.h" -#include "protobuf/models/pipeline_event_group.pb.h" -#include "protobuf/models/log_event.pb.h" -#include "protobuf/models/metric_event.pb.h" -#include "protobuf/models/span_event.pb.h" - -namespace logtail { - -bool TransferPBToPipelineEventGroup(const models::PipelineEventGroup& src, PipelineEventGroup& dst, std::string& errMsg); -bool TransferPBToLogEvent(const models::LogEvent& src, LogEvent& dst, std::string& errMsg); -bool TransferPBToMetricEvent(const models::MetricEvent& src, MetricEvent& dst, std::string& errMsg); -bool TransferPBToSpanEvent(const models::SpanEvent& src, SpanEvent& dst, std::string& errMsg); - -bool TransferPipelineEventGroupToPB(const PipelineEventGroup& src, models::PipelineEventGroup& dst, std::string& errMsg); -bool TransferLogEventToPB(const LogEvent& src, models::LogEvent& dst, std::string& errMsg); -bool TransferMetricEventToPB(const MetricEvent& src, models::MetricEvent& dst, std::string& errMsg); -bool TransferSpanEventToPB(const SpanEvent& src, models::SpanEvent& dst, std::string& errMsg); - -} // namespace logtail diff --git a/core/protobuf/models/log_event.proto b/core/protobuf/models/log_event.proto deleted file mode 100644 index 5fdfaaa38c..0000000000 --- a/core/protobuf/models/log_event.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -package logtail.models; - -message LogEvent { - uint64 Timestamp = 1; - message Content { - bytes Key = 1; - bytes Value = 2; - } - repeated Content Contents= 2; - bytes Level = 3; - uint64 FileOffset = 4; - uint64 RawSize = 5; -} diff --git a/core/protobuf/models/metric_event.proto b/core/protobuf/models/metric_event.proto deleted file mode 100644 index 144c628139..0000000000 --- a/core/protobuf/models/metric_event.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package logtail.models; - -message UntypedSingleValue { - double Value = 1; -} - -message MetricEvent { - uint64 Timestamp = 1; - bytes Name = 2; - map Tags = 3; - oneof Value { - UntypedSingleValue UntypedSingleValue = 4; - } -} diff --git a/core/protobuf/models/pipeline_event_group.proto b/core/protobuf/models/pipeline_event_group.proto deleted file mode 100644 index 580fbf08b6..0000000000 --- a/core/protobuf/models/pipeline_event_group.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package logtail.models; - -import "log_event.proto"; -import "metric_event.proto"; -import "span_event.proto"; - -message PipelineEventGroup { - map Metadata = 1; - map Tags = 2; - message LogEvents { - repeated LogEvent Events = 1; - } - message MetricEvents { - repeated MetricEvent Events = 1; - } - message SpanEvents { - repeated SpanEvent Events = 1; - } - oneof PipelineEvents { - LogEvents Logs = 3; - MetricEvents Metrics = 4; - SpanEvents Spans = 5; - } -} diff --git a/core/protobuf/models/span_event.proto b/core/protobuf/models/span_event.proto deleted file mode 100644 index 6926511d60..0000000000 --- a/core/protobuf/models/span_event.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; -package logtail.models; - -message SpanEvent { - uint64 Timestamp = 1; - bytes TraceID = 2; - bytes SpanID = 3; - bytes TraceState = 4; - bytes ParentSpanID = 5; - bytes Name = 6; - enum SpanKind { - UNSPECIFIED = 0; - INTERVAL = 1; - SERVER = 2; - CLIENT = 3; - PRODUCER = 4; - CONSUMER = 5; - } - SpanKind Kind = 7; - uint64 StartTime = 8; - uint64 EndTime = 9; - map Tags = 10; - message InnerEvent { - uint64 Timestamp = 1; - bytes Name = 2; - map Tags = 3; - } - repeated InnerEvent Events = 11; - message SpanLink { - bytes TraceID = 1; - bytes SpanID = 2; - bytes TraceState = 3; - map Tags = 4; - } - repeated SpanLink Links = 12; - enum StatusCode { - Unset = 0; - Ok = 1; - Error = 2; - } - StatusCode Status = 13; - map ScopeTags = 14; -} diff --git a/core/unittest/models/LogEventUnittest.cpp b/core/unittest/models/LogEventUnittest.cpp index da3226247d..673c11878b 100644 --- a/core/unittest/models/LogEventUnittest.cpp +++ b/core/unittest/models/LogEventUnittest.cpp @@ -30,7 +30,6 @@ class LogEventUnittest : public ::testing::Test { void TestMeta(); void TestSize(); void TestFromJsonToJson(); - void TestLevel(); protected: void SetUp() override { @@ -203,11 +202,6 @@ void LogEventUnittest::TestFromJsonToJson() { APSARA_TEST_STREQ(CompactJson(inJson).c_str(), CompactJson(outJson).c_str()); } -void LogEventUnittest::TestLevel() { - mLogEvent->SetLevel("level"); - APSARA_TEST_EQUAL("level", mLogEvent->GetLevel().to_string()); -} - UNIT_TEST_CASE(LogEventUnittest, TestTimestampOp) UNIT_TEST_CASE(LogEventUnittest, TestSetContent) UNIT_TEST_CASE(LogEventUnittest, TestDelContent) @@ -216,7 +210,6 @@ UNIT_TEST_CASE(LogEventUnittest, TestIterateContent) UNIT_TEST_CASE(LogEventUnittest, TestMeta) UNIT_TEST_CASE(LogEventUnittest, TestSize) UNIT_TEST_CASE(LogEventUnittest, TestFromJsonToJson) -UNIT_TEST_CASE(LogEventUnittest, TestLevel) } // namespace logtail diff --git a/pkg/helper/pipeline_event_helper.go b/pkg/helper/pipeline_event_helper.go deleted file mode 100644 index 770486ee96..0000000000 --- a/pkg/helper/pipeline_event_helper.go +++ /dev/null @@ -1,223 +0,0 @@ -package helper - -import ( - "fmt" - "sync" - "time" - - "github.com/alibaba/ilogtail/pkg/models" - "github.com/alibaba/ilogtail/pkg/protocol" - "github.com/alibaba/ilogtail/pkg/util" -) - -var LogEventPool = sync.Pool{ - New: func() interface{} { - return new(protocol.LogEvent) - }, -} - -func CreateLogEvent(t time.Time, enableTimestampNano bool, fields map[string]string) (*protocol.LogEvent, error) { - logEvent := LogEventPool.Get().(*protocol.LogEvent) - logEvent.Timestamp = uint64(t.Unix())*1e9 + uint64(t.Nanosecond()) - if len(logEvent.Contents) < len(fields) { - slice := make([]*protocol.LogEvent_Content, len(logEvent.Contents), len(fields)) - copy(slice, logEvent.Contents) - logEvent.Contents = slice - } else { - logEvent.Contents = logEvent.Contents[:len(fields)] - } - i := 0 - rawSize := 0 - for key, val := range fields { - if i >= len(logEvent.Contents) { - logEvent.Contents = append(logEvent.Contents, &protocol.LogEvent_Content{}) - } - logEvent.Contents[i].Key = util.ZeroCopyStringToBytes(key) - logEvent.Contents[i].Value = util.ZeroCopyStringToBytes(val) - i++ - rawSize += len(val) - } - logEvent.RawSize = uint64(rawSize) - return logEvent, nil -} - -func CreateLogEventByArray(t time.Time, enableTimestampNano bool, columns []string, values []string) (*protocol.LogEvent, error) { - logEvent := LogEventPool.Get().(*protocol.LogEvent) - logEvent.Timestamp = uint64(t.Unix())*1e9 + uint64(t.Nanosecond()) - logEvent.Contents = make([]*protocol.LogEvent_Content, 0, len(columns)) - if len(columns) != len(values) { - return nil, fmt.Errorf("columns and values not equal") - } - rawSize := 0 - for index := range columns { - if index >= len(logEvent.Contents) { - logEvent.Contents = append(logEvent.Contents, &protocol.LogEvent_Content{}) - } - logEvent.Contents[index].Key = util.ZeroCopyStringToBytes(columns[index]) - logEvent.Contents[index].Value = util.ZeroCopyStringToBytes(values[index]) - rawSize += len(values[index]) - } - logEvent.RawSize = uint64(rawSize) - return logEvent, nil -} - -func CreateLogEventByLegacyRawLog(log *protocol.Log) (*protocol.LogEvent, error) { - logEvent := LogEventPool.Get().(*protocol.LogEvent) - logEvent.Timestamp = uint64(log.GetTime())*1e9 + uint64(log.GetTimeNs()) - logEvent.Contents = make([]*protocol.LogEvent_Content, 0, len(log.Contents)) - rawSize := 0 - for i, logC := range log.Contents { - if i >= len(logEvent.Contents) { - logEvent.Contents = append(logEvent.Contents, &protocol.LogEvent_Content{}) - } - logEvent.Contents[i].Key = util.ZeroCopyStringToBytes(logC.Key) - logEvent.Contents[i].Value = util.ZeroCopyStringToBytes(logC.Value) - rawSize += len(logC.Value) - } - logEvent.RawSize = uint64(rawSize) - return logEvent, nil -} - -func TransferLogEventToPB(log *models.Log) (*protocol.LogEvent, error) { - logEvent := LogEventPool.Get().(*protocol.LogEvent) - logEvent.Timestamp = log.GetTimestamp() - logEvent.Contents = make([]*protocol.LogEvent_Content, 0, log.Contents.Len()) - for k, v := range log.Contents.Iterator() { - cont := &protocol.LogEvent_Content{ - Key: util.ZeroCopyStringToBytes(k), - Value: util.ZeroCopyStringToBytes(v.(string)), - } - logEvent.Contents = append(logEvent.Contents, cont) - } - logEvent.Level = util.ZeroCopyStringToBytes(log.GetLevel()) - logEvent.FileOffset = log.GetOffset() - logEvent.RawSize = log.GetRawSize() - return logEvent, nil -} - -func TransferMetricEventToPB(metric *models.Metric) (*protocol.MetricEvent, error) { - var metricEvent protocol.MetricEvent - metricEvent.Timestamp = metric.GetTimestamp() - metricEvent.Name = util.ZeroCopyStringToBytes(metric.GetName()) - if metric.GetValue().IsSingleValue() { - metricEvent.Value = &protocol.MetricEvent_UntypedSingleValue{UntypedSingleValue: &protocol.UntypedSingleValue{Value: metric.Value.GetSingleValue()}} - } else { - return nil, fmt.Errorf("unsupported metric value type") - } - metricEvent.Tags = make(map[string][]byte, metric.GetTags().Len()) - for k, v := range metric.GetTags().Iterator() { - metricEvent.Tags[k] = util.ZeroCopyStringToBytes(v) - } - return &metricEvent, nil -} - -func TransferSpanEventToPB(span *models.Span) (*protocol.SpanEvent, error) { - var spanEvent protocol.SpanEvent - spanEvent.Timestamp = span.GetTimestamp() - spanEvent.TraceID = util.ZeroCopyStringToBytes(span.GetTraceID()) - spanEvent.SpanID = util.ZeroCopyStringToBytes(span.GetSpanID()) - spanEvent.TraceState = util.ZeroCopyStringToBytes(span.GetTraceState()) - spanEvent.ParentSpanID = util.ZeroCopyStringToBytes(span.GetParentSpanID()) - spanEvent.Name = util.ZeroCopyStringToBytes(span.GetName()) - spanEvent.Kind = protocol.SpanEvent_SpanKind(span.GetKind()) - spanEvent.StartTime = span.GetStartTime() - spanEvent.EndTime = span.GetEndTime() - spanEvent.Tags = make(map[string][]byte, span.GetTags().Len()) - for k, v := range span.GetTags().Iterator() { - spanEvent.Tags[k] = util.ZeroCopyStringToBytes(v) - } - spanEvent.Events = make([]*protocol.SpanEvent_InnerEvent, 0, len(span.GetEvents())) - for _, srcEvent := range span.GetEvents() { - dstEvent := protocol.SpanEvent_InnerEvent{ - Timestamp: uint64(srcEvent.Timestamp), - Name: util.ZeroCopyStringToBytes(srcEvent.Name), - Tags: make(map[string][]byte, srcEvent.Tags.Len()), - } - for k, v := range srcEvent.Tags.Iterator() { - dstEvent.Tags[k] = util.ZeroCopyStringToBytes(v) - } - spanEvent.Events = append(spanEvent.Events, &dstEvent) - } - spanEvent.Links = make([]*protocol.SpanEvent_SpanLink, 0, len(span.GetLinks())) - for _, srcLink := range span.GetLinks() { - dstLink := protocol.SpanEvent_SpanLink{ - TraceID: util.ZeroCopyStringToBytes(srcLink.TraceID), - SpanID: util.ZeroCopyStringToBytes(srcLink.SpanID), - TraceState: util.ZeroCopyStringToBytes(srcLink.TraceState), - Tags: make(map[string][]byte, srcLink.Tags.Len()), - } - for k, v := range srcLink.Tags.Iterator() { - dstLink.Tags[k] = util.ZeroCopyStringToBytes(v) - } - spanEvent.Links = append(spanEvent.Links, &dstLink) - } - spanEvent.Status = protocol.SpanEvent_StatusCode(span.GetStatus()) - return &spanEvent, nil -} - -func CreatePipelineEventGroupByLegacyRawLog(logEvents []*protocol.LogEvent, configTag map[string]string, logTags map[string]string, ctx map[string]interface{}) (*protocol.PipelineEventGroup, error) { - var pipelineEventGroup protocol.PipelineEventGroup - pipelineEventGroup.PipelineEvents = &protocol.PipelineEventGroup_Logs{Logs: &protocol.PipelineEventGroup_LogEvents{Events: logEvents}} - pipelineEventGroup.Tags = make(map[string][]byte, len(configTag)+len(logTags)) - for k, v := range configTag { - pipelineEventGroup.Tags[k] = util.ZeroCopyStringToBytes(v) - } - for k, v := range logTags { - pipelineEventGroup.Tags[k] = util.ZeroCopyStringToBytes(v) - } - if ctx != nil { - if source, ok := ctx["source"].(string); ok { - pipelineEventGroup.Metadata = make(map[string][]byte) - pipelineEventGroup.Metadata["source_id"] = util.ZeroCopyStringToBytes(source) - } - } - return &pipelineEventGroup, nil -} - -func TransferPipelineEventGroupToPB(groupInfo *models.GroupInfo, events []models.PipelineEvent) (*protocol.PipelineEventGroup, error) { - var pipelineEventGroup protocol.PipelineEventGroup - if len(events) == 0 { - return nil, fmt.Errorf("events is empty") - } - - eventType := events[0].GetType() - switch eventType { - case models.EventTypeLogging: - logEvents := make([]*protocol.LogEvent, 0, len(events)) - for _, event := range events { - if logSrc, ok := event.(*models.Log); ok { - logDst, _ := TransferLogEventToPB(logSrc) - logEvents = append(logEvents, logDst) - } - } - pipelineEventGroup.PipelineEvents = &protocol.PipelineEventGroup_Logs{Logs: &protocol.PipelineEventGroup_LogEvents{Events: logEvents}} - case models.EventTypeMetric: - metricEvents := make([]*protocol.MetricEvent, 0, len(events)) - for _, event := range events { - if metricSrc, ok := event.(*models.Metric); ok { - metricDst, _ := TransferMetricEventToPB(metricSrc) - metricEvents = append(metricEvents, metricDst) - } - } - pipelineEventGroup.PipelineEvents = &protocol.PipelineEventGroup_Metrics{Metrics: &protocol.PipelineEventGroup_MetricEvents{Events: metricEvents}} - case models.EventTypeSpan: - spanEvents := make([]*protocol.SpanEvent, 0, len(events)) - for _, event := range events { - if spanSrc, ok := event.(*models.Span); ok { - spanDst, _ := TransferSpanEventToPB(spanSrc) - spanEvents = append(spanEvents, spanDst) - } - } - pipelineEventGroup.PipelineEvents = &protocol.PipelineEventGroup_Spans{Spans: &protocol.PipelineEventGroup_SpanEvents{Events: spanEvents}} - } - - pipelineEventGroup.Tags = make(map[string][]byte, groupInfo.Tags.Len()) - for k, v := range groupInfo.Tags.Iterator() { - pipelineEventGroup.Tags[k] = util.ZeroCopyStringToBytes(v) - } - pipelineEventGroup.Metadata = make(map[string][]byte, groupInfo.Metadata.Len()) - for k, v := range groupInfo.Metadata.Iterator() { - pipelineEventGroup.Metadata[k] = util.ZeroCopyStringToBytes(v) - } - return &pipelineEventGroup, nil -} diff --git a/pkg/models/logs.go b/pkg/models/logs.go index c674c355cd..be9f4fc69c 100644 --- a/pkg/models/logs.go +++ b/pkg/models/logs.go @@ -27,7 +27,6 @@ type Log struct { Timestamp uint64 ObservedTimestamp uint64 Offset uint64 - RawSize uint64 Contents LogContents } @@ -88,19 +87,6 @@ func (m *Log) SetOffset(offset uint64) { } } -func (m *Log) GetRawSize() uint64 { - if m != nil { - return m.RawSize - } - return 0 -} - -func (m *Log) SetRawSize(rawSize uint64) { - if m != nil { - m.RawSize = rawSize - } -} - func (m *Log) GetLevel() string { if m != nil { return m.Level diff --git a/pkg/protocol/log_event.pb.go b/pkg/protocol/log_event.pb.go deleted file mode 100644 index 17efa73e26..0000000000 --- a/pkg/protocol/log_event.pb.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: log_event.proto - -package protocol - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type LogEvent struct { - Timestamp uint64 `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` - Contents []*LogEvent_Content `protobuf:"bytes,2,rep,name=Contents,proto3" json:"Contents,omitempty"` - Level []byte `protobuf:"bytes,3,opt,name=Level,proto3" json:"Level,omitempty"` - FileOffset uint64 `protobuf:"varint,4,opt,name=FileOffset,proto3" json:"FileOffset,omitempty"` - RawSize uint64 `protobuf:"varint,5,opt,name=RawSize,proto3" json:"RawSize,omitempty"` -} - -func (m *LogEvent) Reset() { *m = LogEvent{} } -func (m *LogEvent) String() string { return proto.CompactTextString(m) } -func (*LogEvent) ProtoMessage() {} -func (*LogEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_9ab154f10bf01af7, []int{0} -} -func (m *LogEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogEvent.Merge(m, src) -} -func (m *LogEvent) XXX_Size() int { - return m.Size() -} -func (m *LogEvent) XXX_DiscardUnknown() { - xxx_messageInfo_LogEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_LogEvent proto.InternalMessageInfo - -func (m *LogEvent) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *LogEvent) GetContents() []*LogEvent_Content { - if m != nil { - return m.Contents - } - return nil -} - -func (m *LogEvent) GetLevel() []byte { - if m != nil { - return m.Level - } - return nil -} - -func (m *LogEvent) GetFileOffset() uint64 { - if m != nil { - return m.FileOffset - } - return 0 -} - -func (m *LogEvent) GetRawSize() uint64 { - if m != nil { - return m.RawSize - } - return 0 -} - -type LogEvent_Content struct { - Key []byte `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` - Value []byte `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` -} - -func (m *LogEvent_Content) Reset() { *m = LogEvent_Content{} } -func (m *LogEvent_Content) String() string { return proto.CompactTextString(m) } -func (*LogEvent_Content) ProtoMessage() {} -func (*LogEvent_Content) Descriptor() ([]byte, []int) { - return fileDescriptor_9ab154f10bf01af7, []int{0, 0} -} -func (m *LogEvent_Content) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LogEvent_Content) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LogEvent_Content.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *LogEvent_Content) XXX_Merge(src proto.Message) { - xxx_messageInfo_LogEvent_Content.Merge(m, src) -} -func (m *LogEvent_Content) XXX_Size() int { - return m.Size() -} -func (m *LogEvent_Content) XXX_DiscardUnknown() { - xxx_messageInfo_LogEvent_Content.DiscardUnknown(m) -} - -var xxx_messageInfo_LogEvent_Content proto.InternalMessageInfo - -func (m *LogEvent_Content) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *LogEvent_Content) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func init() { - proto.RegisterType((*LogEvent)(nil), "logtail.models.LogEvent") - proto.RegisterType((*LogEvent_Content)(nil), "logtail.models.LogEvent.Content") -} - -func init() { proto.RegisterFile("log_event.proto", fileDescriptor_9ab154f10bf01af7) } - -var fileDescriptor_9ab154f10bf01af7 = []byte{ - // 242 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xcf, 0xc9, 0x4f, 0x8f, - 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcb, 0xc9, 0x4f, - 0x2f, 0x49, 0xcc, 0xcc, 0xd1, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x56, 0x7a, 0xc9, 0xc8, 0xc5, - 0xe1, 0x93, 0x9f, 0xee, 0x0a, 0x52, 0x22, 0x24, 0xc3, 0xc5, 0x19, 0x92, 0x99, 0x9b, 0x5a, 0x5c, - 0x92, 0x98, 0x5b, 0x20, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x12, 0x84, 0x10, 0x10, 0xb2, 0xe1, 0xe2, - 0x70, 0xce, 0xcf, 0x2b, 0x49, 0xcd, 0x2b, 0x29, 0x96, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x36, 0x52, - 0xd0, 0x43, 0x35, 0x4d, 0x0f, 0x66, 0x92, 0x1e, 0x54, 0x61, 0x10, 0x5c, 0x87, 0x90, 0x08, 0x17, - 0xab, 0x4f, 0x6a, 0x59, 0x6a, 0x8e, 0x04, 0xb3, 0x02, 0xa3, 0x06, 0x4f, 0x10, 0x84, 0x23, 0x24, - 0xc7, 0xc5, 0xe5, 0x96, 0x99, 0x93, 0xea, 0x9f, 0x96, 0x56, 0x9c, 0x5a, 0x22, 0xc1, 0x02, 0xb6, - 0x12, 0x49, 0x44, 0x48, 0x82, 0x8b, 0x3d, 0x28, 0xb1, 0x3c, 0x38, 0xb3, 0x2a, 0x55, 0x82, 0x15, - 0x2c, 0x09, 0xe3, 0x4a, 0x19, 0x72, 0xb1, 0x43, 0xcd, 0x16, 0x12, 0xe0, 0x62, 0xf6, 0x4e, 0xad, - 0x04, 0x3b, 0x98, 0x27, 0x08, 0xc4, 0x04, 0x59, 0x16, 0x96, 0x98, 0x53, 0x9a, 0x2a, 0xc1, 0x04, - 0xb1, 0x0c, 0xcc, 0x71, 0x92, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, - 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x24, - 0x36, 0x70, 0xe0, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb9, 0xc8, 0x0b, 0xdc, 0x2f, 0x01, - 0x00, 0x00, -} - -func (m *LogEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LogEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RawSize != 0 { - i = encodeVarintLogEvent(dAtA, i, uint64(m.RawSize)) - i-- - dAtA[i] = 0x28 - } - if m.FileOffset != 0 { - i = encodeVarintLogEvent(dAtA, i, uint64(m.FileOffset)) - i-- - dAtA[i] = 0x20 - } - if len(m.Level) > 0 { - i -= len(m.Level) - copy(dAtA[i:], m.Level) - i = encodeVarintLogEvent(dAtA, i, uint64(len(m.Level))) - i-- - dAtA[i] = 0x1a - } - if len(m.Contents) > 0 { - for iNdEx := len(m.Contents) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Contents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLogEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.Timestamp != 0 { - i = encodeVarintLogEvent(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LogEvent_Content) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LogEvent_Content) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LogEvent_Content) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Value) > 0 { - i -= len(m.Value) - copy(dAtA[i:], m.Value) - i = encodeVarintLogEvent(dAtA, i, uint64(len(m.Value))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintLogEvent(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintLogEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovLogEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *LogEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Timestamp != 0 { - n += 1 + sovLogEvent(uint64(m.Timestamp)) - } - if len(m.Contents) > 0 { - for _, e := range m.Contents { - l = e.Size() - n += 1 + l + sovLogEvent(uint64(l)) - } - } - l = len(m.Level) - if l > 0 { - n += 1 + l + sovLogEvent(uint64(l)) - } - if m.FileOffset != 0 { - n += 1 + sovLogEvent(uint64(m.FileOffset)) - } - if m.RawSize != 0 { - n += 1 + sovLogEvent(uint64(m.RawSize)) - } - return n -} - -func (m *LogEvent_Content) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovLogEvent(uint64(l)) - } - l = len(m.Value) - if l > 0 { - n += 1 + l + sovLogEvent(uint64(l)) - } - return n -} - -func sovLogEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozLogEvent(x uint64) (n int) { - return sovLogEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *LogEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LogEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Contents", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLogEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLogEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Contents = append(m.Contents, &LogEvent_Content{}) - if err := m.Contents[len(m.Contents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Level", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthLogEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthLogEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Level = append(m.Level[:0], dAtA[iNdEx:postIndex]...) - if m.Level == nil { - m.Level = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field FileOffset", wireType) - } - m.FileOffset = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.FileOffset |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RawSize", wireType) - } - m.RawSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RawSize |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipLogEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LogEvent_Content) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Content: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Content: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthLogEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthLogEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLogEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthLogEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthLogEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) - if m.Value == nil { - m.Value = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLogEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLogEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipLogEvent(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowLogEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthLogEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupLogEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthLogEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthLogEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLogEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupLogEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/protocol/metric_event.pb.go b/pkg/protocol/metric_event.pb.go deleted file mode 100644 index e869f7f174..0000000000 --- a/pkg/protocol/metric_event.pb.go +++ /dev/null @@ -1,794 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: metric_event.proto - -package protocol - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type UntypedSingleValue struct { - Value float64 `protobuf:"fixed64,1,opt,name=Value,proto3" json:"Value,omitempty"` -} - -func (m *UntypedSingleValue) Reset() { *m = UntypedSingleValue{} } -func (m *UntypedSingleValue) String() string { return proto.CompactTextString(m) } -func (*UntypedSingleValue) ProtoMessage() {} -func (*UntypedSingleValue) Descriptor() ([]byte, []int) { - return fileDescriptor_7e0c5b3c1d4100c7, []int{0} -} -func (m *UntypedSingleValue) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UntypedSingleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UntypedSingleValue.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *UntypedSingleValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_UntypedSingleValue.Merge(m, src) -} -func (m *UntypedSingleValue) XXX_Size() int { - return m.Size() -} -func (m *UntypedSingleValue) XXX_DiscardUnknown() { - xxx_messageInfo_UntypedSingleValue.DiscardUnknown(m) -} - -var xxx_messageInfo_UntypedSingleValue proto.InternalMessageInfo - -func (m *UntypedSingleValue) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -type MetricEvent struct { - Timestamp uint64 `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` - Name []byte `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` - Tags map[string][]byte `protobuf:"bytes,3,rep,name=Tags,proto3" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Types that are valid to be assigned to Value: - // - // *MetricEvent_UntypedSingleValue - Value isMetricEvent_Value `protobuf_oneof:"Value"` -} - -func (m *MetricEvent) Reset() { *m = MetricEvent{} } -func (m *MetricEvent) String() string { return proto.CompactTextString(m) } -func (*MetricEvent) ProtoMessage() {} -func (*MetricEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_7e0c5b3c1d4100c7, []int{1} -} -func (m *MetricEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MetricEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricEvent.Merge(m, src) -} -func (m *MetricEvent) XXX_Size() int { - return m.Size() -} -func (m *MetricEvent) XXX_DiscardUnknown() { - xxx_messageInfo_MetricEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricEvent proto.InternalMessageInfo - -type isMetricEvent_Value interface { - isMetricEvent_Value() - MarshalTo([]byte) (int, error) - Size() int -} - -type MetricEvent_UntypedSingleValue struct { - UntypedSingleValue *UntypedSingleValue `protobuf:"bytes,4,opt,name=UntypedSingleValue,proto3,oneof" json:"UntypedSingleValue,omitempty"` -} - -func (*MetricEvent_UntypedSingleValue) isMetricEvent_Value() {} - -func (m *MetricEvent) GetValue() isMetricEvent_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *MetricEvent) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *MetricEvent) GetName() []byte { - if m != nil { - return m.Name - } - return nil -} - -func (m *MetricEvent) GetTags() map[string][]byte { - if m != nil { - return m.Tags - } - return nil -} - -func (m *MetricEvent) GetUntypedSingleValue() *UntypedSingleValue { - if x, ok := m.GetValue().(*MetricEvent_UntypedSingleValue); ok { - return x.UntypedSingleValue - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MetricEvent) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MetricEvent_UntypedSingleValue)(nil), - } -} - -func init() { - proto.RegisterType((*UntypedSingleValue)(nil), "logtail.models.UntypedSingleValue") - proto.RegisterType((*MetricEvent)(nil), "logtail.models.MetricEvent") - proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.MetricEvent.TagsEntry") -} - -func init() { proto.RegisterFile("metric_event.proto", fileDescriptor_7e0c5b3c1d4100c7) } - -var fileDescriptor_7e0c5b3c1d4100c7 = []byte{ - // 269 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x4d, 0x2d, 0x29, - 0xca, 0x4c, 0x8e, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, - 0xcb, 0xc9, 0x4f, 0x2f, 0x49, 0xcc, 0xcc, 0xd1, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x56, 0xd2, - 0xe2, 0x12, 0x0a, 0xcd, 0x2b, 0xa9, 0x2c, 0x48, 0x4d, 0x09, 0xce, 0xcc, 0x4b, 0xcf, 0x49, 0x0d, - 0x4b, 0xcc, 0x29, 0x4d, 0x15, 0x12, 0xe1, 0x62, 0x05, 0x33, 0x24, 0x18, 0x15, 0x18, 0x35, 0x18, - 0x83, 0x20, 0x1c, 0xa5, 0x49, 0x4c, 0x5c, 0xdc, 0xbe, 0x60, 0x23, 0x5d, 0x41, 0x26, 0x0a, 0xc9, - 0x70, 0x71, 0x86, 0x64, 0xe6, 0xa6, 0x16, 0x97, 0x24, 0xe6, 0x16, 0x80, 0x55, 0xb2, 0x04, 0x21, - 0x04, 0x84, 0x84, 0xb8, 0x58, 0xfc, 0x12, 0x73, 0x53, 0x25, 0x98, 0x14, 0x18, 0x35, 0x78, 0x82, - 0xc0, 0x6c, 0x21, 0x4b, 0x2e, 0x96, 0x90, 0xc4, 0xf4, 0x62, 0x09, 0x66, 0x05, 0x66, 0x0d, 0x6e, - 0x23, 0x55, 0x3d, 0x54, 0xc7, 0xe8, 0x21, 0x19, 0xae, 0x07, 0x52, 0xe7, 0x9a, 0x57, 0x52, 0x54, - 0x19, 0x04, 0xd6, 0x22, 0x14, 0x82, 0xcd, 0xa1, 0x12, 0x2c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x4a, - 0xe8, 0x06, 0x61, 0xaa, 0xf4, 0x60, 0x08, 0xc2, 0xa2, 0x5f, 0xca, 0x9c, 0x8b, 0x13, 0x6e, 0x91, - 0x90, 0x00, 0x17, 0x73, 0x76, 0x6a, 0x25, 0xd8, 0x27, 0x9c, 0x41, 0x20, 0x26, 0x28, 0x1c, 0xca, - 0xc0, 0xf6, 0x40, 0x3c, 0x01, 0xe1, 0x58, 0x31, 0x59, 0x30, 0x3a, 0xb1, 0x43, 0x43, 0xc8, 0x49, - 0xe2, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, - 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, 0x21, 0x6e, 0x0c, - 0x08, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x8c, 0xec, 0xc0, 0x87, 0x01, 0x00, 0x00, -} - -func (m *UntypedSingleValue) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *UntypedSingleValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UntypedSingleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *MetricEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MetricEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MetricEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Value != nil { - { - size := m.Value.Size() - i -= size - if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Tags) > 0 { - for k := range m.Tags { - v := m.Tags[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintMetricEvent(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintMetricEvent(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintMetricEvent(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintMetricEvent(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Timestamp != 0 { - i = encodeVarintMetricEvent(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MetricEvent_UntypedSingleValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MetricEvent_UntypedSingleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.UntypedSingleValue != nil { - { - size, err := m.UntypedSingleValue.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetricEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func encodeVarintMetricEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovMetricEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *UntypedSingleValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Value != 0 { - n += 9 - } - return n -} - -func (m *MetricEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Timestamp != 0 { - n += 1 + sovMetricEvent(uint64(m.Timestamp)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovMetricEvent(uint64(l)) - } - if len(m.Tags) > 0 { - for k, v := range m.Tags { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovMetricEvent(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovMetricEvent(uint64(len(k))) + l - n += mapEntrySize + 1 + sovMetricEvent(uint64(mapEntrySize)) - } - } - if m.Value != nil { - n += m.Value.Size() - } - return n -} - -func (m *MetricEvent_UntypedSingleValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.UntypedSingleValue != nil { - l = m.UntypedSingleValue.Size() - n += 1 + l + sovMetricEvent(uint64(l)) - } - return n -} - -func sovMetricEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozMetricEvent(x uint64) (n int) { - return sovMetricEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *UntypedSingleValue) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: UntypedSingleValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UntypedSingleValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipMetricEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MetricEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthMetricEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthMetricEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) - if m.Name == nil { - m.Name = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tags == nil { - m.Tags = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthMetricEvent - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthMetricEvent - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthMetricEvent - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthMetricEvent - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipMetricEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricEvent - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Tags[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UntypedSingleValue", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetricEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetricEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &UntypedSingleValue{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Value = &MetricEvent_UntypedSingleValue{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMetricEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthMetricEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipMetricEvent(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowMetricEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthMetricEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupMetricEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthMetricEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthMetricEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowMetricEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupMetricEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/protocol/pipeline_event_group.pb.go b/pkg/protocol/pipeline_event_group.pb.go deleted file mode 100644 index f9a1370cee..0000000000 --- a/pkg/protocol/pipeline_event_group.pb.go +++ /dev/null @@ -1,1438 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: pipeline_event_group.proto - -package protocol - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PipelineEventGroup struct { - Metadata map[string][]byte `protobuf:"bytes,1,rep,name=Metadata,proto3" json:"Metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Tags map[string][]byte `protobuf:"bytes,2,rep,name=Tags,proto3" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // Types that are valid to be assigned to PipelineEvents: - // *PipelineEventGroup_Logs - // *PipelineEventGroup_Metrics - // *PipelineEventGroup_Spans - PipelineEvents isPipelineEventGroup_PipelineEvents `protobuf_oneof:"PipelineEvents"` -} - -func (m *PipelineEventGroup) Reset() { *m = PipelineEventGroup{} } -func (m *PipelineEventGroup) String() string { return proto.CompactTextString(m) } -func (*PipelineEventGroup) ProtoMessage() {} -func (*PipelineEventGroup) Descriptor() ([]byte, []int) { - return fileDescriptor_4ac730b25d5b901f, []int{0} -} -func (m *PipelineEventGroup) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PipelineEventGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PipelineEventGroup.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PipelineEventGroup) XXX_Merge(src proto.Message) { - xxx_messageInfo_PipelineEventGroup.Merge(m, src) -} -func (m *PipelineEventGroup) XXX_Size() int { - return m.Size() -} -func (m *PipelineEventGroup) XXX_DiscardUnknown() { - xxx_messageInfo_PipelineEventGroup.DiscardUnknown(m) -} - -var xxx_messageInfo_PipelineEventGroup proto.InternalMessageInfo - -type isPipelineEventGroup_PipelineEvents interface { - isPipelineEventGroup_PipelineEvents() - MarshalTo([]byte) (int, error) - Size() int -} - -type PipelineEventGroup_Logs struct { - Logs *PipelineEventGroup_LogEvents `protobuf:"bytes,3,opt,name=Logs,proto3,oneof" json:"Logs,omitempty"` -} -type PipelineEventGroup_Metrics struct { - Metrics *PipelineEventGroup_MetricEvents `protobuf:"bytes,4,opt,name=Metrics,proto3,oneof" json:"Metrics,omitempty"` -} -type PipelineEventGroup_Spans struct { - Spans *PipelineEventGroup_SpanEvents `protobuf:"bytes,5,opt,name=Spans,proto3,oneof" json:"Spans,omitempty"` -} - -func (*PipelineEventGroup_Logs) isPipelineEventGroup_PipelineEvents() {} -func (*PipelineEventGroup_Metrics) isPipelineEventGroup_PipelineEvents() {} -func (*PipelineEventGroup_Spans) isPipelineEventGroup_PipelineEvents() {} - -func (m *PipelineEventGroup) GetPipelineEvents() isPipelineEventGroup_PipelineEvents { - if m != nil { - return m.PipelineEvents - } - return nil -} - -func (m *PipelineEventGroup) GetMetadata() map[string][]byte { - if m != nil { - return m.Metadata - } - return nil -} - -func (m *PipelineEventGroup) GetTags() map[string][]byte { - if m != nil { - return m.Tags - } - return nil -} - -func (m *PipelineEventGroup) GetLogs() *PipelineEventGroup_LogEvents { - if x, ok := m.GetPipelineEvents().(*PipelineEventGroup_Logs); ok { - return x.Logs - } - return nil -} - -func (m *PipelineEventGroup) GetMetrics() *PipelineEventGroup_MetricEvents { - if x, ok := m.GetPipelineEvents().(*PipelineEventGroup_Metrics); ok { - return x.Metrics - } - return nil -} - -func (m *PipelineEventGroup) GetSpans() *PipelineEventGroup_SpanEvents { - if x, ok := m.GetPipelineEvents().(*PipelineEventGroup_Spans); ok { - return x.Spans - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*PipelineEventGroup) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*PipelineEventGroup_Logs)(nil), - (*PipelineEventGroup_Metrics)(nil), - (*PipelineEventGroup_Spans)(nil), - } -} - -type PipelineEventGroup_LogEvents struct { - Events []*LogEvent `protobuf:"bytes,1,rep,name=Events,proto3" json:"Events,omitempty"` -} - -func (m *PipelineEventGroup_LogEvents) Reset() { *m = PipelineEventGroup_LogEvents{} } -func (m *PipelineEventGroup_LogEvents) String() string { return proto.CompactTextString(m) } -func (*PipelineEventGroup_LogEvents) ProtoMessage() {} -func (*PipelineEventGroup_LogEvents) Descriptor() ([]byte, []int) { - return fileDescriptor_4ac730b25d5b901f, []int{0, 2} -} -func (m *PipelineEventGroup_LogEvents) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PipelineEventGroup_LogEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PipelineEventGroup_LogEvents.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PipelineEventGroup_LogEvents) XXX_Merge(src proto.Message) { - xxx_messageInfo_PipelineEventGroup_LogEvents.Merge(m, src) -} -func (m *PipelineEventGroup_LogEvents) XXX_Size() int { - return m.Size() -} -func (m *PipelineEventGroup_LogEvents) XXX_DiscardUnknown() { - xxx_messageInfo_PipelineEventGroup_LogEvents.DiscardUnknown(m) -} - -var xxx_messageInfo_PipelineEventGroup_LogEvents proto.InternalMessageInfo - -func (m *PipelineEventGroup_LogEvents) GetEvents() []*LogEvent { - if m != nil { - return m.Events - } - return nil -} - -type PipelineEventGroup_MetricEvents struct { - Events []*MetricEvent `protobuf:"bytes,1,rep,name=Events,proto3" json:"Events,omitempty"` -} - -func (m *PipelineEventGroup_MetricEvents) Reset() { *m = PipelineEventGroup_MetricEvents{} } -func (m *PipelineEventGroup_MetricEvents) String() string { return proto.CompactTextString(m) } -func (*PipelineEventGroup_MetricEvents) ProtoMessage() {} -func (*PipelineEventGroup_MetricEvents) Descriptor() ([]byte, []int) { - return fileDescriptor_4ac730b25d5b901f, []int{0, 3} -} -func (m *PipelineEventGroup_MetricEvents) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PipelineEventGroup_MetricEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PipelineEventGroup_MetricEvents.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PipelineEventGroup_MetricEvents) XXX_Merge(src proto.Message) { - xxx_messageInfo_PipelineEventGroup_MetricEvents.Merge(m, src) -} -func (m *PipelineEventGroup_MetricEvents) XXX_Size() int { - return m.Size() -} -func (m *PipelineEventGroup_MetricEvents) XXX_DiscardUnknown() { - xxx_messageInfo_PipelineEventGroup_MetricEvents.DiscardUnknown(m) -} - -var xxx_messageInfo_PipelineEventGroup_MetricEvents proto.InternalMessageInfo - -func (m *PipelineEventGroup_MetricEvents) GetEvents() []*MetricEvent { - if m != nil { - return m.Events - } - return nil -} - -type PipelineEventGroup_SpanEvents struct { - Events []*SpanEvent `protobuf:"bytes,1,rep,name=Events,proto3" json:"Events,omitempty"` -} - -func (m *PipelineEventGroup_SpanEvents) Reset() { *m = PipelineEventGroup_SpanEvents{} } -func (m *PipelineEventGroup_SpanEvents) String() string { return proto.CompactTextString(m) } -func (*PipelineEventGroup_SpanEvents) ProtoMessage() {} -func (*PipelineEventGroup_SpanEvents) Descriptor() ([]byte, []int) { - return fileDescriptor_4ac730b25d5b901f, []int{0, 4} -} -func (m *PipelineEventGroup_SpanEvents) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *PipelineEventGroup_SpanEvents) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PipelineEventGroup_SpanEvents.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *PipelineEventGroup_SpanEvents) XXX_Merge(src proto.Message) { - xxx_messageInfo_PipelineEventGroup_SpanEvents.Merge(m, src) -} -func (m *PipelineEventGroup_SpanEvents) XXX_Size() int { - return m.Size() -} -func (m *PipelineEventGroup_SpanEvents) XXX_DiscardUnknown() { - xxx_messageInfo_PipelineEventGroup_SpanEvents.DiscardUnknown(m) -} - -var xxx_messageInfo_PipelineEventGroup_SpanEvents proto.InternalMessageInfo - -func (m *PipelineEventGroup_SpanEvents) GetEvents() []*SpanEvent { - if m != nil { - return m.Events - } - return nil -} - -func init() { - proto.RegisterType((*PipelineEventGroup)(nil), "logtail.models.PipelineEventGroup") - proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.PipelineEventGroup.MetadataEntry") - proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.PipelineEventGroup.TagsEntry") - proto.RegisterType((*PipelineEventGroup_LogEvents)(nil), "logtail.models.PipelineEventGroup.LogEvents") - proto.RegisterType((*PipelineEventGroup_MetricEvents)(nil), "logtail.models.PipelineEventGroup.MetricEvents") - proto.RegisterType((*PipelineEventGroup_SpanEvents)(nil), "logtail.models.PipelineEventGroup.SpanEvents") -} - -func init() { proto.RegisterFile("pipeline_event_group.proto", fileDescriptor_4ac730b25d5b901f) } - -var fileDescriptor_4ac730b25d5b901f = []byte{ - // 378 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x4a, 0xeb, 0x40, - 0x14, 0x86, 0x33, 0x6d, 0xd3, 0x7b, 0x7b, 0xac, 0xb5, 0x0c, 0x2e, 0xc6, 0x08, 0x21, 0xb8, 0xea, - 0x42, 0x63, 0xb5, 0x0b, 0x45, 0x11, 0xa5, 0x52, 0x14, 0x6c, 0x41, 0xa2, 0xfb, 0x32, 0xb6, 0x43, - 0x08, 0xa6, 0x99, 0x90, 0x49, 0x0b, 0x7d, 0x0b, 0x1f, 0x4b, 0x77, 0x5d, 0xba, 0x94, 0xf6, 0x45, - 0x24, 0x93, 0x26, 0x36, 0x71, 0x13, 0x77, 0x33, 0x87, 0xef, 0xff, 0x0e, 0xf3, 0x27, 0xa0, 0xf9, - 0x8e, 0xcf, 0x5c, 0xc7, 0x63, 0x43, 0x36, 0x63, 0x5e, 0x38, 0xb4, 0x03, 0x3e, 0xf5, 0x4d, 0x3f, - 0xe0, 0x21, 0xc7, 0x0d, 0x97, 0xdb, 0x21, 0x75, 0x5c, 0x73, 0xc2, 0xc7, 0xcc, 0x15, 0xda, 0x8e, - 0xcb, 0xed, 0x18, 0x8b, 0x01, 0x0d, 0x4f, 0x58, 0x18, 0x38, 0xa3, 0xcc, 0xac, 0x29, 0x7c, 0xea, - 0x6d, 0x4e, 0x0e, 0x3e, 0x54, 0xc0, 0x8f, 0xeb, 0x2d, 0xbd, 0x68, 0x7e, 0x17, 0xed, 0xc0, 0x7d, - 0xf8, 0x3f, 0x60, 0x21, 0x1d, 0xd3, 0x90, 0x12, 0x64, 0x94, 0x5b, 0x5b, 0xa7, 0x6d, 0x33, 0xbb, - 0xd0, 0xfc, 0x9d, 0x32, 0x93, 0x48, 0xcf, 0x0b, 0x83, 0xb9, 0x95, 0x1a, 0xf0, 0x0d, 0x54, 0x9e, - 0xa9, 0x2d, 0x48, 0x49, 0x9a, 0x0e, 0x0b, 0x98, 0x22, 0x3c, 0xb6, 0xc8, 0x24, 0xee, 0x42, 0xa5, - 0xcf, 0x6d, 0x41, 0xca, 0x06, 0x2a, 0x68, 0xe8, 0x73, 0x5b, 0xde, 0xc4, 0xbd, 0x62, 0xc9, 0x2c, - 0x7e, 0x80, 0x7f, 0x03, 0x59, 0x89, 0x20, 0x15, 0xa9, 0x39, 0x2e, 0xf6, 0xa4, 0xc0, 0x19, 0xa5, - 0xa6, 0xc4, 0x80, 0x7b, 0xa0, 0x3e, 0xf9, 0xd4, 0x13, 0x44, 0x95, 0xaa, 0xa3, 0x02, 0xaa, 0x88, - 0x4f, 0x45, 0x71, 0x5a, 0xbb, 0x84, 0xed, 0x4c, 0x69, 0xb8, 0x09, 0xe5, 0x57, 0x36, 0x27, 0xc8, - 0x40, 0xad, 0x9a, 0x15, 0x1d, 0xf1, 0x2e, 0xa8, 0x33, 0xea, 0x4e, 0x19, 0x29, 0x19, 0xa8, 0x55, - 0xb7, 0xe2, 0xcb, 0x45, 0xe9, 0x1c, 0x69, 0x67, 0x50, 0x4b, 0x7b, 0xfa, 0x53, 0xf0, 0x0a, 0x6a, - 0x69, 0x3d, 0xb8, 0x0d, 0xd5, 0xf8, 0xb4, 0xfe, 0xd0, 0x24, 0xff, 0x94, 0x04, 0xb5, 0xd6, 0x9c, - 0x76, 0x0b, 0xf5, 0xcd, 0x5a, 0x70, 0x27, 0x67, 0xd8, 0xcf, 0x1b, 0x36, 0xe8, 0x54, 0x72, 0x0d, - 0xf0, 0x53, 0x08, 0x3e, 0xc9, 0x29, 0xf6, 0xf2, 0x8a, 0x94, 0x4d, 0x04, 0xdd, 0x26, 0x34, 0x32, - 0x25, 0x8b, 0x2e, 0x79, 0x5f, 0xea, 0x68, 0xb1, 0xd4, 0xd1, 0xd7, 0x52, 0x47, 0x6f, 0x2b, 0x5d, - 0x59, 0xac, 0x74, 0xe5, 0x73, 0xa5, 0x2b, 0x2f, 0x55, 0xf9, 0xb3, 0x77, 0xbe, 0x03, 0x00, 0x00, - 0xff, 0xff, 0xb5, 0x6e, 0xbc, 0x2a, 0x51, 0x03, 0x00, 0x00, -} - -func (m *PipelineEventGroup) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PipelineEventGroup) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PipelineEventGroup) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.PipelineEvents != nil { - { - size := m.PipelineEvents.Size() - i -= size - if _, err := m.PipelineEvents.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - if len(m.Tags) > 0 { - for k := range m.Tags { - v := m.Tags[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x12 - } - } - if len(m.Metadata) > 0 { - for k := range m.Metadata { - v := m.Metadata[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *PipelineEventGroup_Logs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PipelineEventGroup_Logs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Logs != nil { - { - size, err := m.Logs.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} -func (m *PipelineEventGroup_Metrics) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PipelineEventGroup_Metrics) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Metrics != nil { - { - size, err := m.Metrics.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} -func (m *PipelineEventGroup_Spans) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PipelineEventGroup_Spans) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Spans != nil { - { - size, err := m.Spans.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} -func (m *PipelineEventGroup_LogEvents) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PipelineEventGroup_LogEvents) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PipelineEventGroup_LogEvents) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *PipelineEventGroup_MetricEvents) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PipelineEventGroup_MetricEvents) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PipelineEventGroup_MetricEvents) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *PipelineEventGroup_SpanEvents) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PipelineEventGroup_SpanEvents) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PipelineEventGroup_SpanEvents) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPipelineEventGroup(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintPipelineEventGroup(dAtA []byte, offset int, v uint64) int { - offset -= sovPipelineEventGroup(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *PipelineEventGroup) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Metadata) > 0 { - for k, v := range m.Metadata { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovPipelineEventGroup(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovPipelineEventGroup(uint64(len(k))) + l - n += mapEntrySize + 1 + sovPipelineEventGroup(uint64(mapEntrySize)) - } - } - if len(m.Tags) > 0 { - for k, v := range m.Tags { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovPipelineEventGroup(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovPipelineEventGroup(uint64(len(k))) + l - n += mapEntrySize + 1 + sovPipelineEventGroup(uint64(mapEntrySize)) - } - } - if m.PipelineEvents != nil { - n += m.PipelineEvents.Size() - } - return n -} - -func (m *PipelineEventGroup_Logs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Logs != nil { - l = m.Logs.Size() - n += 1 + l + sovPipelineEventGroup(uint64(l)) - } - return n -} -func (m *PipelineEventGroup_Metrics) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Metrics != nil { - l = m.Metrics.Size() - n += 1 + l + sovPipelineEventGroup(uint64(l)) - } - return n -} -func (m *PipelineEventGroup_Spans) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Spans != nil { - l = m.Spans.Size() - n += 1 + l + sovPipelineEventGroup(uint64(l)) - } - return n -} -func (m *PipelineEventGroup_LogEvents) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovPipelineEventGroup(uint64(l)) - } - } - return n -} - -func (m *PipelineEventGroup_MetricEvents) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovPipelineEventGroup(uint64(l)) - } - } - return n -} - -func (m *PipelineEventGroup_SpanEvents) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovPipelineEventGroup(uint64(l)) - } - } - return n -} - -func sovPipelineEventGroup(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozPipelineEventGroup(x uint64) (n int) { - return sovPipelineEventGroup(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PipelineEventGroup) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PipelineEventGroup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PipelineEventGroup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Metadata == nil { - m.Metadata = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipPipelineEventGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Metadata[mapkey] = mapvalue - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tags == nil { - m.Tags = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipPipelineEventGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Tags[mapkey] = mapvalue - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PipelineEventGroup_LogEvents{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.PipelineEvents = &PipelineEventGroup_Logs{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PipelineEventGroup_MetricEvents{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.PipelineEvents = &PipelineEventGroup_Metrics{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spans", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PipelineEventGroup_SpanEvents{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.PipelineEvents = &PipelineEventGroup_Spans{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPipelineEventGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PipelineEventGroup_LogEvents) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LogEvents: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LogEvents: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, &LogEvent{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPipelineEventGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PipelineEventGroup_MetricEvents) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MetricEvents: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricEvents: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, &MetricEvent{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPipelineEventGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PipelineEventGroup_SpanEvents) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SpanEvents: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SpanEvents: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPipelineEventGroup - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, &SpanEvent{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPipelineEventGroup(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPipelineEventGroup - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipPipelineEventGroup(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowPipelineEventGroup - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthPipelineEventGroup - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPipelineEventGroup - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPipelineEventGroup - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPipelineEventGroup = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPipelineEventGroup = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPipelineEventGroup = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/protocol/proto/genernate.sh b/pkg/protocol/proto/genernate.sh index 0540fac97e..22d1b9a97e 100755 --- a/pkg/protocol/proto/genernate.sh +++ b/pkg/protocol/proto/genernate.sh @@ -10,4 +10,4 @@ export PATH=$PATH:$GOPATH/bin protoc -I="${PROTO_HOME}" \ -I="${GOPATH}/src" \ - --gogofaster_out=plugins=grpc:"${PROTO_GEN_HOME}" "${PROTO_HOME}"/*.proto + --gogofaster_out=plugins=grpc:"${PROTO_GEN_HOME}" "${PROTO_HOME}"/*.proto \ No newline at end of file diff --git a/pkg/protocol/proto/log_event.proto b/pkg/protocol/proto/log_event.proto deleted file mode 100644 index 5fdfaaa38c..0000000000 --- a/pkg/protocol/proto/log_event.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -package logtail.models; - -message LogEvent { - uint64 Timestamp = 1; - message Content { - bytes Key = 1; - bytes Value = 2; - } - repeated Content Contents= 2; - bytes Level = 3; - uint64 FileOffset = 4; - uint64 RawSize = 5; -} diff --git a/pkg/protocol/proto/metric_event.proto b/pkg/protocol/proto/metric_event.proto deleted file mode 100644 index 144c628139..0000000000 --- a/pkg/protocol/proto/metric_event.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package logtail.models; - -message UntypedSingleValue { - double Value = 1; -} - -message MetricEvent { - uint64 Timestamp = 1; - bytes Name = 2; - map Tags = 3; - oneof Value { - UntypedSingleValue UntypedSingleValue = 4; - } -} diff --git a/pkg/protocol/proto/pipeline_event_group.proto b/pkg/protocol/proto/pipeline_event_group.proto deleted file mode 100644 index 580fbf08b6..0000000000 --- a/pkg/protocol/proto/pipeline_event_group.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package logtail.models; - -import "log_event.proto"; -import "metric_event.proto"; -import "span_event.proto"; - -message PipelineEventGroup { - map Metadata = 1; - map Tags = 2; - message LogEvents { - repeated LogEvent Events = 1; - } - message MetricEvents { - repeated MetricEvent Events = 1; - } - message SpanEvents { - repeated SpanEvent Events = 1; - } - oneof PipelineEvents { - LogEvents Logs = 3; - MetricEvents Metrics = 4; - SpanEvents Spans = 5; - } -} diff --git a/pkg/protocol/proto/span_event.proto b/pkg/protocol/proto/span_event.proto deleted file mode 100644 index 6926511d60..0000000000 --- a/pkg/protocol/proto/span_event.proto +++ /dev/null @@ -1,43 +0,0 @@ -syntax = "proto3"; -package logtail.models; - -message SpanEvent { - uint64 Timestamp = 1; - bytes TraceID = 2; - bytes SpanID = 3; - bytes TraceState = 4; - bytes ParentSpanID = 5; - bytes Name = 6; - enum SpanKind { - UNSPECIFIED = 0; - INTERVAL = 1; - SERVER = 2; - CLIENT = 3; - PRODUCER = 4; - CONSUMER = 5; - } - SpanKind Kind = 7; - uint64 StartTime = 8; - uint64 EndTime = 9; - map Tags = 10; - message InnerEvent { - uint64 Timestamp = 1; - bytes Name = 2; - map Tags = 3; - } - repeated InnerEvent Events = 11; - message SpanLink { - bytes TraceID = 1; - bytes SpanID = 2; - bytes TraceState = 3; - map Tags = 4; - } - repeated SpanLink Links = 12; - enum StatusCode { - Unset = 0; - Ok = 1; - Error = 2; - } - StatusCode Status = 13; - map ScopeTags = 14; -} diff --git a/pkg/protocol/span_event.pb.go b/pkg/protocol/span_event.pb.go deleted file mode 100644 index 9661599cec..0000000000 --- a/pkg/protocol/span_event.pb.go +++ /dev/null @@ -1,2085 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: span_event.proto - -package protocol - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type SpanEvent_SpanKind int32 - -const ( - SpanEvent_UNSPECIFIED SpanEvent_SpanKind = 0 - SpanEvent_INTERVAL SpanEvent_SpanKind = 1 - SpanEvent_SERVER SpanEvent_SpanKind = 2 - SpanEvent_CLIENT SpanEvent_SpanKind = 3 - SpanEvent_PRODUCER SpanEvent_SpanKind = 4 - SpanEvent_CONSUMER SpanEvent_SpanKind = 5 -) - -var SpanEvent_SpanKind_name = map[int32]string{ - 0: "UNSPECIFIED", - 1: "INTERVAL", - 2: "SERVER", - 3: "CLIENT", - 4: "PRODUCER", - 5: "CONSUMER", -} - -var SpanEvent_SpanKind_value = map[string]int32{ - "UNSPECIFIED": 0, - "INTERVAL": 1, - "SERVER": 2, - "CLIENT": 3, - "PRODUCER": 4, - "CONSUMER": 5, -} - -func (x SpanEvent_SpanKind) String() string { - return proto.EnumName(SpanEvent_SpanKind_name, int32(x)) -} - -func (SpanEvent_SpanKind) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_58e662b1dc3fbc9c, []int{0, 0} -} - -type SpanEvent_StatusCode int32 - -const ( - SpanEvent_Unset SpanEvent_StatusCode = 0 - SpanEvent_Ok SpanEvent_StatusCode = 1 - SpanEvent_Error SpanEvent_StatusCode = 2 -) - -var SpanEvent_StatusCode_name = map[int32]string{ - 0: "Unset", - 1: "Ok", - 2: "Error", -} - -var SpanEvent_StatusCode_value = map[string]int32{ - "Unset": 0, - "Ok": 1, - "Error": 2, -} - -func (x SpanEvent_StatusCode) String() string { - return proto.EnumName(SpanEvent_StatusCode_name, int32(x)) -} - -func (SpanEvent_StatusCode) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_58e662b1dc3fbc9c, []int{0, 1} -} - -type SpanEvent struct { - Timestamp uint64 `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` - TraceID []byte `protobuf:"bytes,2,opt,name=TraceID,proto3" json:"TraceID,omitempty"` - SpanID []byte `protobuf:"bytes,3,opt,name=SpanID,proto3" json:"SpanID,omitempty"` - TraceState []byte `protobuf:"bytes,4,opt,name=TraceState,proto3" json:"TraceState,omitempty"` - ParentSpanID []byte `protobuf:"bytes,5,opt,name=ParentSpanID,proto3" json:"ParentSpanID,omitempty"` - Name []byte `protobuf:"bytes,6,opt,name=Name,proto3" json:"Name,omitempty"` - Kind SpanEvent_SpanKind `protobuf:"varint,7,opt,name=Kind,proto3,enum=logtail.models.SpanEvent_SpanKind" json:"Kind,omitempty"` - StartTime uint64 `protobuf:"varint,8,opt,name=StartTime,proto3" json:"StartTime,omitempty"` - EndTime uint64 `protobuf:"varint,9,opt,name=EndTime,proto3" json:"EndTime,omitempty"` - Tags map[string][]byte `protobuf:"bytes,10,rep,name=Tags,proto3" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Events []*SpanEvent_InnerEvent `protobuf:"bytes,11,rep,name=Events,proto3" json:"Events,omitempty"` - Links []*SpanEvent_SpanLink `protobuf:"bytes,12,rep,name=Links,proto3" json:"Links,omitempty"` - Status SpanEvent_StatusCode `protobuf:"varint,13,opt,name=Status,proto3,enum=logtail.models.SpanEvent_StatusCode" json:"Status,omitempty"` - ScopeTags map[string][]byte `protobuf:"bytes,14,rep,name=ScopeTags,proto3" json:"ScopeTags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *SpanEvent) Reset() { *m = SpanEvent{} } -func (m *SpanEvent) String() string { return proto.CompactTextString(m) } -func (*SpanEvent) ProtoMessage() {} -func (*SpanEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_58e662b1dc3fbc9c, []int{0} -} -func (m *SpanEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SpanEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SpanEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SpanEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpanEvent.Merge(m, src) -} -func (m *SpanEvent) XXX_Size() int { - return m.Size() -} -func (m *SpanEvent) XXX_DiscardUnknown() { - xxx_messageInfo_SpanEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_SpanEvent proto.InternalMessageInfo - -func (m *SpanEvent) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *SpanEvent) GetTraceID() []byte { - if m != nil { - return m.TraceID - } - return nil -} - -func (m *SpanEvent) GetSpanID() []byte { - if m != nil { - return m.SpanID - } - return nil -} - -func (m *SpanEvent) GetTraceState() []byte { - if m != nil { - return m.TraceState - } - return nil -} - -func (m *SpanEvent) GetParentSpanID() []byte { - if m != nil { - return m.ParentSpanID - } - return nil -} - -func (m *SpanEvent) GetName() []byte { - if m != nil { - return m.Name - } - return nil -} - -func (m *SpanEvent) GetKind() SpanEvent_SpanKind { - if m != nil { - return m.Kind - } - return SpanEvent_UNSPECIFIED -} - -func (m *SpanEvent) GetStartTime() uint64 { - if m != nil { - return m.StartTime - } - return 0 -} - -func (m *SpanEvent) GetEndTime() uint64 { - if m != nil { - return m.EndTime - } - return 0 -} - -func (m *SpanEvent) GetTags() map[string][]byte { - if m != nil { - return m.Tags - } - return nil -} - -func (m *SpanEvent) GetEvents() []*SpanEvent_InnerEvent { - if m != nil { - return m.Events - } - return nil -} - -func (m *SpanEvent) GetLinks() []*SpanEvent_SpanLink { - if m != nil { - return m.Links - } - return nil -} - -func (m *SpanEvent) GetStatus() SpanEvent_StatusCode { - if m != nil { - return m.Status - } - return SpanEvent_Unset -} - -func (m *SpanEvent) GetScopeTags() map[string][]byte { - if m != nil { - return m.ScopeTags - } - return nil -} - -type SpanEvent_InnerEvent struct { - Timestamp uint64 `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` - Name []byte `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` - Tags map[string][]byte `protobuf:"bytes,3,rep,name=Tags,proto3" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *SpanEvent_InnerEvent) Reset() { *m = SpanEvent_InnerEvent{} } -func (m *SpanEvent_InnerEvent) String() string { return proto.CompactTextString(m) } -func (*SpanEvent_InnerEvent) ProtoMessage() {} -func (*SpanEvent_InnerEvent) Descriptor() ([]byte, []int) { - return fileDescriptor_58e662b1dc3fbc9c, []int{0, 1} -} -func (m *SpanEvent_InnerEvent) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SpanEvent_InnerEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SpanEvent_InnerEvent.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SpanEvent_InnerEvent) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpanEvent_InnerEvent.Merge(m, src) -} -func (m *SpanEvent_InnerEvent) XXX_Size() int { - return m.Size() -} -func (m *SpanEvent_InnerEvent) XXX_DiscardUnknown() { - xxx_messageInfo_SpanEvent_InnerEvent.DiscardUnknown(m) -} - -var xxx_messageInfo_SpanEvent_InnerEvent proto.InternalMessageInfo - -func (m *SpanEvent_InnerEvent) GetTimestamp() uint64 { - if m != nil { - return m.Timestamp - } - return 0 -} - -func (m *SpanEvent_InnerEvent) GetName() []byte { - if m != nil { - return m.Name - } - return nil -} - -func (m *SpanEvent_InnerEvent) GetTags() map[string][]byte { - if m != nil { - return m.Tags - } - return nil -} - -type SpanEvent_SpanLink struct { - TraceID []byte `protobuf:"bytes,1,opt,name=TraceID,proto3" json:"TraceID,omitempty"` - SpanID []byte `protobuf:"bytes,2,opt,name=SpanID,proto3" json:"SpanID,omitempty"` - TraceState []byte `protobuf:"bytes,3,opt,name=TraceState,proto3" json:"TraceState,omitempty"` - Tags map[string][]byte `protobuf:"bytes,4,rep,name=Tags,proto3" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *SpanEvent_SpanLink) Reset() { *m = SpanEvent_SpanLink{} } -func (m *SpanEvent_SpanLink) String() string { return proto.CompactTextString(m) } -func (*SpanEvent_SpanLink) ProtoMessage() {} -func (*SpanEvent_SpanLink) Descriptor() ([]byte, []int) { - return fileDescriptor_58e662b1dc3fbc9c, []int{0, 2} -} -func (m *SpanEvent_SpanLink) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SpanEvent_SpanLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SpanEvent_SpanLink.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SpanEvent_SpanLink) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpanEvent_SpanLink.Merge(m, src) -} -func (m *SpanEvent_SpanLink) XXX_Size() int { - return m.Size() -} -func (m *SpanEvent_SpanLink) XXX_DiscardUnknown() { - xxx_messageInfo_SpanEvent_SpanLink.DiscardUnknown(m) -} - -var xxx_messageInfo_SpanEvent_SpanLink proto.InternalMessageInfo - -func (m *SpanEvent_SpanLink) GetTraceID() []byte { - if m != nil { - return m.TraceID - } - return nil -} - -func (m *SpanEvent_SpanLink) GetSpanID() []byte { - if m != nil { - return m.SpanID - } - return nil -} - -func (m *SpanEvent_SpanLink) GetTraceState() []byte { - if m != nil { - return m.TraceState - } - return nil -} - -func (m *SpanEvent_SpanLink) GetTags() map[string][]byte { - if m != nil { - return m.Tags - } - return nil -} - -func init() { - proto.RegisterEnum("logtail.models.SpanEvent_SpanKind", SpanEvent_SpanKind_name, SpanEvent_SpanKind_value) - proto.RegisterEnum("logtail.models.SpanEvent_StatusCode", SpanEvent_StatusCode_name, SpanEvent_StatusCode_value) - proto.RegisterType((*SpanEvent)(nil), "logtail.models.SpanEvent") - proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.SpanEvent.ScopeTagsEntry") - proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.SpanEvent.TagsEntry") - proto.RegisterType((*SpanEvent_InnerEvent)(nil), "logtail.models.SpanEvent.InnerEvent") - proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.SpanEvent.InnerEvent.TagsEntry") - proto.RegisterType((*SpanEvent_SpanLink)(nil), "logtail.models.SpanEvent.SpanLink") - proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.SpanEvent.SpanLink.TagsEntry") -} - -func init() { proto.RegisterFile("span_event.proto", fileDescriptor_58e662b1dc3fbc9c) } - -var fileDescriptor_58e662b1dc3fbc9c = []byte{ - // 570 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x8a, 0xd3, 0x50, - 0x14, 0xee, 0x4d, 0xd2, 0x4c, 0x73, 0x5a, 0x6b, 0xb8, 0x88, 0x5c, 0x06, 0x09, 0xa5, 0xba, 0x28, - 0x22, 0x5d, 0x8c, 0xe0, 0x0c, 0x32, 0x0b, 0x9d, 0xf6, 0x0e, 0x04, 0x6b, 0x5b, 0x6e, 0xda, 0xd9, - 0x89, 0xc4, 0xe9, 0x65, 0x28, 0x6d, 0x93, 0x92, 0x64, 0x06, 0xe6, 0x2d, 0x7c, 0x1f, 0x5f, 0xc0, - 0xe5, 0xec, 0x74, 0x29, 0xed, 0x2b, 0xf8, 0x00, 0x72, 0x4f, 0xd2, 0x3f, 0xa5, 0xad, 0xca, 0xec, - 0xce, 0xcf, 0xf7, 0xe5, 0xdc, 0xef, 0xfc, 0x04, 0xec, 0x78, 0xea, 0x07, 0x1f, 0xe5, 0x8d, 0x0c, - 0x92, 0xfa, 0x34, 0x0a, 0x93, 0x90, 0x96, 0xc7, 0xe1, 0x55, 0xe2, 0x0f, 0xc7, 0xf5, 0x49, 0x38, - 0x90, 0xe3, 0xb8, 0xfa, 0xd3, 0x02, 0xcb, 0x9b, 0xfa, 0x01, 0x57, 0x18, 0xfa, 0x04, 0xac, 0xde, - 0x70, 0x22, 0xe3, 0xc4, 0x9f, 0x4c, 0x19, 0xa9, 0x90, 0x9a, 0x21, 0x56, 0x01, 0xca, 0xe0, 0xa0, - 0x17, 0xf9, 0x97, 0xd2, 0x6d, 0x32, 0xad, 0x42, 0x6a, 0x25, 0xb1, 0x70, 0xe9, 0x63, 0x30, 0xd5, - 0x47, 0xdc, 0x26, 0xd3, 0x31, 0x91, 0x79, 0xd4, 0x01, 0x40, 0x88, 0x97, 0xf8, 0x89, 0x64, 0x06, - 0xe6, 0xd6, 0x22, 0xb4, 0x0a, 0xa5, 0xae, 0x1f, 0xc9, 0x20, 0xc9, 0xd8, 0x79, 0x44, 0x6c, 0xc4, - 0x28, 0x05, 0xa3, 0xed, 0x4f, 0x24, 0x33, 0x31, 0x87, 0x36, 0x7d, 0x05, 0xc6, 0xbb, 0x61, 0x30, - 0x60, 0x07, 0x15, 0x52, 0x2b, 0x1f, 0x55, 0xeb, 0x9b, 0xa2, 0xea, 0x4b, 0x41, 0x68, 0x29, 0xa4, - 0x40, 0xbc, 0xd2, 0xe7, 0x25, 0x7e, 0x94, 0x28, 0x4d, 0xac, 0x90, 0xea, 0x5b, 0x06, 0x94, 0x3e, - 0x1e, 0x0c, 0x30, 0x67, 0x61, 0x6e, 0xe1, 0xd2, 0x63, 0x30, 0x7a, 0xfe, 0x55, 0xcc, 0xa0, 0xa2, - 0xd7, 0x8a, 0x47, 0x4f, 0xb7, 0xd7, 0x53, 0x28, 0x1e, 0x24, 0xd1, 0xad, 0x40, 0x02, 0x3d, 0x05, - 0x13, 0x13, 0x31, 0x2b, 0x22, 0xf5, 0xd9, 0x76, 0xaa, 0x1b, 0x04, 0x32, 0x42, 0x53, 0x64, 0x1c, - 0x7a, 0x02, 0xf9, 0xd6, 0x30, 0x18, 0xc5, 0xac, 0x84, 0xe4, 0x3d, 0x3a, 0x15, 0x54, 0xa4, 0x04, - 0x55, 0x57, 0x75, 0xf8, 0x3a, 0x66, 0x0f, 0xb0, 0x45, 0x3b, 0xea, 0xa6, 0xb8, 0x46, 0x38, 0x90, - 0x22, 0xe3, 0xd0, 0x73, 0xb0, 0xbc, 0xcb, 0x70, 0x2a, 0x51, 0x73, 0x19, 0x6b, 0xd7, 0x76, 0x7c, - 0x60, 0x01, 0x4d, 0x85, 0xaf, 0xa8, 0x87, 0xc7, 0x60, 0x2d, 0xe3, 0xd4, 0x06, 0x7d, 0x24, 0x6f, - 0x71, 0xab, 0x2c, 0xa1, 0x4c, 0xfa, 0x08, 0xf2, 0x37, 0xfe, 0xf8, 0x5a, 0x66, 0xdb, 0x94, 0x3a, - 0xaf, 0xb5, 0x13, 0x72, 0xf8, 0x85, 0x00, 0xac, 0xfa, 0xb1, 0x67, 0x2d, 0x17, 0x0b, 0xa2, 0xad, - 0x2d, 0xc8, 0x59, 0x36, 0x30, 0x1d, 0x1f, 0x5f, 0xff, 0x9b, 0xae, 0xff, 0x3e, 0xbb, 0xff, 0x7f, - 0xfd, 0x37, 0x02, 0x85, 0xc5, 0x40, 0xd6, 0x8f, 0x86, 0x6c, 0x3b, 0x1a, 0x6d, 0xc7, 0xd1, 0xe8, - 0x7f, 0x1c, 0xcd, 0x9b, 0x4c, 0x9b, 0x81, 0xda, 0x5e, 0xec, 0x5f, 0x8a, 0xfb, 0x53, 0x76, 0x0a, - 0xe5, 0xcd, 0x69, 0xff, 0x0b, 0xbb, 0xfa, 0x21, 0x6d, 0x0b, 0x5e, 0xe2, 0x43, 0x28, 0xf6, 0xdb, - 0x5e, 0x97, 0x37, 0xdc, 0x73, 0x97, 0x37, 0xed, 0x1c, 0x2d, 0x41, 0xc1, 0x6d, 0xf7, 0xb8, 0xb8, - 0x78, 0xdb, 0xb2, 0x09, 0x05, 0x30, 0x3d, 0x2e, 0x2e, 0xb8, 0xb0, 0x35, 0x65, 0x37, 0x5a, 0x2e, - 0x6f, 0xf7, 0x6c, 0x5d, 0xa1, 0xba, 0xa2, 0xd3, 0xec, 0x37, 0xb8, 0xb0, 0x0d, 0xe5, 0x35, 0x3a, - 0x6d, 0xaf, 0xff, 0x9e, 0x0b, 0x3b, 0x5f, 0x7d, 0x0e, 0xb0, 0xda, 0x65, 0x6a, 0x41, 0xbe, 0x1f, - 0xc4, 0x32, 0xb1, 0x73, 0xd4, 0x04, 0xad, 0x33, 0xb2, 0x89, 0x0a, 0xf1, 0x28, 0x0a, 0x23, 0x5b, - 0x3b, 0x63, 0x5f, 0x67, 0x0e, 0xb9, 0x9b, 0x39, 0xe4, 0xc7, 0xcc, 0x21, 0x9f, 0xe7, 0x4e, 0xee, - 0x6e, 0xee, 0xe4, 0xbe, 0xcf, 0x9d, 0xdc, 0x27, 0x13, 0xff, 0x93, 0x2f, 0x7f, 0x05, 0x00, 0x00, - 0xff, 0xff, 0xd8, 0xd1, 0x5c, 0xa2, 0x3b, 0x05, 0x00, 0x00, -} - -func (m *SpanEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SpanEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SpanEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ScopeTags) > 0 { - for k := range m.ScopeTags { - v := m.ScopeTags[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintSpanEvent(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x72 - } - } - if m.Status != 0 { - i = encodeVarintSpanEvent(dAtA, i, uint64(m.Status)) - i-- - dAtA[i] = 0x68 - } - if len(m.Links) > 0 { - for iNdEx := len(m.Links) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Links[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpanEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x62 - } - } - if len(m.Events) > 0 { - for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSpanEvent(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x5a - } - } - if len(m.Tags) > 0 { - for k := range m.Tags { - v := m.Tags[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintSpanEvent(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x52 - } - } - if m.EndTime != 0 { - i = encodeVarintSpanEvent(dAtA, i, uint64(m.EndTime)) - i-- - dAtA[i] = 0x48 - } - if m.StartTime != 0 { - i = encodeVarintSpanEvent(dAtA, i, uint64(m.StartTime)) - i-- - dAtA[i] = 0x40 - } - if m.Kind != 0 { - i = encodeVarintSpanEvent(dAtA, i, uint64(m.Kind)) - i-- - dAtA[i] = 0x38 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x32 - } - if len(m.ParentSpanID) > 0 { - i -= len(m.ParentSpanID) - copy(dAtA[i:], m.ParentSpanID) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.ParentSpanID))) - i-- - dAtA[i] = 0x2a - } - if len(m.TraceState) > 0 { - i -= len(m.TraceState) - copy(dAtA[i:], m.TraceState) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.TraceState))) - i-- - dAtA[i] = 0x22 - } - if len(m.SpanID) > 0 { - i -= len(m.SpanID) - copy(dAtA[i:], m.SpanID) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.SpanID))) - i-- - dAtA[i] = 0x1a - } - if len(m.TraceID) > 0 { - i -= len(m.TraceID) - copy(dAtA[i:], m.TraceID) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.TraceID))) - i-- - dAtA[i] = 0x12 - } - if m.Timestamp != 0 { - i = encodeVarintSpanEvent(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SpanEvent_InnerEvent) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SpanEvent_InnerEvent) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SpanEvent_InnerEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tags) > 0 { - for k := range m.Tags { - v := m.Tags[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintSpanEvent(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0x12 - } - if m.Timestamp != 0 { - i = encodeVarintSpanEvent(dAtA, i, uint64(m.Timestamp)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SpanEvent_SpanLink) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SpanEvent_SpanLink) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SpanEvent_SpanLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Tags) > 0 { - for k := range m.Tags { - v := m.Tags[k] - baseI := i - if len(v) > 0 { - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintSpanEvent(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x22 - } - } - if len(m.TraceState) > 0 { - i -= len(m.TraceState) - copy(dAtA[i:], m.TraceState) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.TraceState))) - i-- - dAtA[i] = 0x1a - } - if len(m.SpanID) > 0 { - i -= len(m.SpanID) - copy(dAtA[i:], m.SpanID) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.SpanID))) - i-- - dAtA[i] = 0x12 - } - if len(m.TraceID) > 0 { - i -= len(m.TraceID) - copy(dAtA[i:], m.TraceID) - i = encodeVarintSpanEvent(dAtA, i, uint64(len(m.TraceID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintSpanEvent(dAtA []byte, offset int, v uint64) int { - offset -= sovSpanEvent(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *SpanEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Timestamp != 0 { - n += 1 + sovSpanEvent(uint64(m.Timestamp)) - } - l = len(m.TraceID) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - l = len(m.SpanID) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - l = len(m.TraceState) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - l = len(m.ParentSpanID) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - if m.Kind != 0 { - n += 1 + sovSpanEvent(uint64(m.Kind)) - } - if m.StartTime != 0 { - n += 1 + sovSpanEvent(uint64(m.StartTime)) - } - if m.EndTime != 0 { - n += 1 + sovSpanEvent(uint64(m.EndTime)) - } - if len(m.Tags) > 0 { - for k, v := range m.Tags { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovSpanEvent(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovSpanEvent(uint64(len(k))) + l - n += mapEntrySize + 1 + sovSpanEvent(uint64(mapEntrySize)) - } - } - if len(m.Events) > 0 { - for _, e := range m.Events { - l = e.Size() - n += 1 + l + sovSpanEvent(uint64(l)) - } - } - if len(m.Links) > 0 { - for _, e := range m.Links { - l = e.Size() - n += 1 + l + sovSpanEvent(uint64(l)) - } - } - if m.Status != 0 { - n += 1 + sovSpanEvent(uint64(m.Status)) - } - if len(m.ScopeTags) > 0 { - for k, v := range m.ScopeTags { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovSpanEvent(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovSpanEvent(uint64(len(k))) + l - n += mapEntrySize + 1 + sovSpanEvent(uint64(mapEntrySize)) - } - } - return n -} - -func (m *SpanEvent_InnerEvent) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Timestamp != 0 { - n += 1 + sovSpanEvent(uint64(m.Timestamp)) - } - l = len(m.Name) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - if len(m.Tags) > 0 { - for k, v := range m.Tags { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovSpanEvent(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovSpanEvent(uint64(len(k))) + l - n += mapEntrySize + 1 + sovSpanEvent(uint64(mapEntrySize)) - } - } - return n -} - -func (m *SpanEvent_SpanLink) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TraceID) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - l = len(m.SpanID) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - l = len(m.TraceState) - if l > 0 { - n += 1 + l + sovSpanEvent(uint64(l)) - } - if len(m.Tags) > 0 { - for k, v := range m.Tags { - _ = k - _ = v - l = 0 - if len(v) > 0 { - l = 1 + len(v) + sovSpanEvent(uint64(len(v))) - } - mapEntrySize := 1 + len(k) + sovSpanEvent(uint64(len(k))) + l - n += mapEntrySize + 1 + sovSpanEvent(uint64(mapEntrySize)) - } - } - return n -} - -func sovSpanEvent(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSpanEvent(x uint64) (n int) { - return sovSpanEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *SpanEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SpanEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SpanEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceID = append(m.TraceID[:0], dAtA[iNdEx:postIndex]...) - if m.TraceID == nil { - m.TraceID = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpanID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpanID = append(m.SpanID[:0], dAtA[iNdEx:postIndex]...) - if m.SpanID == nil { - m.SpanID = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceState", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceState = append(m.TraceState[:0], dAtA[iNdEx:postIndex]...) - if m.TraceState == nil { - m.TraceState = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ParentSpanID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ParentSpanID = append(m.ParentSpanID[:0], dAtA[iNdEx:postIndex]...) - if m.ParentSpanID == nil { - m.ParentSpanID = []byte{} - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) - if m.Name == nil { - m.Name = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - m.Kind = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Kind |= SpanEvent_SpanKind(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - m.StartTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StartTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - m.EndTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EndTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tags == nil { - m.Tags = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthSpanEvent - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthSpanEvent - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipSpanEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpanEvent - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Tags[mapkey] = mapvalue - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Events = append(m.Events, &SpanEvent_InnerEvent{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Links", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Links = append(m.Links, &SpanEvent_SpanLink{}) - if err := m.Links[len(m.Links)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 13: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= SpanEvent_StatusCode(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ScopeTags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ScopeTags == nil { - m.ScopeTags = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthSpanEvent - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthSpanEvent - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipSpanEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpanEvent - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.ScopeTags[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpanEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpanEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SpanEvent_InnerEvent) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: InnerEvent: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: InnerEvent: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - m.Timestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Timestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) - if m.Name == nil { - m.Name = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tags == nil { - m.Tags = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthSpanEvent - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthSpanEvent - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipSpanEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpanEvent - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Tags[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpanEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpanEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SpanEvent_SpanLink) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SpanLink: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SpanLink: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceID = append(m.TraceID[:0], dAtA[iNdEx:postIndex]...) - if m.TraceID == nil { - m.TraceID = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpanID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpanID = append(m.SpanID[:0], dAtA[iNdEx:postIndex]...) - if m.SpanID == nil { - m.SpanID = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceState", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TraceState = append(m.TraceState[:0], dAtA[iNdEx:postIndex]...) - if m.TraceState == nil { - m.TraceState = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSpanEvent - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tags == nil { - m.Tags = make(map[string][]byte) - } - var mapkey string - mapvalue := []byte{} - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthSpanEvent - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthSpanEvent - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapbyteLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapbyteLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intMapbyteLen := int(mapbyteLen) - if intMapbyteLen < 0 { - return ErrInvalidLengthSpanEvent - } - postbytesIndex := iNdEx + intMapbyteLen - if postbytesIndex < 0 { - return ErrInvalidLengthSpanEvent - } - if postbytesIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = make([]byte, mapbyteLen) - copy(mapvalue, dAtA[iNdEx:postbytesIndex]) - iNdEx = postbytesIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipSpanEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpanEvent - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Tags[mapkey] = mapvalue - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSpanEvent(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSpanEvent - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipSpanEvent(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSpanEvent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSpanEvent - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSpanEvent - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSpanEvent - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthSpanEvent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSpanEvent = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSpanEvent = fmt.Errorf("proto: unexpected end of group") -) diff --git a/scripts/gen_build_scripts.sh b/scripts/gen_build_scripts.sh index a3db9d9c5f..bc65b2e303 100755 --- a/scripts/gen_build_scripts.sh +++ b/scripts/gen_build_scripts.sh @@ -108,7 +108,6 @@ function generateCopyScript() { if [ $BUILD_LOGTAIL_UT = "ON" ]; then echo 'docker cp "$id":'${PATH_IN_DOCKER}'/core/build core/build' >>$COPY_SCRIPT_FILE echo 'rm -rf core/protobuf/sls && docker cp "$id":'${PATH_IN_DOCKER}'/core/protobuf/sls core/protobuf/sls' >>$COPY_SCRIPT_FILE - echo 'rm -rf core/protobuf/models && docker cp "$id":'${PATH_IN_DOCKER}'/core/protobuf/models core/protobuf/models' >>$COPY_SCRIPT_FILE fi else echo 'docker cp "$id":'${PATH_IN_DOCKER}'/'${OUT_DIR}'/libGoPluginBase.so $BINDIR' >>$COPY_SCRIPT_FILE @@ -117,7 +116,6 @@ function generateCopyScript() { if [ $BUILD_LOGTAIL_UT = "ON" ]; then echo 'docker cp "$id":'${PATH_IN_DOCKER}'/core/build core/build' >>$COPY_SCRIPT_FILE echo 'rm -rf core/protobuf/sls && docker cp "$id":'${PATH_IN_DOCKER}'/core/protobuf/sls core/protobuf/sls' >>$COPY_SCRIPT_FILE - echo 'rm -rf core/protobuf/models && docker cp "$id":'${PATH_IN_DOCKER}'/core/protobuf/models core/protobuf/models' >>$COPY_SCRIPT_FILE fi fi echo 'echo -e "{\n}" > $BINDIR/loongcollector_config.json' >>$COPY_SCRIPT_FILE