[增加]exporter的配置导入和confd的模板

This commit is contained in:
2024-09-03 10:24:40 +08:00
committed by Coding
parent 64da725791
commit 0c626814b6
4 changed files with 51 additions and 27 deletions

64
.idea/workspace.xml generated
View File

@@ -4,16 +4,11 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="596fb1a0-d6fb-4db8-a922-13b01593ce79" name="更改" comment="[修改]confd模板修改">
<change afterPath="$PROJECT_DIR$/management-panel/app/Services/PrometheusService.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/deployment.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/deployment.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/php.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/php.xml" afterDir="false" />
<list default="true" id="596fb1a0-d6fb-4db8-a922-13b01593ce79" name="更改" comment="[增加]Metrics在表格中数据显示">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/confd/conf.d/opcua.toml" beforeDir="false" afterPath="$PROJECT_DIR$/confd/conf.d/opcua.toml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/confd/templates/opcua.tmpl" beforeDir="false" afterPath="$PROJECT_DIR$/confd/templates/opcua.tmpl" afterDir="false" />
<change beforePath="$PROJECT_DIR$/docker/prometheus/prometheus.yml" beforeDir="false" afterPath="$PROJECT_DIR$/docker/prometheus/prometheus.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Resources/MetricResource.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/composer.json" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/composer.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/composer.lock" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/composer.lock" afterDir="false" />
<change beforePath="$PROJECT_DIR$/management-panel/app/Filament/Widgets/UpdateConfigWidget.php" beforeDir="false" afterPath="$PROJECT_DIR$/management-panel/app/Filament/Widgets/UpdateConfigWidget.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -313,19 +308,25 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;last_opened_file_path&quot;: &quot;F:/Postgraduate/work_project/data-collection-terminal/management-panel&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"RunOnceActivity.ShowReadmeOnStart": "true",
"git-widget-placeholder": "master",
"last_opened_file_path": "F:/Postgraduate/work_project/data-collection-terminal/management-panel",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"vue.rearranger.settings.migration": "true"
},
"keyToStringList": {
"DatabaseDriversLRU": [
"mysql_aurora_aws",
"mysql"
]
}
}</component>
}]]></component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="D:\WorkSpace\FDCP\data-collection-terminal" />
@@ -376,7 +377,7 @@
<workItem from="1724822229750" duration="4704000" />
<workItem from="1724980018901" duration="1052000" />
<workItem from="1725241101387" duration="17087000" />
<workItem from="1725325817987" duration="3119000" />
<workItem from="1725325817987" duration="4230000" />
</task>
<task id="LOCAL-00001" summary="[增添]添加注册">
<option name="closed" value="true" />
@@ -498,7 +499,23 @@
<option name="project" value="LOCAL" />
<updated>1724826565563</updated>
</task>
<option name="localTasksCounter" value="16" />
<task id="LOCAL-00016" summary="[增加]Metrics在表格中数据显示">
<option name="closed" value="true" />
<created>1725329462713</created>
<option name="number" value="00016" />
<option name="presentableId" value="LOCAL-00016" />
<option name="project" value="LOCAL" />
<updated>1725329462713</updated>
</task>
<task id="LOCAL-00017" summary="[增加]Metrics在表格中数据显示">
<option name="closed" value="true" />
<created>1725329493842</created>
<option name="number" value="00017" />
<option name="presentableId" value="LOCAL-00017" />
<option name="project" value="LOCAL" />
<updated>1725329493842</updated>
</task>
<option name="localTasksCounter" value="18" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -536,6 +553,7 @@
<MESSAGE value="[更新]confd映射本地目录" />
<MESSAGE value="[更改]取消用户注册功能" />
<MESSAGE value="[修改]confd模板修改" />
<option name="LAST_COMMIT_MESSAGE" value="[修改]confd模板修改" />
<MESSAGE value="[增加]Metrics在表格中数据显示" />
<option name="LAST_COMMIT_MESSAGE" value="[增加]Metrics在表格中数据显示" />
</component>
</project>

View File

@@ -3,6 +3,7 @@ src = "opcua.tmpl"
dest = "/data/opcua/opcua.yaml"
keys = [
"/datasource/",
"/exporter/"
"/metrics/"
]
#reload_cmd = "pkill -f opcua-exporter && cd /home/lamonki/opcua-expoter/build && ./manage_opcua_exporter.sh | tee /dev/tty"

View File

@@ -16,11 +16,16 @@ datasource:
cache_update: {{ getv "/datasource/cache_update" }}
cache_timeout: {{ getv "/datasource/cache_timeout" }}
exporter:
exporter_bind: {{ getv "/exporter/exporter_bind" }}
exporter_thread: {{ getv "/exporter/exporter_thread" }}
exporter_auth: {{ getv "/exporter/exporter_auth" }}
metrics:
{{ range $index, $element := ls "/metrics" }}
- name: "{{ getv (printf "/metrics/%d/name" $index) }}"
- name: {{ getv (printf "/metrics/%d/name" $index) }}
identifier_type: {{ getv (printf "/metrics/%d/identifier_type" $index) }}
nodeid: "{{ getv (printf "/metrics/%d/nodeid" $index) }}"
help: "{{ getv (printf "/metrics/%d/help" $index) }}"
nodeid: {{ getv (printf "/metrics/%d/nodeid" $index) }}
help: {{ getv (printf "/metrics/%d/help" $index) }}
{{ end }}

View File

@@ -22,7 +22,7 @@ class UpdateConfigWidget extends Widget
// $etcd->deleteByPrefix("datasource");
$settings = DB::table('settings')
->where('group', 'datasource')
// ->where('group', 'datasource')
->get(); // 获取 group 为 datasource 的所有记录
foreach ($settings as $setting) {