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

Move KeyValueIterable and KeyValueIterableView from trace to common #363

Merged
merged 3 commits into from
Oct 18, 2020

Conversation

kxyr
Copy link
Contributor

@kxyr kxyr commented Oct 15, 2020

A simple PR based on this comment from @maxgolov.

Since KeyValueIterable is used by metrics, traces, and possibly later on by logs, it would be better if it belonged to the “common” namespace as it is no longer exclusive to being used for “trace”.

In this PR, KeyValueIterable and its derived class KeyValueIterableView, are refactored from namespace trace::* to common::* and their corresponding *.h files are moved from api/.../trace to api/.../common.

cc @alolita

@codecov
Copy link

codecov bot commented Oct 15, 2020

Codecov Report

Merging #363 into master will not change coverage.
The diff coverage is 78.40%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #363   +/-   ##
=======================================
  Coverage   94.91%   94.91%           
=======================================
  Files         155      155           
  Lines        6882     6882           
=======================================
  Hits         6532     6532           
  Misses        350      350           
Impacted Files Coverage Δ
.../include/opentelemetry/common/key_value_iterable.h 100.00% <ø> (ø)
...ude/opentelemetry/common/key_value_iterable_view.h 100.00% <ø> (ø)
.../include/opentelemetry/metrics/async_instruments.h 100.00% <ø> (ø)
api/include/opentelemetry/metrics/instrument.h 78.57% <ø> (ø)
api/include/opentelemetry/metrics/meter.h 100.00% <ø> (ø)
...i/include/opentelemetry/metrics/sync_instruments.h 66.66% <0.00%> (ø)
api/include/opentelemetry/trace/default_span.h 21.42% <0.00%> (ø)
api/include/opentelemetry/trace/noop.h 86.20% <ø> (ø)
...nclude/opentelemetry/sdk/common/empty_attributes.h 100.00% <ø> (ø)
sdk/include/opentelemetry/sdk/metrics/controller.h 96.77% <ø> (ø)
... and 37 more

@@ -43,7 +43,7 @@ TEST(NoopMeter, RecordBatch)
std::unique_ptr<Meter> m{std::unique_ptr<Meter>(new NoopMeter{})};

std::map<std::string, std::string> labels = {{"Key", "Value"}};
auto labelkv = opentelemetry::trace::KeyValueIterableView<decltype(labels)>{labels};
auto labelkv = opentelemetry::common::KeyValueIterableView<decltype(labels)>{labels};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR, but seems we need to be consistent with the scope resolution usage - either use opentelemetry::common::KeyValueIterableView or common::KeyValueIterableView.

Nothing wrong with this PR thought. This needs to be fixed as separate PR for all such entities.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I've filed an issue for this here: #368

@kxyr kxyr changed the title Move KeyValueIterable and KeyValueIterableView from trace to common Move KeyValueIterable and KeyValueIterableView from trace to common [draft] Oct 15, 2020
@kxyr kxyr changed the title Move KeyValueIterable and KeyValueIterableView from trace to common [draft] Move KeyValueIterable and KeyValueIterableView from trace to common Oct 15, 2020
Copy link
Contributor

@pyohannes pyohannes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this work, this looks good.

It makes perfect sense to get rid of dependencies from the metrics to the trace part.

Approved pending all the tests are passing.

@kxyr kxyr marked this pull request as ready for review October 15, 2020 23:45
@kxyr kxyr requested a review from a team as a code owner October 15, 2020 23:45
@reyang
Copy link
Member

reyang commented Oct 16, 2020

CLA is broken today.

@maxgolov
Copy link
Contributor

There's also something with GitHub actions runner being unable to fetch packages (totally unrelated to this PR).

@reyang reyang added the pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.) label Oct 16, 2020
@reyang
Copy link
Member

reyang commented Oct 16, 2020

@xukaren please rebase to the latest master branch.

@kxyr kxyr force-pushed the move-KVI-KVIV branch 2 times, most recently from d027b01 to 3f73296 Compare October 18, 2020 02:28
@kxyr
Copy link
Contributor Author

kxyr commented Oct 18, 2020

Rebased!

@reyang reyang merged commit f270892 into open-telemetry:master Oct 18, 2020
@kxyr kxyr deleted the move-KVI-KVIV branch November 19, 2020 16:51
@kxyr kxyr restored the move-KVI-KVIV branch November 19, 2020 16:51
@kxyr kxyr deleted the move-KVI-KVIV branch November 24, 2020 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:please-merge This PR is ready to be merged by a Maintainer (rebased, CI passed, has enough valid approvals, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants