-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add metric metadata syncer to SignalFx exporter #231
Add metric metadata syncer to SignalFx exporter #231
Conversation
Codecov Report
@@ Coverage Diff @@
## master #231 +/- ##
=========================================
Coverage ? 78.16%
=========================================
Files ? 130
Lines ? 6828
Branches ? 0
=========================================
Hits ? 5337
Misses ? 1194
Partials ? 297
Continue to review full report at Codecov.
|
// For easier unit testing | ||
now func() time.Time | ||
|
||
// TODO: Send these counters as internal metrics to SignalFx |
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.
Ideally we could expose these through obsreport or some central mechanism. Maybe also TODO to add tracing support?
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.
Tracing support as in collect spans from the DimensionClient
?
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.
Sorry, no I mean just self-instrumentation with traces through obsreport.
Is that done? If yes please update description. |
I just realized I haven't handled metadata updates to the same dimension within a small amount of time gracefully. Will get an update in for that shortly. |
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.
Looks like dimclient.go
is not covered well with tests here. I see that there is client_test.go
in signalfx repo. Do we plan to add them later?
Will add those tests as well. |
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.
Overall looks good to me
} | ||
|
||
// setPropertiesOnDimension will set custom properties on a specific dimension value. | ||
func (dc *DimensionClient) setPropertiesOnDimension(dimUpdate *DimensionUpdate) 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.
The name sounds a bit confusing. May be something like sendDimensionUpdate
or dispatchDimensionUpdate
? What do you think?
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.
Renamed the method handleDimensionUpdate
. Since the actual sending/dispatching is done by the method called makePatchRequest
.
err error | ||
) | ||
|
||
if dimUpdate.Name == "" || dimUpdate.Value == "" { |
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.
should we check this earlier? in acceptDimension
or even in PushKubernetesMetadata
?
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.
Moved it for now since it seems to make more sense. When the export supports metadata updates from other sources as well, we may want to refactor.
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.
LGTM
@asuresh4 Please resolve the conflicts. |
Done. |
Added ability to sync properties and tags in SignalFx exporter. To begin with the exporter will be able to handle metadata updates from `k8sclusterreceiver`. The dimension updates are however handled in a generic manner to support similar metadata from other receivers. The dimension client used to perform the metric metadata sync is mostly a 1:1 port of https://github.com/signalfx/signalfx-agent/blob/master/pkg/core/writer/dimensions/client.go, with the primary difference being that deduplication of dimension updates are not currently supported in this exporter. **Link to tracking Issue:** open-telemetry#180 **Testing:** Added unit tests and manual testing.
Bumps [go.opentelemetry.io/collector](https://github.com/open-telemetry/opentelemetry-collector) from 0.30.1 to 0.31.0. - [Release notes](https://github.com/open-telemetry/opentelemetry-collector/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-collector/blob/main/CHANGELOG.md) - [Commits](open-telemetry/opentelemetry-collector@v0.30.1...v0.31.0) --- updated-dependencies: - dependency-name: go.opentelemetry.io/collector dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Description: Added ability to sync properties and tags in SignalFx exporter. To begin with the exporter will be able to handle metadata updates from
k8sclusterreceiver
. The dimension updates are however handled in a generic manner to support similar metadata from other receivers. The dimension client used to perform the metric metadata sync is mostly a 1:1 port of https://github.com/signalfx/signalfx-agent/blob/master/pkg/core/writer/dimensions/client.go, with the primary difference being that deduplication of dimension updates are not currently supported in this exporter.Link to tracking Issue: #180
Testing: Added unit tests and manual testing.