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

Rename oltp_endpoint to otlp_endpoint to match opentelemetry spec and lib name #5068

Merged
merged 10 commits into from
Jan 27, 2023

Conversation

sharkymcdongles
Copy link
Contributor

What this PR does:
Renames oltp_endpoint to otlp_endpoint to match opentelemetry spec and lib name

Which issue(s) this PR fixes:
Fixes #5067

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

…ame and spec

Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>
Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>
Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>
Copy link
Collaborator

@yeya24 yeya24 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 change. It makes sense to me.

@alanprot
Copy link
Member

I also agree.. thanks for pointing this out… I just wonder if there is a way to keep both configs for some time (maybe hiding from the docs and giving a warn on the logs) so we don’t break customers that are already using this config

friedrichg
friedrichg previously approved these changes Dec 27, 2022
Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

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

Thanks!
@alanprot To me otlp support is experimental, we need to put it in v1.x Guarantees as we do with all new risky features.

@yeya24
Copy link
Collaborator

yeya24 commented Dec 29, 2022

I agree this feature is just experimental and we shoulbe be able to change it.

@alanprot
Copy link
Member

I agree this feature is just experimental and we shoulbe be able to change it.

Its not marked as experimental though, right?

But iI'm ok either way i guess...

@yeya24
Copy link
Collaborator

yeya24 commented Dec 30, 2022

Maybe we should follow the doc and make sure we are backward compatible.

@friedrichg
Copy link
Member

Its not marked as experimental though, right?

No, it's not experimental. That was just a suggestion.

Maybe we should follow the doc and make sure we are backward compatible.

yes, that is the way forward. fyi @sharkymcdongles

@friedrichg friedrichg dismissed their stale review December 30, 2022 09:02

it should be backward compatible

@sharkymcdongles
Copy link
Contributor Author

@friedrichg I will make changes then this week. Cheers!

Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>
@pull-request-size pull-request-size bot added size/M and removed size/S labels Jan 9, 2023
@sharkymcdongles
Copy link
Contributor Author

@friedrichg I just made some adjustments hope it is okay. Was a quick and dirty during a too long meeting where I was bored af and wanted something to distract me.

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>
@sharkymcdongles
Copy link
Contributor Author

Whoopsie daisies, I forgot I am working with Golang and not Python and did some stupid stuff. Fixed.

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>
@sharkymcdongles
Copy link
Contributor Author

Not really sure what is failing now. Anyone able to help? I didn't touch the compactor, and my documentation looks proper.

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>
@sharkymcdongles
Copy link
Contributor Author

NM seems it was the newline. Not sure about the compactor test though.

pkg/tracing/tracing.go Outdated Show resolved Hide resolved
Comment on lines +99 to 104
if (c.Otel.OtlpEndpoint == "") && (len(c.Otel.OltpEndpoint) > 0) {
level.Warn(util_log.Logger).Log("msg", "DEPRECATED: otel.oltp is deprecated use otel.otlp")
options = []otlptracegrpc.Option{
otlptracegrpc.WithEndpoint(c.Otel.OltpEndpoint),
}
}
Copy link
Member

Choose a reason for hiding this comment

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

If both are set OtlpEndpoint should take precedence (this will happen when we are migrating from the old config to the new one)

Something like:

if (len(c.Otel.OtlpEndpoint) > 0) && (len(c.Otel.OltpEndpoint) > 0) {
	level.Warn(util_log.Logger).Log("msg", "DEPRECATED: otel.otlp and otel.oltp both set, using otel.otlp because otel.oltp is deprecated")
}

otlpEndpoint := c.Otel.OltpEndpoint

if len(otlpEndpoint) == 0 {
    otlpEndpoint = c.Otel.OltpEndpoint
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already did that here: 91

Logic is:

If both are set log warning that both are set and otel.oltp will be removed and set options to use OtlpEndpoint.

If only OltpEndpoint is set then use it and warn as well.

Then once it is fully removed then both the if from 91 and 99 can be removed.

Maybe there is a cleaner way than this if else condition though not sure.

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>
Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>
Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

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

test failure is not related

Signed-off-by: Bryan <bryanfcarmichael@gmail.com>
@yeya24
Copy link
Collaborator

yeya24 commented Jan 27, 2023

--- FAIL: TestCompactor_ShouldCompactOnlyShardsOwnedByTheInstanceOnShardingEnabledWithShuffleShardingAndMultipleInstancesRunning (4.72s)
compactor_test.go:1298:
Error Trace: /__w/cortex/cortex/pkg/compactor/compactor_test.go:1298
Error: Should be true
Test: TestCompactor_ShouldCompactOnlyShardsOwnedByTheInstanceOnShardingEnabledWithShuffleShardingAndMultipleInstancesRunning
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x190b629]

This is a flaky test we need to take care of. Will create a separate pr to track

@yeya24 yeya24 merged commit 8af2de2 into cortexproject:master Jan 27, 2023
alexqyle pushed a commit to alexqyle/cortex that referenced this pull request May 2, 2023
… lib name (cortexproject#5068)

* rename oltp_endpoint to otlp_endpoint to be consistent with library name and spec

Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>

* update changelog

Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>

* change BUGFIX to CHANGE

Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>

* deprecate instead of remove

Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>

* fix errors because I forgot this is golang and not python lol

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>

* improve documentation comment

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>

* remove newline

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>

* hide deprecated config

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>

* remove hidden

Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>

---------

Signed-off-by: bha <bryan.hamade@marketlogicsoftware.com>
Signed-off-by: sharkymcdongles <bryanfcarmichael@gmail.com>
Signed-off-by: Bryan <bryanfcarmichael@gmail.com>
Signed-off-by: Alex Le <leqiyue@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration Key For The Open Telemetry Endpoint Is Inconsistent with OpenTelemetry Spec
5 participants