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

change(opentelemetry): the default network port for OTLP/HTTP is changed to 4318 #7007

Merged
merged 1 commit into from
May 10, 2022

Conversation

soulbird
Copy link
Contributor

@soulbird soulbird commented May 8, 2022

Description

opentelemetry's default network port for OTLP/HTTP is 4318 not 4317.

The default network port for OTLP/gRPC is 4317.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@tokers
Copy link
Contributor

tokers commented May 9, 2022

@soulbird Shall we also update the corresponding test cases?

@soulbird
Copy link
Contributor Author

soulbird commented May 9, 2022

@soulbird Shall we also update the corresponding test cases?
Looks like no corresponding test cases need to be updated.

@tzssangglass
Copy link
Member

@moonming
Copy link
Member

moonming commented May 9, 2022

@soulbird Shall we also update the corresponding test cases?
Looks like no corresponding test cases need to be updated.

Why? No test cases for opentelemetry?

@moonming
Copy link
Member

moonming commented May 9, 2022

the title of this PR should add opentelemetry

@soulbird
Copy link
Contributor Author

soulbird commented May 9, 2022

@soulbird Shall we also update the corresponding test cases?
Looks like no corresponding test cases need to be updated.

Why? No test cases for opentelemetry?

In the test cases of opentelemetry, the data is reported to the black hole, and there is no port-related test. Look: https://github.com/apache/apisix/blob/master/t/plugin/opentelemetry.t#L41

@soulbird soulbird changed the title chore: the default network port for OTLP/HTTP is 4318 chore(opentelemetry): the default network port for OTLP/HTTP is 4318 May 9, 2022
@moonming
Copy link
Member

moonming commented May 9, 2022

@soulbird Shall we also update the corresponding test cases?
Looks like no corresponding test cases need to be updated.

Why? No test cases for opentelemetry?

In the test cases of opentelemetry, the data is reported to the black hole, and there is no port-related test. Look: https://github.com/apache/apisix/blob/master/t/plugin/opentelemetry.t#L41

Is opentelemetry really started? If yes, there should be has port

@soulbird
Copy link
Contributor Author

soulbird commented May 9, 2022

@soulbird Shall we also update the corresponding test cases?
Looks like no corresponding test cases need to be updated.

Why? No test cases for opentelemetry?

In the test cases of opentelemetry, the data is reported to the black hole, and there is no port-related test. Look: https://github.com/apache/apisix/blob/master/t/plugin/opentelemetry.t#L41

Is opentelemetry really started? If yes, there should be has port

No services related to opentelemetry were found to be started.

@moonming
Copy link
Member

moonming commented May 9, 2022

This port change problem should be covered with test cases

@soulbird
Copy link
Contributor Author

soulbird commented May 9, 2022

This port change problem should be covered with test cases

I think it is not necessary to add test coverage related to the default port, and the success or failure of the report will not affect the operation of APISIX. You can see that the do_request function does not return any relevant error information, it just output a log. Look: https://github.com/yangxikun/opentelemetry-lua/blob/main/lib/opentelemetry/trace/exporter/http_client.lua#L30
cc @spacewander

@moonming
Copy link
Member

moonming commented May 9, 2022

So should this function return an error message?

@spacewander spacewander changed the title chore(opentelemetry): the default network port for OTLP/HTTP is 4318 fix(opentelemetry): the default network port for OTLP/HTTP is 4318 May 9, 2022
@spacewander spacewander changed the title fix(opentelemetry): the default network port for OTLP/HTTP is 4318 change(opentelemetry): the default network port for OTLP/HTTP is changed to 4318 May 9, 2022
@spacewander
Copy link
Member

This port change problem should be covered with test cases

I think it is not necessary to add test coverage related to the default port, and the success or failure of the report will not affect the operation of APISIX. You can see that the do_request function does not return any relevant error information, it just output a log. Look: https://github.com/yangxikun/opentelemetry-lua/blob/main/lib/opentelemetry/trace/exporter/http_client.lua#L30 cc @spacewander

In the test, the do_request is replaced to a stub:

client.do_request = function()
.

So changing the port won't affect the behavior of the test, and the correctness of trace reporting is covered by lua-opentelemetry itself.

On the other hand, as the default network port for OTLP/HTTP is changed from 4317 to 4318 in open-telemetry/opentelemetry-specification#1970, it is necessary to change APISIX to adapt to the new break change.

CC the author of lua-opentelemetry and this plugin: @yangxikun

@spacewander spacewander merged commit ab7a767 into apache:master May 10, 2022
@yangxikun
Copy link
Contributor

Maybe its my careless to use 4317 port as default value. Change 4317 to 4318 is fine. Users usually configure the plugin option collector.address explicitly instead of using the default values.
I think test case is not need for this case.

Liu-Junlin pushed a commit to Liu-Junlin/apisix that referenced this pull request May 20, 2022
Co-authored-by: soulbird <zhaothree@gmail.com>
spacewander pushed a commit that referenced this pull request Jun 30, 2022
Co-authored-by: soulbird <zhaothree@gmail.com>
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.

6 participants