From 3044900cebf4fcd0b301835a9c0940a8f6bce052 Mon Sep 17 00:00:00 2001 From: psxjoy Date: Wed, 9 Oct 2024 02:43:13 +0800 Subject: [PATCH] fix: corrected some typos in the project --- .../ozhera/app/config/DataSourceConfig.java | 4 +-- .../app/service/env/DefaultEnvIpFetch.java | 4 +-- ....java => HeraProjectGroupServiceImpl.java} | 2 +- .../log/agent/common/trace/TraceUtil.java | 2 +- .../apache/ozhera/log/manager/domain/Tpc.java | 4 +-- .../model/pojo/MilogAppMiddlewareRel.java | 2 +- .../log/manager/service/LogTailService.java | 2 +- .../service/impl/LogTailServiceImpl.java | 11 +++--- .../service/impl/LogTemplateServiceImpl.java | 6 ++-- .../impl/MilogConfigNacosServiceImpl.java | 6 ++-- .../impl/StreamPartitionServiceImpl.java | 2 +- .../log/manager/domain/analyse/TopTest.java | 4 +-- .../manager/test/ConfigNacosServiceTest.java | 2 +- .../extension/rocketmq/RocketmqPlugin.java | 2 +- .../apache/ozhera/log/stream/PatterTest.java | 4 +-- ...GorupFacade.java => AlertGroupFacade.java} | 2 +- .../monitor/config/DataSourceConfig.java | 4 +-- .../ozhera/monitor/bo/AlarmPresetMetrics.java | 2 +- .../monitor/dao/model/AlarmHealthResult.java | 2 +- .../monitor/service/ComputeTimerService.java | 4 +-- .../alertmanager/AlarmExprService.java | 2 +- .../alertmanager/AlertServiceAdapt.java | 2 +- .../impl/AlarmExprServiceOuter.java | 14 ++++---- .../alertmanager/impl/AlertManagerImpl.java | 2 +- .../api/ComputeTimerServiceExtension.java | 2 +- .../ComputeTimerServiceExtensionImpl.java | 34 +++++++++---------- .../impl/AppGrafanaMappingServiceImpl.java | 2 +- .../service/impl/ComputeTimerServiceImpl.java | 14 ++++---- .../service/impl/HeraBaseInfoServiceImpl.java | 2 +- .../impl/HeraDashboardServiceImpl.java | 2 +- .../impl/ResourceUsageServiceImpl.java | 2 +- .../model/prometheus/AlertTeamData.java | 2 +- .../model/prometheus/MetricDetailQuery.java | 2 +- .../service/model/prometheus/MetricKind.java | 6 ++-- .../service/prometheus/AlarmService.java | 2 +- .../heraGrafanaTemplate/nodeMonitor.ftl | 2 +- .../ozhera/operator/common/ESIndexConst.java | 2 +- .../handler/HeraResourceEventHandler.java | 12 +++---- ...ketMQSerivce.java => RocketMQService.java} | 2 +- .../agent/config/DataSourceConfiguration.java | 4 +-- .../PrometheusIpServiceExtensionImpl.java | 2 +- .../org/apache/ozhera/webhook/Bootstrap.java | 2 +- trace-etl/docs/extension/extension_cn.md | 2 +- .../trace/etl/es/config/DataSourceConfig.java | 4 +-- .../trace/etl/es/config/TraceConfig.java | 8 ++--- .../etl/es/consumer/ConsumerService.java | 2 +- .../trace/etl/es/queue/impl/TeSnowFlake.java | 4 +-- .../extension/doris/WriteDorisService.java | 2 +- .../etl/extension/es/WriteEsService.java | 2 +- .../etl/manager/config/DataSourceConfig.java | 4 +-- .../manager/filter/RequestHeaderFilter.java | 2 +- .../etl/metadata/config/DataSourceConfig.java | 4 +-- .../etl/nginx/parser/NginxLogToTraceBase.java | 24 ++++++------- .../trace/etl/config/DataSourceConfig.java | 4 +-- .../etl/consumer/MetricsParseService.java | 2 +- .../ozhera/trace/etl/util/ExecutorUtil.java | 6 ++-- .../ozhera/trace/etl/util/TraceUtil.java | 2 +- 57 files changed, 127 insertions(+), 132 deletions(-) rename ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/{HeraPojectGroupServiceImpl.java => HeraProjectGroupServiceImpl.java} (97%) rename ozhera-monitor/ozhera-monitor-api/src/main/java/org/apache/ozhera/monitor/service/{AlertGorupFacade.java => AlertGroupFacade.java} (96%) rename ozhera-operator/ozhera-operator-service/src/main/java/org/apache/ozhera/operator/service/{RocketMQSerivce.java => RocketMQService.java} (99%) diff --git a/ozhera-app/app-server/src/main/java/org/apache/ozhera/app/config/DataSourceConfig.java b/ozhera-app/app-server/src/main/java/org/apache/ozhera/app/config/DataSourceConfig.java index 381d02ffa..09e08ecf6 100644 --- a/ozhera-app/app-server/src/main/java/org/apache/ozhera/app/config/DataSourceConfig.java +++ b/ozhera-app/app-server/src/main/java/org/apache/ozhera/app/config/DataSourceConfig.java @@ -81,12 +81,12 @@ public DataSource masterDataSource() throws PropertyVetoException, NamingExcepti dataSource.setMaxPoolSize(defaultMaxPoolSize); dataSource.setMinPoolSize(defaultMinPoolSize); - setDatasouce(dataSource); + setDatasource(dataSource); return dataSource; } - private void setDatasouce(ComboPooledDataSource dataSource) { + private void setDatasource(ComboPooledDataSource dataSource) { dataSource.setTestConnectionOnCheckin(true); dataSource.setTestConnectionOnCheckout(false); dataSource.setPreferredTestQuery("select 1"); diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/env/DefaultEnvIpFetch.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/env/DefaultEnvIpFetch.java index cafd5c19e..6d6e66fb1 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/env/DefaultEnvIpFetch.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/env/DefaultEnvIpFetch.java @@ -54,7 +54,7 @@ public class DefaultEnvIpFetch { private DefaultNacosEnvIpFetch defaultNacosEnvIpFetch; @Value("${app.ip.fetch.type}") - private String envApppType; + private String envAppType; @NacosValue(value = "${hera.tpc.url}", autoRefreshed = true) private String heraTpcUrl; @@ -70,7 +70,7 @@ public class DefaultEnvIpFetch { public EnvIpFetch getEnvIpFetch() { - if (Objects.equals(EnvIpTypeEnum.HTTP.name().toLowerCase(), envApppType)) { + if (Objects.equals(EnvIpTypeEnum.HTTP.name().toLowerCase(), envAppType)) { return defaultHttpEnvIpFetch; } return defaultNacosEnvIpFetch; diff --git a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraPojectGroupServiceImpl.java b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraProjectGroupServiceImpl.java similarity index 97% rename from ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraPojectGroupServiceImpl.java rename to ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraProjectGroupServiceImpl.java index c61fbf10e..de19397c5 100644 --- a/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraPojectGroupServiceImpl.java +++ b/ozhera-app/app-service/src/main/java/org/apache/ozhera/app/service/impl/HeraProjectGroupServiceImpl.java @@ -34,7 +34,7 @@ */ @Slf4j @Service(registry = "registryConfig", interfaceClass = HeraProjectGroupServiceApi.class, group = "${dubbo.group}") -public class HeraPojectGroupServiceImpl implements HeraProjectGroupServiceApi { +public class HeraProjectGroupServiceImpl implements HeraProjectGroupServiceApi { @Autowired HeraProjectGroupService projectGroupService; diff --git a/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/common/trace/TraceUtil.java b/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/common/trace/TraceUtil.java index 5baf1bfbc..d494d9482 100644 --- a/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/common/trace/TraceUtil.java +++ b/ozhera-log/log-agent/src/main/java/org/apache/ozhera/log/agent/common/trace/TraceUtil.java @@ -123,7 +123,7 @@ private static TSpanData toTSpanData(String[] array) { span.setKind(toTKind(spanKind)); span.setEvents(toTEventList(JSONArray.parseArray(decodeLineBreak(array[MessageUtil.EVENTS])))); span.setTotalRecordedEvents(span.getEventsSize()); - span.setResouce( + span.setResource( toTResource(JSONObject.parseObject(array[MessageUtil.REOUSCES]), specialAttrMap)); span.setExtra(toTExtra(specialAttrMap)); // using links["ref_type=CHILD_OF"] as parent span context and using left as links diff --git a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/domain/Tpc.java b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/domain/Tpc.java index ae15ec023..950aeaac1 100644 --- a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/domain/Tpc.java +++ b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/domain/Tpc.java @@ -217,13 +217,13 @@ public Result saveSpacePerm(MilogSpaceDO spaceDO, String account) { return tpcService.add(nodeAddParam); } - public Result updateSpaceTpc(MilogSpaceParam param, String accout) { + public Result updateSpaceTpc(MilogSpaceParam param, String account) { NodeEditParam edit = new NodeEditParam(); edit.setNodeName(param.getSpaceName()); edit.setDesc(param.getDescription()); edit.setOutId(param.getId()); edit.setOutIdType(OutIdTypeEnum.SPACE.getCode()); - edit.setAccount(accout); + edit.setAccount(account); edit.setUserType(UserTypeEnum.CAS_TYPE.getCode()); return tpcService.edit(edit); } diff --git a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/model/pojo/MilogAppMiddlewareRel.java b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/model/pojo/MilogAppMiddlewareRel.java index 0b72c9aea..2e031501f 100644 --- a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/model/pojo/MilogAppMiddlewareRel.java +++ b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/model/pojo/MilogAppMiddlewareRel.java @@ -46,7 +46,7 @@ public class MilogAppMiddlewareRel extends BaseCommon implements Serializable { @Column(value = "milog_app_id") @ColDefine(customType = "bigint") - @Comment("milog app talble Primary key Id") + @Comment("milog app table Primary key Id") private Long milogAppId; @Column(value = "middleware_id") diff --git a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/LogTailService.java b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/LogTailService.java index c819410f5..99aef3d5a 100644 --- a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/LogTailService.java +++ b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/LogTailService.java @@ -41,7 +41,7 @@ public interface LogTailService { void sengMessageToStream(MilogLogTailDo mt, Integer type); - void handleNaocsConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, Integer type, Integer projectType); + void handleNacosConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, Integer type, Integer projectType); /** * Delete a part of a configuration in the configuration center diff --git a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/LogTailServiceImpl.java b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/LogTailServiceImpl.java index cc477124f..227e3a2ec 100644 --- a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/LogTailServiceImpl.java +++ b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/LogTailServiceImpl.java @@ -28,15 +28,12 @@ import org.apache.ozhera.log.manager.common.utils.ManagerUtil; import org.apache.ozhera.log.manager.common.validation.HeraConfigValid; import org.apache.ozhera.log.manager.dao.*; -import org.apache.ozhera.log.manager.dao.*; import org.apache.ozhera.log.manager.mapper.MilogLogSearchSaveMapper; import org.apache.ozhera.log.manager.mapper.MilogLogTemplateMapper; import org.apache.ozhera.log.manager.model.bo.LogTailParam; import org.apache.ozhera.log.manager.model.bo.MlogParseParam; import org.apache.ozhera.log.manager.model.dto.*; import org.apache.ozhera.log.manager.model.pojo.*; -import org.apache.ozhera.log.manager.model.dto.*; -import org.apache.ozhera.log.manager.model.pojo.*; import org.apache.ozhera.log.manager.model.vo.QuickQueryVO; import org.apache.ozhera.log.manager.service.BaseService; import org.apache.ozhera.log.manager.service.LogTailService; @@ -288,12 +285,12 @@ public void sengMessageToAgent(Long milogAppId, MilogLogTailDo logtailDo) { @Override public void sengMessageToStream(MilogLogTailDo mt, Integer type) { - handleNaocsConfigByMotorRoom(mt, MachineRegionEnum.CN_MACHINE.getEn(), type, ProjectTypeEnum.MIONE_TYPE.getCode()); + handleNacosConfigByMotorRoom(mt, MachineRegionEnum.CN_MACHINE.getEn(), type, ProjectTypeEnum.MIONE_TYPE.getCode()); } @Override - public void handleNaocsConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, Integer type, Integer projectType) { - milogConfigNacosServiceImpl.chooseCurrentEnvNacosSerevice(motorRoomEn); + public void handleNacosConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, Integer type, Integer projectType) { + milogConfigNacosServiceImpl.chooseCurrentEnvNacosService(motorRoomEn); if (OperateEnum.ADD_OPERATE.getCode().equals(type) || OperateEnum.UPDATE_OPERATE.getCode().equals(type)) { milogConfigNacosServiceImpl.publishStreamConfig(mt.getSpaceId(), type, projectType, motorRoomEn); } @@ -304,7 +301,7 @@ public void handleNaocsConfigByMotorRoom(MilogLogTailDo mt, String motorRoomEn, public boolean deleteConfigRemote(Long spaceId, Long id, String motorRoomEn, LogStructureEnum logStructureEnum) { Assert.notNull(spaceId, "deleteConfigRemote spaceId can not null"); Assert.notNull(id, "deleteConfigRemote id can not null"); - milogConfigNacosServiceImpl.chooseCurrentEnvNacosSerevice(motorRoomEn); + milogConfigNacosServiceImpl.chooseCurrentEnvNacosService(motorRoomEn); if (LogStructureEnum.SPACE == logStructureEnum) { milogConfigNacosServiceImpl.publishStreamConfig(spaceId, OperateEnum.DELETE_OPERATE.getCode(), null, motorRoomEn); return true; diff --git a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/LogTemplateServiceImpl.java b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/LogTemplateServiceImpl.java index 0c613c6d4..d10eade49 100644 --- a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/LogTemplateServiceImpl.java +++ b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/LogTemplateServiceImpl.java @@ -78,11 +78,11 @@ private void assembleLogTemplateDetail(List logTemplateDTOList) @Override public Result getLogTemplateById(long logTemplateId) { MilogLogTemplateDO logTemplate = milogLogTemplateMapper.selectById(logTemplateId); - MilogLogTemplateDetailDO tmplateDetail = templateDetailMapper.getByTemplateId(logTemplateId); - if (tmplateDetail == null) { + MilogLogTemplateDetailDO templateDetail = templateDetailMapper.getByTemplateId(logTemplateId); + if (templateDetail == null) { return Result.success(null); } - LogTemplateDetailDTO dto = MilogLongTemplateDetailConvert.INSTANCE.fromDO(logTemplate, tmplateDetail); + LogTemplateDetailDTO dto = MilogLongTemplateDetailConvert.INSTANCE.fromDO(logTemplate, templateDetail); return Result.success(dto); } diff --git a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/MilogConfigNacosServiceImpl.java b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/MilogConfigNacosServiceImpl.java index 88b0a5999..b1db78bcb 100644 --- a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/MilogConfigNacosServiceImpl.java +++ b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/MilogConfigNacosServiceImpl.java @@ -33,7 +33,6 @@ import org.apache.ozhera.log.manager.domain.EsCluster; import org.apache.ozhera.log.manager.mapper.MilogLogTemplateMapper; import org.apache.ozhera.log.manager.model.pojo.*; -import org.apache.ozhera.log.manager.model.pojo.*; import org.apache.ozhera.log.manager.service.MilogConfigNacosService; import org.apache.ozhera.log.manager.service.bind.LogTypeProcessor; import org.apache.ozhera.log.manager.service.bind.LogTypeProcessorFactory; @@ -52,7 +51,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.map.HashedMap; -import org.apache.ozhera.log.manager.service.nacos.impl.*; import org.apache.ozhera.log.model.*; import javax.annotation.Resource; @@ -124,7 +122,7 @@ public void init() { private void initializeNacosConfigurations() { List regions = commonExtensionService.queryMachineRegions(); for (String region : regions) { - chooseCurrentEnvNacosSerevice(region); + chooseCurrentEnvNacosService(region); } } @@ -252,7 +250,7 @@ public void publishNameSpaceConfig(String motorRoomEn, Long spaceId, Long storeI * * @param motorRoomEn */ - public void chooseCurrentEnvNacosSerevice(String motorRoomEn) { + public void chooseCurrentEnvNacosService(String motorRoomEn) { MilogMiddlewareConfig middlewareConfig = milogMiddlewareConfigDao.queryCurrentEnvNacos(motorRoomEn); if (null != middlewareConfig) { ConfigService configService = MultipleNacosConfig.getConfigService(middlewareConfig.getNameServer()); diff --git a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/StreamPartitionServiceImpl.java b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/StreamPartitionServiceImpl.java index 56a5ad777..567f38a12 100644 --- a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/StreamPartitionServiceImpl.java +++ b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/StreamPartitionServiceImpl.java @@ -134,7 +134,7 @@ public PageInfo> queryStreamList(MachinePartitionParam part } private MiLogStreamConfig buildMiLogStreamConfig(String machineRoom) { - logConfigNacosService.chooseCurrentEnvNacosSerevice(machineRoom); + logConfigNacosService.chooseCurrentEnvNacosService(machineRoom); MiLogStreamConfig config = logConfigNacosService.getStreamConfigNacosProvider(machineRoom).getConfig(null); if (config == null) { throw new MilogManageException("当前机房nacos配置不存在"); diff --git a/ozhera-log/log-manager/src/test/java/org/apache/ozhera/log/manager/domain/analyse/TopTest.java b/ozhera-log/log-manager/src/test/java/org/apache/ozhera/log/manager/domain/analyse/TopTest.java index 79bcd4263..ebbf44fee 100644 --- a/ozhera-log/log-manager/src/test/java/org/apache/ozhera/log/manager/domain/analyse/TopTest.java +++ b/ozhera-log/log-manager/src/test/java/org/apache/ozhera/log/manager/domain/analyse/TopTest.java @@ -35,8 +35,8 @@ public void pushBean() { } @Test - public void caclulate() throws IOException { + public void calculate() throws IOException { String storeName = "nr-pay"; -// dateGroupStrategy.caclulate(storeName); +// dateGroupStrategy.calculate(storeName); } } \ No newline at end of file diff --git a/ozhera-log/log-manager/src/test/java/org/apache/ozhera/log/manager/test/ConfigNacosServiceTest.java b/ozhera-log/log-manager/src/test/java/org/apache/ozhera/log/manager/test/ConfigNacosServiceTest.java index fe35f8196..7ed6ceed4 100644 --- a/ozhera-log/log-manager/src/test/java/org/apache/ozhera/log/manager/test/ConfigNacosServiceTest.java +++ b/ozhera-log/log-manager/src/test/java/org/apache/ozhera/log/manager/test/ConfigNacosServiceTest.java @@ -85,7 +85,7 @@ public void testSyncSpace() { // LogTailServiceImpl milogLogtailService = Ioc.ins().getBean(LogTailServiceImpl.class); // MilogLogTailDo mt = new MilogLogTailDo(); // mt.setSpaceId(3L); -// milogLogtailService.handleNaocsConfigByMotorRoom(mt, MachineRegionEnum.CN_MACHINE.getEn(), OperateEnum.ADD_OPERATE.getCode(), ProjectTypeEnum.MIONE_TYPE.getCode()); +// milogLogtailService.handleNacosConfigByMotorRoom(mt, MachineRegionEnum.CN_MACHINE.getEn(), OperateEnum.ADD_OPERATE.getCode(), ProjectTypeEnum.MIONE_TYPE.getCode()); // Assert.assertNotNull(true); } } diff --git a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/extension/rocketmq/RocketmqPlugin.java b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/extension/rocketmq/RocketmqPlugin.java index 303d897af..424e25ca1 100644 --- a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/extension/rocketmq/RocketmqPlugin.java +++ b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/extension/rocketmq/RocketmqPlugin.java @@ -44,7 +44,7 @@ public static RocketmqConfig buildRocketmqConfig(String ak, String sk, String cl config.setNamesrvAddr(StringUtils.isNotEmpty(clusterInfo) ? clusterInfo : ins.get("rocketmq_namesrv_addr", "")); config.setAk(StringUtils.isNotEmpty(ak) ? ak : ins.get("rocketmq_ak", "")); config.setSk(StringUtils.isNotEmpty(sk) ? sk : ins.get("rocketmq_sk", "")); - config.setConsumerFromWhere(ins.get("rockermq_consumer_offset", "")); + config.setConsumerFromWhere(ins.get("rocketmq_consumer_offset", "")); config.setConsumerGroup(Constant.DEFAULT_CONSUMER_GROUP + tag); if (SinkJobEnum.BACKUP_JOB == jobType) { config.setConsumerGroup(Constant.DEFAULT_CONSUMER_GROUP + tag + "_" + BACKUP_PREFIX); diff --git a/ozhera-log/log-stream/src/test/java/org/apache/ozhera/log/stream/PatterTest.java b/ozhera-log/log-stream/src/test/java/org/apache/ozhera/log/stream/PatterTest.java index a5b2b12ff..23f805653 100644 --- a/ozhera-log/log-stream/src/test/java/org/apache/ozhera/log/stream/PatterTest.java +++ b/ozhera-log/log-stream/src/test/java/org/apache/ozhera/log/stream/PatterTest.java @@ -63,9 +63,9 @@ public void test2() { public void test3() { String regex = "\\bcat\\b"; final String input = "cat cat cat cattie cat"; - //Create a Pettern object + //Create a Pattern object Pattern p = Pattern.compile(regex); - //Create a Pettern object... + //Create a Pattern object... Matcher m = p.matcher(input); int count = 0; if (m.find()) { diff --git a/ozhera-monitor/ozhera-monitor-api/src/main/java/org/apache/ozhera/monitor/service/AlertGorupFacade.java b/ozhera-monitor/ozhera-monitor-api/src/main/java/org/apache/ozhera/monitor/service/AlertGroupFacade.java similarity index 96% rename from ozhera-monitor/ozhera-monitor-api/src/main/java/org/apache/ozhera/monitor/service/AlertGorupFacade.java rename to ozhera-monitor/ozhera-monitor-api/src/main/java/org/apache/ozhera/monitor/service/AlertGroupFacade.java index f31f59024..76d908f5f 100644 --- a/ozhera-monitor/ozhera-monitor-api/src/main/java/org/apache/ozhera/monitor/service/AlertGorupFacade.java +++ b/ozhera-monitor/ozhera-monitor-api/src/main/java/org/apache/ozhera/monitor/service/AlertGroupFacade.java @@ -20,7 +20,7 @@ import java.util.List; -public interface AlertGorupFacade { +public interface AlertGroupFacade { List query(String account, String likeName); diff --git a/ozhera-monitor/ozhera-monitor-server/src/main/java/org/apache/ozhera/monitor/config/DataSourceConfig.java b/ozhera-monitor/ozhera-monitor-server/src/main/java/org/apache/ozhera/monitor/config/DataSourceConfig.java index 25c904386..4dc87b844 100644 --- a/ozhera-monitor/ozhera-monitor-server/src/main/java/org/apache/ozhera/monitor/config/DataSourceConfig.java +++ b/ozhera-monitor/ozhera-monitor-server/src/main/java/org/apache/ozhera/monitor/config/DataSourceConfig.java @@ -89,12 +89,12 @@ public DataSource masterDataSource() throws PropertyVetoException, NamingExcepti dataSource.setMaxPoolSize(defaultMaxPoolSize); dataSource.setMinPoolSize(defaultMinPoolSize); - setDatasouce(dataSource); + setDatasource(dataSource); return dataSource; } - private void setDatasouce(ComboPooledDataSource dataSource) { + private void setDatasource(ComboPooledDataSource dataSource) { dataSource.setTestConnectionOnCheckin(true); dataSource.setTestConnectionOnCheckout(false); dataSource.setPreferredTestQuery("select 1"); diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/bo/AlarmPresetMetrics.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/bo/AlarmPresetMetrics.java index 827a346d9..87f071342 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/bo/AlarmPresetMetrics.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/bo/AlarmPresetMetrics.java @@ -67,7 +67,7 @@ public enum AlarmPresetMetrics { http_client_slow_query("http_client_slow_query","Http调出慢查询", "Http-call-in-slow-query-count",MetricsUnit.UNIT_COUNT, SendAlertGroupKey.APP_METHOD, AlarmStrategyType.INTERFACE,InterfaceMetricTypes.slow_times,BasicUrlType.hera_dash_ip,null), /** - * metric -dobbo + * metric -dubbo */ dubbo_provider_error_times("dubbo_provider_error_times","Dubbo调入异常数", "Dubbo-call-in-exception-count", MetricsUnit.UNIT_COUNT, SendAlertGroupKey.APP_METHOD, AlarmStrategyType.INTERFACE,InterfaceMetricTypes.error_times,BasicUrlType.hera_dash_ip,null), diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/dao/model/AlarmHealthResult.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/dao/model/AlarmHealthResult.java index 7744c0c26..12540880b 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/dao/model/AlarmHealthResult.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/dao/model/AlarmHealthResult.java @@ -52,7 +52,7 @@ public class AlarmHealthResult { private Integer httpServerAvailability;//httpServer可用性(包括可用性、错误数配置任一) 2分 private Integer httpServerQps;//httpServer qps 1分 private Integer httpServerTimeCost;//httpServer 耗时 1分 - private Integer httpClientAvailability;//httpCleint可用性(包括可用性、错误数配置任一) 1分 + private Integer httpClientAvailability;//httpClient可用性(包括可用性、错误数配置任一) 1分 private Integer httpClientQps;//httpClient qps 1分 private Integer httpClientTimeCost;//httpClient 耗时 1分 private Integer dubboProviderAvailability;//dubboProvider可用性(包括可用性、错误数配置任一) 2分 diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/ComputeTimerService.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/ComputeTimerService.java index 744fe2e95..6b9031a36 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/ComputeTimerService.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/ComputeTimerService.java @@ -38,10 +38,10 @@ public interface ComputeTimerService { * @param project * @param startTime * @param endTime - * @param timeDurarion + * @param timeDuration * @param param */ - AppAlarmData getAppAlarmData(ProjectInfo project, Long startTime, Long endTime, String timeDurarion, Long step, + AppAlarmData getAppAlarmData(ProjectInfo project, Long startTime, Long endTime, String timeDuration, Long step, AppMonitorRequest param); diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/AlarmExprService.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/AlarmExprService.java index 2a28a00bf..f770c8740 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/AlarmExprService.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/AlarmExprService.java @@ -31,7 +31,7 @@ public interface AlarmExprService { public String getContainerCpuResourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData); - public String getContainerMemReourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData); + public String getContainerMemResourceAlarmExpr(Integer projectId, String projectName, String op, double value, boolean isK8s, AlarmRuleData ruleData); public Map getEnvIpMapping(Integer projectId, String projectName); } diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/AlertServiceAdapt.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/AlertServiceAdapt.java index 364b6db72..fb94e9617 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/AlertServiceAdapt.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/AlertServiceAdapt.java @@ -61,7 +61,7 @@ public Result enableRule(Integer alertId,Integer pauseStatus,String identifyId, return alertManager.enableRule(alertId,pauseStatus,identifyId,user); } - public Result queryRuels(JsonObject params, String identifyId, String user){ + public Result queryRules(JsonObject params, String identifyId, String user){ return alertManager.queryRuels(params,identifyId,user); } diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/impl/AlarmExprServiceOuter.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/impl/AlarmExprServiceOuter.java index 7c7b1be4c..17c45661f 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/impl/AlarmExprServiceOuter.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/impl/AlarmExprServiceOuter.java @@ -273,9 +273,9 @@ public String getExpr(AppAlarmRule rule, String scrapeIntervel, AlarmRuleData ru case "container_cpu_resource_use_rate": return getContainerCpuResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData); case "container_mem_resource_use_rate": - return getContainerMemReourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData); + return getContainerMemResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData); case "container_disk_use_rate": - return getContainerDiskReourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData); + return getContainerDiskResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),false,ruleData); case "k8s_container_cpu_use_rate": return getContainerCpuAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),true,ruleData); @@ -289,7 +289,7 @@ public String getExpr(AppAlarmRule rule, String scrapeIntervel, AlarmRuleData ru case "k8s_cpu_resource_use_rate": return getContainerCpuResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),true,ruleData); case "k8s_mem_resource_use_rate": - return getContainerMemReourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),true,ruleData); + return getContainerMemResourceAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),true,ruleData); case "k8s_cpu_avg_use_rate": return getK8sCpuAvgUsageAlarmExpr(rule.getProjectId(),app.getProjectName(),rule.getOp(),rule.getValue(),ruleData); @@ -719,7 +719,7 @@ public String getContainerMemAlarmExpr(Integer projectId,String projectName,Stri return exprBuilder.toString(); } - public String getContainerMemReourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData){ + public String getContainerMemResourceAlarmExpr(Integer projectId, String projectName, String op, double value, boolean isK8s, AlarmRuleData ruleData){ StringBuilder exprBuilder = new StringBuilder(); exprBuilder.append("(sum(avg_over_time(container_memory_rss{"); @@ -764,11 +764,11 @@ public String getContainerMemReourceAlarmExpr(Integer projectId,String projectNa exprBuilder.append("}[1d])) by (container_label_PROJECT_ID,application,ip,job,name,system,instance,id,serverEnv,serverZone)) * 100"); exprBuilder.append(op).append(value); - log.info("getContainerMemReourceAlarmExpr param: projectId:{}, projectName:{}, op:{},value:{}, return:{}",projectId, projectName, op,value, exprBuilder.toString()); + log.info("getContainerMemResourceAlarmExpr param: projectId:{}, projectName:{}, op:{},value:{}, return:{}",projectId, projectName, op,value, exprBuilder.toString()); return exprBuilder.toString(); } - public String getContainerDiskReourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData){ + public String getContainerDiskResourceAlarmExpr(Integer projectId,String projectName,String op,double value,boolean isK8s,AlarmRuleData ruleData){ StringBuilder exprBuilder = new StringBuilder(); exprBuilder.append("clamp_max(sum(container_fs_usage_bytes{"); @@ -781,7 +781,7 @@ public String getContainerDiskReourceAlarmExpr(Integer projectId,String projectN exprBuilder.append("application='").append(projectId).append("_").append(projectName.replaceAll("-","_")).append("'"); exprBuilder.append("}) by (application,name,ip,serverEnv)/10737418240 ,1) * 100 "); exprBuilder.append(op).append(value); - log.info("getContainerDiskReourceAlarmExpr param: projectId:{}, projectName:{}, op:{},value:{}, return:{}",projectId, projectName, op,value, exprBuilder.toString()); + log.info("getContainerDiskResourceAlarmExpr param: projectId:{}, projectName:{}, op:{},value:{}, return:{}",projectId, projectName, op,value, exprBuilder.toString()); return exprBuilder.toString(); } diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/impl/AlertManagerImpl.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/impl/AlertManagerImpl.java index 8b785e545..711d38a2f 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/impl/AlertManagerImpl.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/alertmanager/impl/AlertManagerImpl.java @@ -197,7 +197,7 @@ public Result>> searchUser(String user, String searchNam param.setUserAcc(userVoSearch == null ? null : userVoSearch.getAccount()); // param.setType(UserTypeEnum.EMAIL.getCode()); com.xiaomi.youpin.infra.rpc.Result> userResult = userFacade.list(param); - log.info("userFacade reqeust param:{},result:{}",gson.toJson(param),gson.toJson(userResult)); + log.info("userFacade request param:{},result:{}",gson.toJson(param),gson.toJson(userResult)); if (userResult == null || userResult.getData() == null || CollectionUtils.isEmpty(userResult.getData().getList())) { return Result.success(page); } diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/api/ComputeTimerServiceExtension.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/api/ComputeTimerServiceExtension.java index 703859126..2495a0b6a 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/api/ComputeTimerServiceExtension.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/api/ComputeTimerServiceExtension.java @@ -21,5 +21,5 @@ public interface ComputeTimerServiceExtension { - void computByMetricType(AppMonitorRequest param, String appName, MetricKind metricKind, AppAlarmData.AppAlarmDataBuilder dataBuilder, Long startTime, Long endTime, String timeDurarion, Long step); + void computByMetricType(AppMonitorRequest param, String appName, MetricKind metricKind, AppAlarmData.AppAlarmDataBuilder dataBuilder, Long startTime, Long endTime, String timeDuration, Long step); } diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/api/impl/ComputeTimerServiceExtensionImpl.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/api/impl/ComputeTimerServiceExtensionImpl.java index 319d22b6f..932dedbd6 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/api/impl/ComputeTimerServiceExtensionImpl.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/api/impl/ComputeTimerServiceExtensionImpl.java @@ -52,7 +52,7 @@ public class ComputeTimerServiceExtensionImpl implements ComputeTimerServiceExte private PrometheusService prometheusService; @Override - public void computByMetricType(AppMonitorRequest param, String appName, MetricKind metricKind, AppAlarmData.AppAlarmDataBuilder dataBuilder, Long startTime, Long endTime, String timeDurarion, Long step) { + public void computByMetricType(AppMonitorRequest param, String appName, MetricKind metricKind, AppAlarmData.AppAlarmDataBuilder dataBuilder, Long startTime, Long endTime, String timeDuration, Long step) { try { //当前页面 @@ -64,19 +64,19 @@ public void computByMetricType(AppMonitorRequest param, String appName, MetricKi case http: // http请求异常统计 - Result httpExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.httpError.getCode(),getLable(MetricKind.MetricType.http_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result httpExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.httpError.getCode(),getLable(MetricKind.MetricType.http_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.httpExceptionNum(countRecordMetric(httpExceptions)); // httpClient请求异常统计 - Result httpClientExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.httpClientError.getCode(), getLable(MetricKind.MetricType.http_client_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result httpClientExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.httpClientError.getCode(), getLable(MetricKind.MetricType.http_client_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.httpClientExceptionNum(countRecordMetric(httpClientExceptions)); // http请求慢查询统计 - Result httpSlowQuery = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.httpSlowQuery.getCode(),getLable(MetricKind.MetricType.http_slow, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result httpSlowQuery = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.httpSlowQuery.getCode(),getLable(MetricKind.MetricType.http_slow, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.httpSlowNum(countRecordMetric(httpSlowQuery)); // httpClient请求慢查询统计 - Result httpClientSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.httpClientSlowQuery.getCode(), getLable(MetricKind.MetricType.http_client_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result httpClientSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.httpClientSlowQuery.getCode(), getLable(MetricKind.MetricType.http_client_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.httpClientSlowNum(countRecordMetric(httpClientSlowQuerys)); break; @@ -84,17 +84,17 @@ public void computByMetricType(AppMonitorRequest param, String appName, MetricKi case dubbo: // dubbo请求异常统计 - Result dubboExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.dubboConsumerError.getCode(), getLable(MetricKind.MetricType.dubbo_consumer_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result dubboExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.dubboConsumerError.getCode(), getLable(MetricKind.MetricType.dubbo_consumer_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.dubboExceptionNum(countRecordMetric(dubboExceptions)); // dubbo请求异常统计 - Result dubboPExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.dubboProvider.getCode(), getLable(MetricKind.MetricType.dubbo_provider_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result dubboPExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.dubboProvider.getCode(), getLable(MetricKind.MetricType.dubbo_provider_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.dubboPExceptionNum(countRecordMetric(dubboPExceptions)); // dubbo consumer慢请求统计 - Result dubboConsumerSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.dubboConsumerSlowQuery.getCode(), getLable(MetricKind.MetricType.dubbo_consumer_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result dubboConsumerSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.dubboConsumerSlowQuery.getCode(), getLable(MetricKind.MetricType.dubbo_consumer_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.dubboCSlowQueryNum(countRecordMetric(dubboConsumerSlowQuerys)); log.info("projectName:{},dubboConsumerSlowQuerys:{}",appName,dubboConsumerSlowQuerys); // dubbo provider慢请求统计 - Result dubboProviderSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.dubboProviderSlowQuery.getCode(), getLable(MetricKind.MetricType.dubbo_provider_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result dubboProviderSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.dubboProviderSlowQuery.getCode(), getLable(MetricKind.MetricType.dubbo_provider_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.dubboProviderSlowQueryNum(countRecordMetric(dubboProviderSlowQuerys)); log.info("projectName:{},dubboProviderSlowQuerys:{}",appName,dubboProviderSlowQuerys); @@ -102,35 +102,35 @@ public void computByMetricType(AppMonitorRequest param, String appName, MetricKi case grpc : // grpc请求异常统计 - Result grpcServerExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.grpcServerError.getCode(), getLable(MetricKind.MetricType.grpc_server_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result grpcServerExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.grpcServerError.getCode(), getLable(MetricKind.MetricType.grpc_server_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.grpcServerErrorNum(countRecordMetric(grpcServerExceptions)); - Result grpcClientExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.grpcClientError.getCode(), getLable(MetricKind.MetricType.grpc_client_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result grpcClientExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.grpcClientError.getCode(), getLable(MetricKind.MetricType.grpc_client_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.grpcClientErrorNum(countRecordMetric(grpcClientExceptions)); - Result grpcClientSlowQuery = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.grpcClientSlowQuery.getCode(), getLable(MetricKind.MetricType.grpc_client_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result grpcClientSlowQuery = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.grpcClientSlowQuery.getCode(), getLable(MetricKind.MetricType.grpc_client_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.grpcClientSlowQueryNum(countRecordMetric(grpcClientSlowQuery)); - Result grpcServerSlowQuery = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.grpcServerSlowQuery.getCode(), getLable(MetricKind.MetricType.grpc_server_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result grpcServerSlowQuery = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.grpcServerSlowQuery.getCode(), getLable(MetricKind.MetricType.grpc_server_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.grpcServerSlowQueryNum(countRecordMetric(grpcServerSlowQuery)); break; case db : // mysql请求异常统计 - Result sqlExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.dbError.getCode(), getLable(MetricKind.MetricType.db_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result sqlExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.dbError.getCode(), getLable(MetricKind.MetricType.db_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.sqlExceptionNum(countRecordMetric(sqlExceptions)); // mysql慢请求统计 - Result sqlSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.dbSlowQuery.getCode(), getLable(MetricKind.MetricType.db_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result sqlSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.dbSlowQuery.getCode(), getLable(MetricKind.MetricType.db_slow_query, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.sqlSlowQueryNum(countRecordMetric(sqlSlowQuerys)); break; case redis : // redis请求异常统计 - Result redisExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.redisError.getCode(), getLable(MetricKind.MetricType.redis_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result redisExceptions = prometheusService.queryRangeSumOverTime(ReqErrorMetrics.redisError.getCode(), getLable(MetricKind.MetricType.redis_exception, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.redisExceptionNum(countRecordMetric(redisExceptions)); - Result redisSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.redisSlow.getCode(), getLable(MetricKind.MetricType.redis_slow, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDurarion,null); + Result redisSlowQuerys = prometheusService.queryRangeSumOverTime(ReqSlowMetrics.redisSlow.getCode(), getLable(MetricKind.MetricType.redis_slow, curMetricType, param), appName, MetricSuffix._total.name(), startTime, endTime, step, timeDuration,null); dataBuilder.redisSlowNum(countRecordMetric(redisSlowQuerys)); break; diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/AppGrafanaMappingServiceImpl.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/AppGrafanaMappingServiceImpl.java index ca774e0af..4bf59ff21 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/AppGrafanaMappingServiceImpl.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/AppGrafanaMappingServiceImpl.java @@ -227,7 +227,7 @@ public void createTmpByAppBaseInfo(HeraAppBaseInfoModel baseInfo) { grafanaMapping.setMioneEnv(grafanaDirByCode); int i = this.saveOrUpdate(grafanaMapping); if (i > 0) { - log.info("createTmpByAppBaseInfo sucess!grafanaMapping:{}", grafanaMapping.toString()); + log.info("createTmpByAppBaseInfo success!grafanaMapping:{}", grafanaMapping.toString()); } else { log.info("createTmpByAppBaseInfo fail!grafanaMapping:{}", grafanaMapping.toString()); } diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/ComputeTimerServiceImpl.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/ComputeTimerServiceImpl.java index 6fc57c83a..f8bea1764 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/ComputeTimerServiceImpl.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/ComputeTimerServiceImpl.java @@ -85,7 +85,7 @@ public void destory() { public Result> getProjectStatistics(AppMonitorRequest param) { final Long endTime = CommonUtil.toSeconds(System.currentTimeMillis()); final Long startTime = endTime - param.getDuration(); - final String timeDurarion = param.getDuration() + "s"; + final String timeDuration = param.getDuration() + "s"; final Long step = param.getDuration(); int projectSize = param.getProjectList().size() > 50 ? 50 : param.getProjectList().size(); List> callList = new ArrayList<>(); @@ -97,7 +97,7 @@ public Result> getProjectStatistics(AppMonitorRequest param) callList.add(new Callable() { @Override public AppAlarmData call() throws Exception { - return getAppAlarmData(project, startTime, endTime, timeDurarion, step, param); + return getAppAlarmData(project, startTime, endTime, timeDuration, step, param); } }); } @@ -124,11 +124,11 @@ public AppAlarmData call() throws Exception { * @param project * @param startTime * @param endTime - * @param timeDurarion + * @param timeDuration * @param param */ @Override - public AppAlarmData getAppAlarmData(ProjectInfo project, Long startTime, Long endTime, String timeDurarion, + public AppAlarmData getAppAlarmData(ProjectInfo project, Long startTime, Long endTime, String timeDuration, Long step, AppMonitorRequest param) { String appName = new StringBuilder().append(project.getId()).append("_") .append(project.getName().replaceAll("-", "_")).toString(); @@ -149,7 +149,7 @@ public AppAlarmData getAppAlarmData(ProjectInfo project, Long startTime, Long en return new Callable() { @Override public Void call() throws Exception { - computByMetricType(param, appName, kind, dataBuilder, startTime, endTime, timeDurarion, step); + computByMetricType(param, appName, kind, dataBuilder, startTime, endTime, timeDuration, step); return null; } }; @@ -181,10 +181,10 @@ public Void call() throws Exception { } private void computByMetricType(AppMonitorRequest param, String appName, MetricKind metricKind, - AppAlarmData.AppAlarmDataBuilder dataBuilder, Long startTime, Long endTime, String timeDurarion, + AppAlarmData.AppAlarmDataBuilder dataBuilder, Long startTime, Long endTime, String timeDuration, Long step) { computeTimerServiceExtension.computByMetricType(param, appName, metricKind, dataBuilder, startTime, endTime, - timeDurarion, step); + timeDuration, step); } @Override public AppAlarmData countAppMetricData(AppMonitorRequest param) { diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraBaseInfoServiceImpl.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraBaseInfoServiceImpl.java index fd76b6582..2cb55874f 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraBaseInfoServiceImpl.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraBaseInfoServiceImpl.java @@ -186,7 +186,7 @@ public void deleAppById(Integer id) { Integer integer = this.deleteByIdRemote(id); if (integer.intValue() > 0) { - log.info("deleAppById sucess!dataId:{}", id); + log.info("deleAppById success!dataId:{}", id); } else { log.info("deleAppById fail!dataId:{}", id); } diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraDashboardServiceImpl.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraDashboardServiceImpl.java index 77e9a7212..79c4dd189 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraDashboardServiceImpl.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/HeraDashboardServiceImpl.java @@ -171,7 +171,7 @@ public Result createGrafanaResources(DashboardDTO dashboardDTO) { //grafana template replace template variable,request grafana generate dashboard and panel. createDefaultGrafanaDashboard(datasourceUid, header); - //Write the url returned by the panel back to mimonitor's nacos configuration + //Write the url returned by the panel back to monitor's nacos configuration try { ConfigService configService = NacosFactory.createConfigService(nacosAddress); String nacosResult = configService.getConfig(DashboardConstant.DEFAULT_MIMONITOR_NACOS_CONFIG, diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/ResourceUsageServiceImpl.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/ResourceUsageServiceImpl.java index 0336d3998..32e26f5ec 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/ResourceUsageServiceImpl.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/impl/ResourceUsageServiceImpl.java @@ -81,7 +81,7 @@ public List getCpuUsageData() { @Override public List getMemUsageData() { - String mimonitor = alarmExprService.getContainerMemReourceAlarmExpr(null, "mimonitor", "<", + String mimonitor = alarmExprService.getContainerMemResourceAlarmExpr(null, "mimonitor", "<", Integer.valueOf(resourceAlarm), false, null); Result pageDataResult = prometheusService.queryByMetric(mimonitor); PageData data = pageDataResult.getData(); diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/AlertTeamData.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/AlertTeamData.java index c40b2f235..7f431420d 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/AlertTeamData.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/AlertTeamData.java @@ -32,7 +32,7 @@ public class AlertTeamData implements Serializable { String manager;//duty manager String[] members; String chat_id;//feishu group ID - String cretaed_by; + String created_by; Long created_time; Integer goc_oncall_id;//migoc oncall id diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/MetricDetailQuery.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/MetricDetailQuery.java index 4df815fc9..3d9608b78 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/MetricDetailQuery.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/MetricDetailQuery.java @@ -58,7 +58,7 @@ public class MetricDetailQuery implements Serializable { private String errorType;// error/timeout private String serverIp; - //dubbo label (metheodName与http的uri共用,当type为http当时候,methodName代表uri) + //dubbo label (methodName与http的uri共用,当type为http当时候,methodName代表uri) private String methodName; private String serviceName; diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/MetricKind.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/MetricKind.java index 02917280a..79a3075d5 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/MetricKind.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/model/prometheus/MetricKind.java @@ -77,9 +77,9 @@ public enum MetricType{ http_slow("httpSlow","http慢查询","http"), http_client_exception("httpClientException","httpClient异常","http"), http_client_slow_query("httpClientSlow","httpClient慢查询","http"), - dubbo_consumer_exception("dubboConsumerExcption","dubboConsumer异常","dubbo"), - dubbo_provider_exception("dubboProviderExcption","dubboProvider异常","dubbo"), - dubbo_provider_sla_exception("dubboProviderSLAExcption","dubboProviderSLA异常","dubbo"), + dubbo_consumer_exception("dubboConsumerException","dubboConsumer异常","dubbo"), + dubbo_provider_exception("dubboProviderException","dubboProvider异常","dubbo"), + dubbo_provider_sla_exception("dubboProviderSLAException","dubboProviderSLA异常","dubbo"), dubbo_consumer_slow_query("dubboConsumerSlow","dubboConsumer慢查询","dubbo"), dubbo_provider_slow_query("dubboProviderSlow","dubboProvider慢查询","dubbo"), db_exception("dbException","db异常","db"), diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/prometheus/AlarmService.java b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/prometheus/AlarmService.java index 8fbae6883..2eacdc832 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/prometheus/AlarmService.java +++ b/ozhera-monitor/ozhera-monitor-service/src/main/java/org/apache/ozhera/monitor/service/prometheus/AlarmService.java @@ -642,7 +642,7 @@ public Result queryRuels(Integer iamId, String user, String alert, Str params.addProperty("expr",expr); } - return alertServiceAdapt.queryRuels(params,String.valueOf(iamId),user); + return alertServiceAdapt.queryRules(params,String.valueOf(iamId),user); } /** diff --git a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/nodeMonitor.ftl b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/nodeMonitor.ftl index 9860a5ff2..ef137a643 100644 --- a/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/nodeMonitor.ftl +++ b/ozhera-monitor/ozhera-monitor-service/src/main/resources/heraGrafanaTemplate/nodeMonitor.ftl @@ -776,7 +776,7 @@ { "aliasColors": { "localhost:9100_总内存": "dark-red", -"内存_Avaliable": "#6ED0E0", +"内存_Available": "#6ED0E0", "内存_Cached": "#EF843C", "内存_Free": "#629E51", "内存_Total": "#6d1f62", diff --git a/ozhera-operator/ozhera-operator-common/src/main/java/org/apache/ozhera/operator/common/ESIndexConst.java b/ozhera-operator/ozhera-operator-common/src/main/java/org/apache/ozhera/operator/common/ESIndexConst.java index 93f1e4ee4..828a0446b 100644 --- a/ozhera-operator/ozhera-operator-common/src/main/java/org/apache/ozhera/operator/common/ESIndexConst.java +++ b/ozhera-operator/ozhera-operator-common/src/main/java/org/apache/ozhera/operator/common/ESIndexConst.java @@ -260,7 +260,7 @@ public class ESIndexConst { " \"val\\r\\nue\": {\n" + " \"type\": \"keyword\"\n" + " },\n" + - " \"v\\r\\nalue\": {\n" + + " \"v\\r\\nvalue\": {\n" + " \"type\": \"keyword\"\n" + " },\n" + " \"tagType\": {\n" + diff --git a/ozhera-operator/ozhera-operator-service/src/main/java/org/apache/ozhera/operator/handler/HeraResourceEventHandler.java b/ozhera-operator/ozhera-operator-service/src/main/java/org/apache/ozhera/operator/handler/HeraResourceEventHandler.java index 17017ea39..97163b5cd 100644 --- a/ozhera-operator/ozhera-operator-service/src/main/java/org/apache/ozhera/operator/handler/HeraResourceEventHandler.java +++ b/ozhera-operator/ozhera-operator-service/src/main/java/org/apache/ozhera/operator/handler/HeraResourceEventHandler.java @@ -38,7 +38,7 @@ import org.apache.ozhera.operator.common.K8sUtilBean; import org.apache.ozhera.operator.common.ResourceTypeEnum; import org.apache.ozhera.operator.service.ESService; -import org.apache.ozhera.operator.service.RocketMQSerivce; +import org.apache.ozhera.operator.service.RocketMQService; import org.mariadb.jdbc.Driver; @@ -80,7 +80,7 @@ public class HeraResourceEventHandler implements ResourceEventHandler getK8sNodeIp(String type) { // get Node list NodeList nodeList = client.nodes().list(); for (Node node : nodeList.getItems()) { - // fetch Node adress list + // fetch Node address list for (NodeAddress address : node.getStatus().getAddresses()) { res.add(address.getAddress()); } diff --git a/ozhera-webhook/ozhera-webhook-server/src/main/java/org/apache/ozhera/webhook/Bootstrap.java b/ozhera-webhook/ozhera-webhook-server/src/main/java/org/apache/ozhera/webhook/Bootstrap.java index 8b8d6e327..ba783175b 100644 --- a/ozhera-webhook/ozhera-webhook-server/src/main/java/org/apache/ozhera/webhook/Bootstrap.java +++ b/ozhera-webhook/ozhera-webhook-server/src/main/java/org/apache/ozhera/webhook/Bootstrap.java @@ -184,7 +184,7 @@ private static String getCertificate(String csrName, String csrBase64) { } return certificate; } catch (Throwable t) { - throw new RuntimeException("laod yaml error : ", t); + throw new RuntimeException("load yaml error : ", t); } } diff --git a/trace-etl/docs/extension/extension_cn.md b/trace-etl/docs/extension/extension_cn.md index 7c1816c14..b1a8679eb 100644 --- a/trace-etl/docs/extension/extension_cn.md +++ b/trace-etl/docs/extension/extension_cn.md @@ -10,7 +10,7 @@ ## 1、新建module -需要在`trace-etl-extension`下新建modulr,命名格式是以`trace-etl-${自定义}-extension`格式。例如,RocketMQ的扩展,就命名为:`trace-etl-rocketmq-extension`。 +需要在`trace-etl-extension`下新建module,命名格式是以`trace-etl-${自定义}-extension`格式。例如,RocketMQ的扩展,就命名为:`trace-etl-rocketmq-extension`。 ## 2、实现接口 diff --git a/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/config/DataSourceConfig.java b/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/config/DataSourceConfig.java index 0d2e515cf..68e4ce8f2 100644 --- a/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/config/DataSourceConfig.java +++ b/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/config/DataSourceConfig.java @@ -70,12 +70,12 @@ public DataSource masterDataSource() throws PropertyVetoException, NamingExcepti dataSource.setMaxPoolSize(defaultMaxPoolSize); dataSource.setMinPoolSize(defaultMinPoolSize); - setDatasouce(dataSource); + setDatasource(dataSource); return dataSource; } - private void setDatasouce(ComboPooledDataSource dataSource) { + private void setDatasource(ComboPooledDataSource dataSource) { dataSource.setTestConnectionOnCheckin(true); dataSource.setTestConnectionOnCheckout(false); dataSource.setPreferredTestQuery("select 1"); diff --git a/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/config/TraceConfig.java b/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/config/TraceConfig.java index b8918505e..b63f9b876 100644 --- a/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/config/TraceConfig.java +++ b/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/config/TraceConfig.java @@ -54,7 +54,7 @@ public void init() { try { List all = managerService.getAll(new HeraTraceConfigVo()); for (HeraTraceEtlConfig config : all) { - heraTraceConfig.put(getServiceName(config), defalueConfig(config)); + heraTraceConfig.put(getServiceName(config), defaultConfig(config)); } }catch(Throwable t){ log.error("schedule trace config error : ",t); @@ -68,12 +68,12 @@ public HeraTraceEtlConfig getConfig(String serviceName) { public void insert(HeraTraceEtlConfig config) { log.info("trace insert config : "+config); - heraTraceConfig.putIfAbsent(getServiceName(config), defalueConfig(config)); + heraTraceConfig.putIfAbsent(getServiceName(config), defaultConfig(config)); } public void update(HeraTraceEtlConfig config) { log.info("trace update config : "+config); - heraTraceConfig.put(getServiceName(config), defalueConfig(config)); + heraTraceConfig.put(getServiceName(config), defaultConfig(config)); } public void delete(HeraTraceEtlConfig config) { @@ -87,7 +87,7 @@ private String getServiceName(HeraTraceEtlConfig config) { return sb.toString(); } - private HeraTraceEtlConfig defalueConfig(HeraTraceEtlConfig config){ + private HeraTraceEtlConfig defaultConfig(HeraTraceEtlConfig config){ if(config == null){ return null; } diff --git a/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/consumer/ConsumerService.java b/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/consumer/ConsumerService.java index 30cca1c50..a23b0c48b 100644 --- a/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/consumer/ConsumerService.java +++ b/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/consumer/ConsumerService.java @@ -312,7 +312,7 @@ private void initSecondRocksTask() { String secondKey = snowFlake.recoverLastTimestamp(TeSnowFlake.SECOND_TIMESTAMP_REDIS_PREFIX); final String secondLastRocksKey = secondKey == null ? System.currentTimeMillis() + "_" + LocalStorages.secondRocksKeySuffix.get() : secondKey; - // The local message thread is read for the sencond time + // The local message thread is read for the second time ExecutorUtil.submitRocksDBRead(() -> { try { secondRocksdbStoreService.delayTake(secondLastRocksKey, secondGap, new Consumer() { diff --git a/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/queue/impl/TeSnowFlake.java b/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/queue/impl/TeSnowFlake.java index 6cb9866e8..03ba1f83c 100644 --- a/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/queue/impl/TeSnowFlake.java +++ b/trace-etl/trace-etl-es/src/main/java/org/apache/ozhera/trace/etl/es/queue/impl/TeSnowFlake.java @@ -60,8 +60,8 @@ public void init() { // Get machine number from environment variables. String podName = System.getenv("MONE_CONTAINER_S_POD_NAME"); if (StringUtils.isEmpty(podName)) { - log.error("this pod con't get podName!"); - throw new RuntimeException("this pod con't get podName!"); + log.error("this pod can't get podName!"); + throw new RuntimeException("this pod can't get podName!"); } mId = podName.substring(podName.lastIndexOf("-") + 1); } diff --git a/trace-etl/trace-etl-extensions/trace-etl-doris-extension/src/main/java/org/apache/ozhera/trace/etl/extension/doris/WriteDorisService.java b/trace-etl/trace-etl-extensions/trace-etl-doris-extension/src/main/java/org/apache/ozhera/trace/etl/extension/doris/WriteDorisService.java index 32d954e85..ec38d5e7d 100644 --- a/trace-etl/trace-etl-extensions/trace-etl-doris-extension/src/main/java/org/apache/ozhera/trace/etl/extension/doris/WriteDorisService.java +++ b/trace-etl/trace-etl-extensions/trace-etl-doris-extension/src/main/java/org/apache/ozhera/trace/etl/extension/doris/WriteDorisService.java @@ -167,7 +167,7 @@ public Map buildSpanData(TSpanData tSpanData) { // build logs spanData.put(HeraTraceSpanColumn.logs, GSON.toJson(buildLogs(tSpanData.getEvents()))); // build process - spanData.put(HeraTraceSpanColumn.process, GSON.toJson(buildProcess(tSpanData.getExtra().getServiceName(), tSpanData.getResouce()))); + spanData.put(HeraTraceSpanColumn.process, GSON.toJson(buildProcess(tSpanData.getExtra().getServiceName(), tSpanData.getResource()))); return spanData; } diff --git a/trace-etl/trace-etl-extensions/trace-etl-es-extension/src/main/java/org/apache/ozhera/trace/etl/extension/es/WriteEsService.java b/trace-etl/trace-etl-extensions/trace-etl-es-extension/src/main/java/org/apache/ozhera/trace/etl/extension/es/WriteEsService.java index 5deeaa68b..7e2dc1112 100644 --- a/trace-etl/trace-etl-extensions/trace-etl-es-extension/src/main/java/org/apache/ozhera/trace/etl/extension/es/WriteEsService.java +++ b/trace-etl/trace-etl-extensions/trace-etl-es-extension/src/main/java/org/apache/ozhera/trace/etl/extension/es/WriteEsService.java @@ -127,7 +127,7 @@ public String buildJaegerES(TSpanData tSpanData) { // build logs jaegerESDomain.setLogs(buildLogs(tSpanData.getEvents())); // build process - jaegerESDomain.setProcess(buildProcess(tSpanData.getExtra().getServiceName(), tSpanData.getResouce())); + jaegerESDomain.setProcess(buildProcess(tSpanData.getExtra().getServiceName(), tSpanData.getResource())); return JSONObject.toJSONString(jaegerESDomain, SerializerFeature.WriteMapNullValue); } diff --git a/trace-etl/trace-etl-manager/src/main/java/org/apache/ozhera/trace/etl/manager/config/DataSourceConfig.java b/trace-etl/trace-etl-manager/src/main/java/org/apache/ozhera/trace/etl/manager/config/DataSourceConfig.java index b92ec154e..752e4d774 100644 --- a/trace-etl/trace-etl-manager/src/main/java/org/apache/ozhera/trace/etl/manager/config/DataSourceConfig.java +++ b/trace-etl/trace-etl-manager/src/main/java/org/apache/ozhera/trace/etl/manager/config/DataSourceConfig.java @@ -72,12 +72,12 @@ public DataSource masterDataSource() throws PropertyVetoException, NamingExcepti dataSource.setMaxPoolSize(defaultMaxPoolSize); dataSource.setMinPoolSize(defaultMinPoolSize); - setDatasouce(dataSource); + setDatasource(dataSource); return dataSource; } - private void setDatasouce(ComboPooledDataSource dataSource) { + private void setDatasource(ComboPooledDataSource dataSource) { dataSource.setTestConnectionOnCheckin(true); dataSource.setTestConnectionOnCheckout(false); dataSource.setPreferredTestQuery("select 1"); diff --git a/trace-etl/trace-etl-manager/src/main/java/org/apache/ozhera/trace/etl/manager/filter/RequestHeaderFilter.java b/trace-etl/trace-etl-manager/src/main/java/org/apache/ozhera/trace/etl/manager/filter/RequestHeaderFilter.java index 2e2ae2131..26430487c 100644 --- a/trace-etl/trace-etl-manager/src/main/java/org/apache/ozhera/trace/etl/manager/filter/RequestHeaderFilter.java +++ b/trace-etl/trace-etl-manager/src/main/java/org/apache/ozhera/trace/etl/manager/filter/RequestHeaderFilter.java @@ -58,7 +58,7 @@ private void printHeaders(HttpServletRequest request) { String uri = request.getRequestURI(); Enumeration headerNames = request.getHeaderNames(); if (headerNames == null || !headerNames.hasMoreElements()) { - log.info(uri + " : rquest header is null"); + log.info(uri + " : request header is null"); } else { log.info(uri + " : request header start ==================="); while (headerNames.hasMoreElements()) { diff --git a/trace-etl/trace-etl-metadata/src/main/java/org/apache/ozhera/trace/etl/metadata/config/DataSourceConfig.java b/trace-etl/trace-etl-metadata/src/main/java/org/apache/ozhera/trace/etl/metadata/config/DataSourceConfig.java index 2ce3b6e29..907dba9e8 100644 --- a/trace-etl/trace-etl-metadata/src/main/java/org/apache/ozhera/trace/etl/metadata/config/DataSourceConfig.java +++ b/trace-etl/trace-etl-metadata/src/main/java/org/apache/ozhera/trace/etl/metadata/config/DataSourceConfig.java @@ -74,12 +74,12 @@ public DataSource masterDataSource() throws PropertyVetoException, NamingExcepti dataSource.setMaxPoolSize(defaultMaxPoolSize); dataSource.setMinPoolSize(defaultMinPoolSize); - setDatasouce(dataSource); + setDatasource(dataSource); return dataSource; } - private void setDatasouce(ComboPooledDataSource dataSource) { + private void setDatasource(ComboPooledDataSource dataSource) { dataSource.setTestConnectionOnCheckin(true); dataSource.setTestConnectionOnCheckout(false); dataSource.setPreferredTestQuery("select 1"); diff --git a/trace-etl/trace-etl-nginx/src/main/java/org/apache/ozhera/trace/etl/nginx/parser/NginxLogToTraceBase.java b/trace-etl/trace-etl-nginx/src/main/java/org/apache/ozhera/trace/etl/nginx/parser/NginxLogToTraceBase.java index 654576222..6a2ea578d 100644 --- a/trace-etl/trace-etl-nginx/src/main/java/org/apache/ozhera/trace/etl/nginx/parser/NginxLogToTraceBase.java +++ b/trace-etl/trace-etl-nginx/src/main/java/org/apache/ozhera/trace/etl/nginx/parser/NginxLogToTraceBase.java @@ -101,15 +101,15 @@ public byte[] toTSpanDateBytes(String message) { private List> completeTags(NginxJaegerDomain parse) { List> result = new ArrayList<>(); - result.add(genarateTags("http.remote.address", parse.getRemoteAddr(), JaegerAttrType.STRING)); - result.add(genarateTags("http.request", parse.getRequest(), JaegerAttrType.STRING)); - result.add(genarateTags("http.status_code", parse.getStatus() + "", JaegerAttrType.LONG)); - result.add(genarateTags("error", 400 <= parse.getStatus() && parse.getStatus() < 600 ? "true" : "false", JaegerAttrType.BOOLEAN)); - result.add(genarateTags("http.referer", parse.getRefer(), JaegerAttrType.STRING)); - result.add(genarateTags("http.user_agent", parse.getUa(), JaegerAttrType.STRING)); - result.add(genarateTags("http.x-forwarded-for", parse.getxForwardedFor(), JaegerAttrType.STRING)); - result.add(genarateTags("http.upstream.address", parse.getUpstreamAddr(), JaegerAttrType.STRING)); - result.add(genarateTags("http.upstream.status", parse.getUpstreamStatus(), JaegerAttrType.STRING)); + result.add(generateTags("http.remote.address", parse.getRemoteAddr(), JaegerAttrType.STRING)); + result.add(generateTags("http.request", parse.getRequest(), JaegerAttrType.STRING)); + result.add(generateTags("http.status_code", parse.getStatus() + "", JaegerAttrType.LONG)); + result.add(generateTags("error", 400 <= parse.getStatus() && parse.getStatus() < 600 ? "true" : "false", JaegerAttrType.BOOLEAN)); + result.add(generateTags("http.referer", parse.getRefer(), JaegerAttrType.STRING)); + result.add(generateTags("http.user_agent", parse.getUa(), JaegerAttrType.STRING)); + result.add(generateTags("http.x-forwarded-for", parse.getxForwardedFor(), JaegerAttrType.STRING)); + result.add(generateTags("http.upstream.address", parse.getUpstreamAddr(), JaegerAttrType.STRING)); + result.add(generateTags("http.upstream.status", parse.getUpstreamStatus(), JaegerAttrType.STRING)); return result; } @@ -189,16 +189,16 @@ private Map complateProcess(NginxJaegerDomain parse) { result.put("serviceName", "nginx-" + parse.getHost()); List> processTags = new ArrayList<>(); if(StringUtils.isNotEmpty(parse.getNginxHostName())) { - processTags.add(genarateTags("host", parse.getNginxHostName(), JaegerAttrType.STRING)); + processTags.add(generateTags("host", parse.getNginxHostName(), JaegerAttrType.STRING)); } if(StringUtils.isNotEmpty(parse.getNginxIp())) { - processTags.add(genarateTags("ip", parse.getNginxIp(), JaegerAttrType.STRING)); + processTags.add(generateTags("ip", parse.getNginxIp(), JaegerAttrType.STRING)); } result.put("tags", processTags); return result; } - private Map genarateTags(String key, Object value, String type) { + private Map generateTags(String key, Object value, String type) { if(value != null) { Map remoteAddr = new HashMap<>(); remoteAddr.put("key", key); diff --git a/trace-etl/trace-etl-server/src/main/java/org/apache/ozhera/trace/etl/config/DataSourceConfig.java b/trace-etl/trace-etl-server/src/main/java/org/apache/ozhera/trace/etl/config/DataSourceConfig.java index 1cfb7313a..68322c2e4 100644 --- a/trace-etl/trace-etl-server/src/main/java/org/apache/ozhera/trace/etl/config/DataSourceConfig.java +++ b/trace-etl/trace-etl-server/src/main/java/org/apache/ozhera/trace/etl/config/DataSourceConfig.java @@ -72,12 +72,12 @@ public DataSource masterDataSource() throws PropertyVetoException, NamingExcepti dataSource.setMaxPoolSize(defaultMaxPoolSize); dataSource.setMinPoolSize(defaultMinPoolSize); - setDatasouce(dataSource); + setDatasource(dataSource); return dataSource; } - private void setDatasouce(ComboPooledDataSource dataSource) { + private void setDatasource(ComboPooledDataSource dataSource) { dataSource.setTestConnectionOnCheckin(true); dataSource.setTestConnectionOnCheckout(false); dataSource.setPreferredTestQuery("select 1"); diff --git a/trace-etl/trace-etl-server/src/main/java/org/apache/ozhera/trace/etl/consumer/MetricsParseService.java b/trace-etl/trace-etl-server/src/main/java/org/apache/ozhera/trace/etl/consumer/MetricsParseService.java index c0f01ac7e..5b224f73c 100644 --- a/trace-etl/trace-etl-server/src/main/java/org/apache/ozhera/trace/etl/consumer/MetricsParseService.java +++ b/trace-etl/trace-etl-server/src/main/java/org/apache/ozhera/trace/etl/consumer/MetricsParseService.java @@ -278,7 +278,7 @@ public MetricsParseResult metricsParse(TSpanData tSpanData) { } } // Gets the properties in process - TResource resource = tSpanData.getResouce(); + TResource resource = tSpanData.getResource(); if (resource != null) { TAttributes resourceAttributes = resource.getAttributes(); List resourceKeys = resourceAttributes.getKeys(); diff --git a/trace-etl/trace-etl-service/src/main/java/org/apache/ozhera/trace/etl/util/ExecutorUtil.java b/trace-etl/trace-etl-service/src/main/java/org/apache/ozhera/trace/etl/util/ExecutorUtil.java index 84ac309a1..67c0d4bea 100644 --- a/trace-etl/trace-etl-service/src/main/java/org/apache/ozhera/trace/etl/util/ExecutorUtil.java +++ b/trace-etl/trace-etl-service/src/main/java/org/apache/ozhera/trace/etl/util/ExecutorUtil.java @@ -34,7 +34,7 @@ public class ExecutorUtil { public static final int ROCKSDB_DEAL_MESSAGE_CORE = 20; private final static ThreadPoolExecutor errorESthreadPoolExecutor; private final static ThreadPoolExecutor consumerDelayMsgthreadPoolExecutor; - private final static ThreadPoolExecutor rocksDBThreaPool; + private final static ThreadPoolExecutor rocksDBThreadPool; static{ @@ -44,7 +44,7 @@ public class ExecutorUtil { consumerDelayMsgthreadPoolExecutor = new ThreadPoolExecutor(ROCKSDB_DEAL_MESSAGE_CORE, ROCKSDB_DEAL_MESSAGE_CORE, 0L, TimeUnit.MILLISECONDS, consumerDelayMsgQueue); - rocksDBThreaPool = new ThreadPoolExecutor(2, 2, + rocksDBThreadPool = new ThreadPoolExecutor(2, 2, 0L, TimeUnit.MILLISECONDS, rocksThreadQueue); } @@ -67,7 +67,7 @@ public static void submitDelayMessage(Runnable runnable){ public static void submitRocksDBRead(Runnable runnable){ try { - rocksDBThreaPool.submit(runnable); + rocksDBThreadPool.submit(runnable); }catch(Exception e){ log.error("提交rocksdb读取任务失败:",e); } diff --git a/trace-etl/trace-etl-service/src/main/java/org/apache/ozhera/trace/etl/util/TraceUtil.java b/trace-etl/trace-etl-service/src/main/java/org/apache/ozhera/trace/etl/util/TraceUtil.java index 2f9415452..fd752d63c 100644 --- a/trace-etl/trace-etl-service/src/main/java/org/apache/ozhera/trace/etl/util/TraceUtil.java +++ b/trace-etl/trace-etl-service/src/main/java/org/apache/ozhera/trace/etl/util/TraceUtil.java @@ -106,7 +106,7 @@ private static TSpanData toTSpanData(String[] array) { span.setKind(toTKind(spanKind)); span.setEvents(toTEventList(JSONArray.parseArray(decodeLineBreak(array[MessageUtil.EVENTS])))); span.setTotalRecordedEvents(span.getEventsSize()); - span.setResouce( + span.setResource( toTResource(JSONObject.parseObject(array[MessageUtil.REOUSCES]), specialAttrMap)); span.setExtra(toTExtra(specialAttrMap)); // using links["ref_type=CHILD_OF"] as parent span context and using left as links