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

Update OTEL dependencies to latest release candidates #620

Merged
merged 5 commits into from May 26, 2023

Conversation

lrascao
Copy link
Contributor

@lrascao lrascao commented Apr 5, 2023

Relevant changes required from RC changelog:

Also of note go.opentelemetry.io/otel/metric is now stable as of v1.15.0-rc2

fixes #620

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #620 (f14e232) into main (478fe63) will increase coverage by 0.02%.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##             main     #620      +/-   ##
==========================================
+ Coverage   66.25%   66.27%   +0.02%     
==========================================
  Files          36       36              
  Lines        4264     4276      +12     
==========================================
+ Hits         2825     2834       +9     
- Misses       1312     1314       +2     
- Partials      127      128       +1     
Impacted Files Coverage Δ
exporter/metric/metric.go 71.00% <87.50%> (+0.10%) ⬆️
.../collector/integrationtest/testcases/conversion.go 76.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@lrascao lrascao marked this pull request as ready for review April 5, 2023 12:51
@lrascao lrascao requested a review from a team as a code owner April 5, 2023 12:51
Copy link
Member

@damemi damemi left a comment

Choose a reason for hiding this comment

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

Hi @lrascao, thanks for submitting this. However, we would like to wait until the Go libraries are released as stable rather than merge the rc branches (release candidates aren't technically stable, yet). There's some more discussion in a similar PR #611

If you don't mind waiting and updating this PR once these tags are published, that would be really helpful. Otherwise, we would like to hold off on merging rc dependencies unless necessary

@lrascao
Copy link
Contributor Author

lrascao commented Apr 5, 2023

If you don't mind waiting and updating this PR once these tags are published, that would be really helpful.

sure, i'll move this to draft until then

@lrascao lrascao marked this pull request as draft April 5, 2023 14:22
@ptxmac
Copy link

ptxmac commented May 8, 2023

v1.15 is tagged as stable now, any update on when this will be merged?

@damemi
Copy link
Member

damemi commented May 8, 2023

@ptxmac thanks for bumping this, now that 1.15 is stable we should merge it

@lrascao can you resolve the conflicts and switch this from draft to ready for review?

@lrascao
Copy link
Contributor Author

lrascao commented May 8, 2023

Looks like we need to wait for folks at https://github.com/open-telemetry/opentelemetry-collector to cut a new release that also bumps to v1.15.0

@ptxmac
Copy link

ptxmac commented May 9, 2023

Looks like we need to wait for folks at https://github.com/open-telemetry/opentelemetry-collector to cut a new release that also bumps to v1.15.0

Looks like they did just one hour after your post 😄

@lrascao
Copy link
Contributor Author

lrascao commented May 9, 2023

Apparently there's a regression in the google managed prometheus metric naming convention:

--- FAIL: TestGetMetricName (0.00s)
    --- FAIL: TestGetMetricName/sum_without_total (0.00s)
        naming_test.go:143: MetricName(foo, {orig:0xc0001d5080})=foo_total/counter; want foo/counter
    --- FAIL: TestGetMetricName/sum_with_unit (0.00s)
        naming_test.go:143: MetricName(foo, {orig:0xc0001d5100})=foo_seconds_total/counter; want foo_total/counter
FAIL
FAIL    github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/googlemanagedprometheus   0.239s

@damemi
Copy link
Member

damemi commented May 15, 2023

@lrascao is this still a draft or is it ready for review? Not sure if you were working on the regression you mentioned in your last comment

@damemi
Copy link
Member

damemi commented May 15, 2023

Apparently there's a regression in the google managed prometheus metric naming convention:

--- FAIL: TestGetMetricName (0.00s)
    --- FAIL: TestGetMetricName/sum_without_total (0.00s)
        naming_test.go:143: MetricName(foo, {orig:0xc0001d5080})=foo_total/counter; want foo/counter
    --- FAIL: TestGetMetricName/sum_with_unit (0.00s)
        naming_test.go:143: MetricName(foo, {orig:0xc0001d5100})=foo_seconds_total/counter; want foo_total/counter
FAIL
FAIL    github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector/googlemanagedprometheus   0.239s

Digging around it looks like this is caused by open-telemetry/opentelemetry-collector-contrib#20519. Looking into it

@damemi damemi self-assigned this May 15, 2023
@lrascao
Copy link
Contributor Author

lrascao commented May 15, 2023

@lrascao is this still a draft or is it ready for review? Not sure if you were working on the regression you mentioned in your last comment

yeah, not really sure on that path forward here, adapt to the change or request rollback of the regression

@damemi
Copy link
Member

damemi commented May 15, 2023

Talked to the team, and it looks like we should accept the change in default naming to match the Prometheus specification. In other words, just update the failing tests to expect the new names (with _total suffix).

This will be a breaking change, but it can be disabled using the feature gate flag from the upstream change (--feature-gates=-pkg.translator.prometheus.NormalizeName).

@lrascao
Copy link
Contributor Author

lrascao commented May 15, 2023

Talked to the team, and it looks like we should accept the change in default naming to match the Prometheus specification. In other words, just update the failing tests to expect the new names (with _total suffix).

This will be a breaking change, but it can be disabled using the feature gate flag from the upstream change (--feature-gates=-pkg.translator.prometheus.NormalizeName).

alright, updating

go.opentelemetry.io/otel v1.15.1/v0.38.1
go.opentelemetry.io/contrib v1.16.0/v0.41.0
go.opentelemetry.io/collector v1.0.0/v0.76.1

Signed-off-by: Luis Rascao <luis.rascao@gmail.com>
@lrascao lrascao marked this pull request as ready for review May 15, 2023 15:41
@lrascao
Copy link
Contributor Author

lrascao commented May 15, 2023

ping @damemi ready for a GCB run

@damemi
Copy link
Member

damemi commented May 15, 2023

/gcbrun

@lrascao
Copy link
Contributor Author

lrascao commented May 15, 2023

/gcbrun

tests need a retry it seems

Copy link
Member

@damemi damemi left a comment

Choose a reason for hiding this comment

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

just want to add that test back

@damemi
Copy link
Member

damemi commented May 17, 2023

I just found open-telemetry/opentelemetry-collector-contrib#21743, which also discusses the changes in metric name normalization. There might be some upstream work to do with this first

@ktong
Copy link

ktong commented May 23, 2023

Could it upgrade to v1.16.0/v0.39.0 instead to avoid another upgrade? https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0

@damemi
Copy link
Member

damemi commented May 23, 2023

/gcbrun

@damemi
Copy link
Member

damemi commented May 23, 2023

Could it upgrade to v1.16.0/v0.39.0 instead to avoid another upgrade? https://github.com/open-telemetry/opentelemetry-go/releases/tag/v1.16.0

We are pretty close with this one, so given the number of changes I think it would be best to update incrementally if possible. So, getting this green then immediately following with another bump would be better imo.

Looking into why some of the unit tests are failing

exporter/metric/metric.go Show resolved Hide resolved
exporter/metric/metric.go Outdated Show resolved Hide resolved
exporter/metric/metric.go Outdated Show resolved Hide resolved
@damemi
Copy link
Member

damemi commented May 25, 2023

/gcbrun

exporter/metric/metric.go Outdated Show resolved Hide resolved
@lrascao
Copy link
Contributor Author

lrascao commented May 26, 2023

@damemi needs a splash of /gcbrun

@damemi
Copy link
Member

damemi commented May 26, 2023

/gcbrun

Copy link
Member

@damemi damemi 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 all of your help @lrascao!

@@ -152,13 +152,13 @@ func convertHistogram(h pmetric.Histogram) metricdata.Aggregation {
if h.DataPoints().Len() == 0 {
return nil
}
agg := metricdata.Histogram{
agg := metricdata.Histogram[float64]{
Copy link
Member

Choose a reason for hiding this comment

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

As a note, I think it is fine that we are only handling float64 histograms here, because

  1. this code is just handling testcases.
  2. Sum is the only value used here that can be int or float in metricdata.Histogram[N] (we don't read Min or Max) and Sum() always returns a float64, so there shouldn't be any runtime issues with this.
  3. We force float64 when we handle Sum anyway, which is consistent with the behavior prior to this update and therefore not breaking.

However, we should follow this up with support for int64 histograms. Otherwise, users who switch to the GCP exporter might see slightly different values since we force floats in the output calculation. That would include adding a test case for an int64 histogram, which we don't appear to have currently. Will make a separate issue to track this.

@damemi damemi mentioned this pull request May 26, 2023
@damemi damemi merged commit 50e80b0 into GoogleCloudPlatform:main May 26, 2023
25 checks passed
@lrascao lrascao deleted the bump-otel branch May 29, 2023 09:40
This was referenced May 30, 2023
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.

None yet

5 participants