-
Notifications
You must be signed in to change notification settings - Fork 418
feat: support send multivalue metrics to sls #2233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -505,7 +508,8 @@ bool FlusherSLS::Init(const Json::Value& config, Json::Value& optionalGoPipeline | |||
this, | |||
strategy, | |||
!mContext->IsExactlyOnceEnabled() && mShardHashKeys.empty() | |||
&& mTelemetryType != sls_logs::SLS_TELEMETRY_TYPE_METRICS)) { | |||
&& mTelemetryType != sls_logs::SLS_TELEMETRY_TYPE_METRICS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用函数或宏封装下,赋予含义,不要直接罗列判断条件
函数名即注释
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SLS_TELEMETRY_TYPE_APM_METRICS 为什么没有?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个APM的目前没什么问题。 @KayzzzZ 后续会测试再提PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Add support for sending multi-value and host metrics to SLS MetricStore by extending the serializer, client manager, and flusher components, and by adding unit tests and protobuf enum entries.
- Extended SLSSerializer and LogGroupSerializer to calculate and emit multi-value metric fields.
- Introduced new telemetry types (
metrics_multivalue
,metrics_host
) insls_logs.proto
, constants, client manager, and flusher logic. - Added unit tests for multi-value metrics and fixed a typo in
MetricsValue
API.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
core/unittest/serializer/SLSSerializerUnittest.cpp | Added CreateBatchedMultiValueMetricEvents and tests for various tag/value combos. |
core/unittest/flusher/FlusherSLSUnittest.cpp | Added config test for metrics_multivalue telemetry type. |
core/protobuf/sls/sls_logs.proto | Added SLS_TELEMETRY_TYPE_METRICS_MULTIVALUE and METRICS_HOST . |
core/plugin/flusher/sls/SLSConstant.h/.cpp | Defined new HOSTMETRICS constant for host metrics path. |
core/plugin/flusher/sls/SLSClientManager.h/.cpp | Added PreparePostHostMetricsRequest to build host metrics requests. |
core/plugin/flusher/sls/FlusherSLS.h/.cpp | Added CreatePostHostMetricsRequest , ShouldGroupBatch , and telemetry branching. |
core/plugin/flusher/sls/DiskBufferWriter.cpp | Included METRICS_MULTIVALUE in the switch for dispatch. |
core/models/MetricValue.h/.cpp | Renamed ValusSize to ValuesSize . |
core/collection_pipeline/serializer/SLSSerializer.h/.cpp | Extended serializer to support multi-value metric size calculation and serialization. |
req = CreatePostLogStoreLogsRequest(accessKeyId, accessKeySecret, type, data); | ||
break; | ||
case sls_logs::SLS_TELEMETRY_TYPE_METRICS_HOST: | ||
req = CreatePostHostMetricsRequest(accessKeyId, accessKeySecret, type, data); | ||
break; | ||
case sls_logs::SLS_TELEMETRY_TYPE_METRICS: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SLS_TELEMETRY_TYPE_APM_AGENTINFOS jq
* feat: support send multivalue metrics to sls * fix * fix * fix * fix * fix
* feat: support send multivalue metrics to sls * fix * fix * fix * fix * fix
支持flusher_sls写入SLS MetricStore多值接口
接口介绍
SLS MetricStore多值接口与日志接口相同。除此之外,针对多值指标有一些额外的规则: