-
Notifications
You must be signed in to change notification settings - Fork 152
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
Smart Agent Receiver: add datapoint conversion #56
Conversation
f2c0eb2
to
1aae972
Compare
Codecov Report
@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 93.90% 94.13% +0.22%
==========================================
Files 5 6 +1
Lines 197 307 +110
==========================================
+ Hits 185 289 +104
- Misses 6 11 +5
- Partials 6 7 +1
Continue to review full report at Codecov.
|
err := setDataType(datapoint, m) | ||
if err != nil { | ||
numDropped++ | ||
c.logger.Warn("SignalFx datapoint type conversion error", |
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.
It is probably better to use Debug instead of Warn for conversion errors otherwise it can flood the logs: https://github.com/open-telemetry/opentelemetry-collector/blob/master/CONTRIBUTING.md#logging
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.
Makes sense, reverted change.
@@ -60,6 +71,9 @@ func (output *Output) Copy() types.Output { | |||
|
|||
func (output *Output) SendDatapoints(datapoints ...*datapoint.Datapoint) { | |||
output.logger.Debug("SendDatapoints has been called.", zap.Any("datapoints", datapoints)) | |||
metrics, numDropped := output.converter.toMetrics(datapoints) | |||
output.logger.Debug("SendDatapoints", zap.Any("metrics", metrics), zap.Int("numDropped", numDropped)) |
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.
We may want to remove the logger.Debug's in the final version so that Debug logs are not flooded for success cases. OK to keep for now if you are using them for debugging while you are actively developing.
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.
Good point, updated to use internal tracing and only debug log on dropped points.
These changes address the 3rd remaining item detailed in #53 (comment) by adding internal SFx datapoint to pdata metric translation and forwarding to the next metric consumer. They are largely based on the translation that occurs in Collector Contrib's SFx receiver but without using SFx's protobuf definitions.
In testing these changes, there is a minor form of end-to-end integration test that uses the native SA cpu monitor without vetting its metric content too heavily, which I deemed out of scope after earlier attempts in light of CI flake and cross-platform concerns.