Skip to content

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

Merged
spacewander merged 1 commit into
apache:masterfrom
soulbird:chore/opentelemetry_port
May 10, 2022
Merged

change(opentelemetry): the default network port for OTLP/HTTP is changed to 4318#7007
spacewander merged 1 commit into
apache:masterfrom
soulbird:chore/opentelemetry_port

Conversation

@soulbird

@soulbird soulbird commented May 8, 2022

Copy link
Copy Markdown
Contributor

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

tokers commented May 9, 2022

Copy link
Copy Markdown
Contributor

@soulbird Shall we also update the corresponding test cases?

@soulbird

soulbird commented May 9, 2022

Copy link
Copy Markdown
Contributor Author

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

@tzssangglass

Copy link
Copy Markdown
Member

@moonming

moonming commented May 9, 2022

Copy link
Copy Markdown
Member

@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

moonming commented May 9, 2022

Copy link
Copy Markdown
Member

the title of this PR should add opentelemetry

@soulbird

soulbird commented May 9, 2022

Copy link
Copy Markdown
Contributor Author

@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

moonming commented May 9, 2022

Copy link
Copy Markdown
Member

@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

soulbird commented May 9, 2022

Copy link
Copy Markdown
Contributor Author

@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

moonming commented May 9, 2022

Copy link
Copy Markdown
Member

This port change problem should be covered with test cases

@soulbird

soulbird commented May 9, 2022

Copy link
Copy Markdown
Contributor Author

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

moonming commented May 9, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
spacewander pushed a commit that referenced this pull request Jun 30, 2022
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