Skip to content
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

Merged
merged 6 commits into from
Sep 15, 2020
Merged

Migrate to Open Telemetry #6

merged 6 commits into from
Sep 15, 2020

Conversation

huntc
Copy link
Contributor

@huntc huntc commented Jul 16, 2020

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 and nc to observe services, we'll be able to use protoc --decode-raw and nc instead.

TODO:

  • Finish up metric marshalling
  • Finish up span marshalling
  • Use in a real-world context to firm up the API and implementation

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.
@huntc huntc requested a review from stevewillcock July 16, 2020 06:59

override def `export`(metrics: util.Collection[MetricData]): MetricExporter.ResultCode = {
metrics.forEach { metric =>
val _ = metricQueue.offer(metric)

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)

Copy link
Contributor Author

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.

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!

Copy link

@stevewillcock stevewillcock left a 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
@huntc huntc marked this pull request as ready for review September 15, 2020 07:45
@huntc huntc merged commit 448b775 into titanclass:master Sep 15, 2020
@huntc huntc deleted the open-telemetry branch September 15, 2020 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants