-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
chore(error-log-logger): add kafka meta_refresh_interval #8821
Conversation
@@ -60,6 +60,7 @@ It might take some time to receive the log data. It will be automatically sent a | |||
| kafka.required_acks | integer | False | 1 | [0, 1, -1] | Number of acknowledgements the leader needs to receive for the producer to consider the request complete. This controls the durability of the sent records. The attribute follows the same configuration as the Kafka `acks` attribute. See [Apache Kafka documentation](https://kafka.apache.org/documentation/#producerconfigs_acks) for more. | | |||
| kafka.key | string | False | | | Key used for allocating partitions for messages. | | |||
| kafka.cluster_name | integer | False | 1 | [0,...] | Name of the cluster. Used when there are two or more Kafka clusters. Only works if the `producer_type` attribute is set to `async`. | | |||
| kafka.meta_refresh_interval | integer | optional | 30 | [1,...] | `refresh_interval` parameter in [lua-resty-kafka](https://github.com/doujiang24/lua-resty-kafka) specifies the time to auto refresh the metadata, in seconds.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| kafka.meta_refresh_interval | integer | optional | 30 | [1,...] | `refresh_interval` parameter in [lua-resty-kafka](https://github.com/doujiang24/lua-resty-kafka) specifies the time to auto refresh the metadata, in seconds.| | |
| kafka.meta_refresh_interval | integer | False | 30 | [1,...] | `refresh_interval` parameter in [lua-resty-kafka](https://github.com/doujiang24/lua-resty-kafka) specifies the time to auto refresh the metadata, in seconds.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems in this disscussion #8762 (comment), the value is optional
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep with the same style in this docs.
If we need to change the value from True/False
to optional
, let's update all of them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep with the same style in this docs.
i will change it later.
@@ -87,7 +87,8 @@ done | |||
"host": "127.0.0.1", | |||
"port": 9092 | |||
}], | |||
"kafka_topic": "test2" | |||
"kafka_topic": "test2", | |||
"meta_refresh_interval": 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a mock test to ensure this config is passed to broker_config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spacewander Can we check by the following steps:
- log the
broker_config
info insend_to_kafka
function - check if the error log include
"refresh_interval":1000
or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can verify it without adding any code to the plugin.
Line 373 in 0bc65ea
--- extra_init_by_lua |
Like this, we can inject some code while creating the producer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i see. But func create_producer
is a local func, how can we inject it by extra_init_by_lua
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can inject
apisix/apisix/plugins/error-log-logger.lua
Line 351 in 0bc65ea
return producer:new(broker_list, broker_config, cluster_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@spacewander updated, please take a look, thanks.
Signed-off-by: ashing <[email protected]>
* upstream/master: fix: limit count plugin conf parameter undefined error (apache#8902) chore: remove duplicate kubernetes test case (apache#8882) feat: add 'range_id' algorithm for 'request-id' plugin (apache#8790) chore(error-log-logger): add kafka meta_refresh_interval (apache#8821) chore(deps): bump golang.org/x/net from 0.2.0 to 0.7.0 in /t/grpc_server_example (apache#8881) docs: Update getting-started.md (apache#8763) fix(admin): fix wrong http code for patch method (apache#8855) feat: stream subsystem support tars service discovery (apache#8826) feat(ci): implement image caching to reduce ci build time. (apache#8735) feat(admin): add head method support to /apisix/admin (apache#8752) feat: opentelemetry plugin config collector.address support specify https scheme (apache#8823) fix: add admin schema to control_plane config (apache#8809)
Description
Fixes # (issue)
Inspired by PR: #8762
Checklist