Skip to content

Commit

Permalink
refactor(monitoring integration): adapt configs changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinplemelon authored and ysfscream committed Nov 27, 2024
1 parent 4699a1d commit 152e82e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
20 changes: 10 additions & 10 deletions src/i18n/MonitoringIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ For example, <code> {'{'} Authorization = "some-authz-tokens"{'}'}</code>`,
zh: '关闭追踪高级配置?',
en: 'Close Trace Advanced Configuration?',
},
attributeMetaValue: {
zh: '属性元数据值',
en: 'Attribute Metadata Value',
clusterIdentifier: {
zh: '集群标识符',
en: 'Cluster Identifier',
},
attributeMetaValueDesc: {
zh: '添加到 Span 的属性中的元数据值。属性键将是 <code>emqx.meta</code><br/>通常,设置一个简单且易于识别的名称或使用集群名称来标识不同的 EMQX 集群。',
en: "A meta value added into Span's Attribute. The attribute key will be <code>emqx.meta</code><br/>Typically, set a simple and easily recognizable name or use the cluster name to identify different EMQX clusters.",
clusterIdentifierDesc: {
zh: '添加到 Span 的 Attributes 中的属性值。属性键将是 `cluster.id`。通常,设置一个简单且易于识别的名称或使用集群名称来标识不同的 EMQX 集群。',
en: "An attribute value added into Span's Attributes. The attribute key will be `cluster.id`. Typically, set a simple and easily recognizable name or use the cluster name to identify different EMQX clusters.",
},
alreadyExists: {
zh: '已存在',
Expand Down Expand Up @@ -251,8 +251,8 @@ For example, <code> {'{'} Authorization = "some-authz-tokens"{'}'}</code>`,
en: 'Trace Sampling Ratio',
},
traceSamplingRatioDesc: {
zh: '事件类型的采样比率。对事件开关和白名单采样透明。',
en: 'Sampling ratio for the event types. Transparent to events switch and whitelist sampling.',
zh: '追踪事件的采样比率。',
en: 'Sampling ratio of trace events.',
},
notEnabledAllTraceTip: {
zh: '无已启用的追踪事件',
Expand All @@ -263,8 +263,8 @@ For example, <code> {'{'} Authorization = "some-authz-tokens"{'}'}</code>`,
en: 'Message Trace Level',
},
messageTraceLevelDesc: {
zh: '消息发布过程中所有消息交换的跟踪级别。<br/>注意:此设置对所有消息跟踪有效,不受白名单采样或比例采样的影响。',
en: 'Trace level for all message exchanges during the message publishing process.<br/>Note: This is effective for all message traces. It is transparent to whitelist sampling or ratio sampling.',
zh: '消息发布过程中所有消息交换的跟踪级别。',
en: 'Trace level for all message exchanges during the message publishing process.',
},
messageTraceLevel0Desc: {
zh: '包括 <br />- `client.connect`<br />- `client.authz`<br />- `message.route`<br />- `message.forward`<br />- `message.handle_forward`<br />- `broker.publish`',
Expand Down
4 changes: 2 additions & 2 deletions src/types/schemas/monitor.schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,14 @@ export interface OpentelemetryOpentelemetry {
}

export interface OpentelemetryE2eTracingOptions {
attribute_meta_value?: string
cluster_identifier: string
msg_trace_level?: number
clientid_match_rules_max?: number
topic_match_rules_max?: number
sample_ratio?: string
client_connect_disconnect?: boolean
client_subscribe_unsubscribe?: boolean
client_publish?: boolean
client_messaging?: boolean
}

export type EmqxSslClientOptsServerNameIndication = string | 'disable'
Expand Down
13 changes: 6 additions & 7 deletions src/views/Config/Monitoring/MonitoringIntegration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,17 @@
"
>
<el-col :span="21">
<el-form-item prop="traces.filter.e2e_tracing_options.attribute_meta_value">
<el-form-item prop="traces.filter.e2e_tracing_options.cluster_identifier">
<template #label>
<FormItemLabel
:label="tl('attributeMetaValue')"
:desc="tl('attributeMetaValueDesc')"
:label="tl('clusterIdentifier')"
:desc="tl('clusterIdentifierDesc')"
desc-marked
/>
</template>
<el-input
v-model="
opentelemetryFormData.traces.filter.e2e_tracing_options
.attribute_meta_value
opentelemetryFormData.traces.filter.e2e_tracing_options.cluster_identifier
"
/>
</el-form-item>
Expand Down Expand Up @@ -407,7 +406,7 @@ const opentelemetryFormData = ref<OpenTelemetry>({
trace_all: false,
trace_mode: 'legacy',
e2e_tracing_options: {
attribute_meta_value: '',
cluster_identifier: '',
},
},
scheduled_delay: '5s',
Expand Down Expand Up @@ -509,7 +508,7 @@ const loadOpentelemetry = async function () {
const FormCom = ref()
const { createRequiredRule } = useFormRules()
const rules = {
'traces.filter.e2e_tracing_options.attribute_meta_value': createRequiredRule(
'traces.filter.e2e_tracing_options.cluster_identifier': createRequiredRule(
tl('attributeMetaValue'),
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<el-switch v-model="traceConf.client_subscribe_unsubscribe" />
</el-form-item>
<el-form-item :label="tl('traceMessage')">
<el-switch v-model="traceConf.client_publish" />
<el-switch v-model="traceConf.client_messaging" />
</el-form-item>
<el-form-item prop="sample_ratio">
<template #label>
Expand Down Expand Up @@ -234,7 +234,7 @@ const notEnabledAllTrace = computed(
() =>
!traceConf.value.client_connect_disconnect &&
!traceConf.value.client_subscribe_unsubscribe &&
!traceConf.value.client_publish,
!traceConf.value.client_messaging,
)
const traceEventLevelOpts = [
Expand Down

0 comments on commit 152e82e

Please sign in to comment.