wangpeix opened a new issue, #6675:
URL: https://github.com/apache/inlong/issues/6675
### What happened
No sort metrics.
### What you expected to happen
There are some problems with this method `FlinkSqlParser#injectInlongMetric`.
```java
private void injectInlongMetric(StreamInfo streamInfo) {
streamInfo.getNodes().stream().filter(node -> node instanceof
InlongMetric).forEach(node -> {
Map<String, String> properties = node.getProperties();
if (properties == null) {
properties = new LinkedHashMap<>();
if (node instanceof LoadNode) {
((LoadNode) node).setProperties(properties);
} else if (node instanceof ExtractNode) {
((ExtractNode) node).setProperties(properties);
} else {
throw new UnsupportedOperationException(String.format(
"Unsupported inlong group stream node for: %s",
node.getClass().getSimpleName()));
}
}
properties.put(Constants.METRICS_LABELS.key(),
Stream.of(Constants.GROUP_ID + "=" + groupInfo.getGroupId(),
Constants.STREAM_ID + "=" + streamInfo.getStreamId(),
Constants.NODE_ID + "=" + node.getId())
.collect(Collectors.joining("&")));
// Here, this place is causing problems
if
(StringUtils.isNotEmpty(groupInfo.getProperties().get(Constants.METRICS_AUDIT_PROXY_HOSTS.key())))
{
properties.put(Constants.METRICS_AUDIT_PROXY_HOSTS.key(),
groupInfo.getProperties().get(Constants.METRICS_AUDIT_PROXY_HOSTS.key()));
}
});
}
```
The `metrics.audit.proxy.hosts` parameter should not be obtained from the
`GroupInfo#properties` property. It should be a global parameter.
For example, it should be obtained from the `metrics.audit.proxy.hosts`
parameter of the `inlong-manager/plugins/flink-sort-plugin.properties` file.
### How to reproduce
```java
2022-11-29 22:34:13.194 - INFO [inlong-plugin-0] o.a.i.s.p.i.FlinkSqlParser
:296 - parse node success, node id:sink_01
2022-11-29 22:34:13.194 - INFO [inlong-plugin-0] o.a.i.s.p.i.FlinkSqlParser
:228 - parse node relation success, relation:NodeRelation(inputs=[stream_01],
outputs=[sink_01])
2022-11-29 22:34:13.194 - INFO [inlong-plugin-0] o.a.i.s.p.i.FlinkSqlParser
:170 - parse stream success, streamId:stream_01
2022-11-29 22:34:13.194 - INFO [inlong-plugin-0] o.a.i.s.p.i.FlinkSqlParser
:134 - parse group success, groupId:group_008
2022-11-29 22:34:13.195 - INFO [inlong-plugin-0]
.a.i.s.p.r.FlinkSqlParseResult:87 - execute createSql:
CREATE TABLE `table_stream_01`(
`uid` STRING,
`event_time` STRING)
WITH (
'inlong.metric.labels' =
'groupId=group_008&streamId=stream_01&nodeId=stream_01',
'connector' = 'pulsar-inlong',
'inlong-msg.csv.array-element-delimiter' = ';',
'inlong-msg.csv.disable-quote-character' = 'true',
'inlong-msg.inner.format' = 'csv',
'inlong-msg.csv.allow-comments' = 'false',
'format' = 'inlong-msg',
'inlong-msg.csv.field-delimiter' = ',',
'inlong-msg.csv.ignore-parse-errors' = 'true',
'inlong-msg.ignore-parse-errors' = 'false',
'generic' = 'true',
'service-url' = 'pulsar://x.x.x.x:6650',
'topic' = 'public/group_008/stream_01',
'scan.startup.mode' = 'earliest'
)
```
There is no `metrics.audit.proxy.hosts` parameter in the sql statement
produced by FlinkSqlParser.
### Environment
_No response_
### InLong version
master
### InLong Component
InLong Sort
### Are you willing to submit PR?
- [X] Yes, I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]