-
Notifications
You must be signed in to change notification settings - Fork 3
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
Migrate to Open Telemetry #6
Conversation
Open Tracing has now migrated to the Open Telemetry project. In addition to tracing, Open Telemetry also supports metrics. By migrating to Open Telemetry, we can do away with both Open Tracing and DropWizard Metrics and support what looks to be becoming a new standard. Merging this PR will warrant a semver update to 2.0.0 as we're taking quite a new approach. Open Tracing is relatively easy to migrate (note that "logs" and now "events" on the tracing API). Metrics is a re-write, but a good one given industry support. JSON serialisation has now been replaced with marshalling to Open Telemetry's standard protobuf domain model. Instead of using `jq` and `nc` to observe services, we'll be able to use `protoc --decode-raw` and `nc` instead.
|
||
override def `export`(metrics: util.Collection[MetricData]): MetricExporter.ResultCode = { | ||
metrics.forEach { metric => | ||
val _ = metricQueue.offer(metric) |
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.
Do you need to assign this val for linting purposes? looks like it could otherwise be shortened to
metrics.forEach(metricQueue.offer)
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’s a wart to not use an assignment where a value is returned. It could indicate a mistake, hence the wart remover plugin highlighting this.
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.
Fair enough, I suppose it's a consequence of not caring about the return value of the Java API in this case. Perhaps worth writing an extension method wrapping this call with a Scala idiomatic Unit return type assuming the return value is really unimportant and if this was to be called in many places in the code but not worth it for one instance!
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 good
A few OTEL changes to contend with
Open Tracing has now migrated to the Open Telemetry project. In addition to tracing, Open Telemetry also supports metrics. By migrating to Open Telemetry, we can do away with both Open Tracing and DropWizard Metrics and support what looks to be becoming a new standard.
Merging this PR will warrant a version update to 2.0.0 as we're taking quite a new approach. Open Tracing is relatively easy to migrate (note that "logs" are now "events" on the tracing API). Metrics is a re-write, but a good one, given its potential for industry support.
JSON serialization has now been replaced with marshalling to Open Telemetry's standard protobuf domain model. Instead of using
jq
andnc
to observe services, we'll be able to useprotoc --decode-raw
andnc
instead.TODO: