Skip to content

Commit

Permalink
[#8004] Returns whether the system metric menu is exposed.
Browse files Browse the repository at this point in the history
  • Loading branch information
minwoo-jung committed Jun 21, 2022
1 parent eed37e9 commit 7d08d69
Show file tree
Hide file tree
Showing 26 changed files with 259 additions and 118 deletions.
4 changes: 1 addition & 3 deletions metric-module/collector-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-metric-module</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -17,8 +17,6 @@
<jdk.version>11</jdk.version>
<jdk.home>${env.JAVA_11_HOME}</jdk.home>
<plugin.animal-sniffer.skip>true</plugin.animal-sniffer.skip>

<guava.version>${guava-jdk8.version}</guava.version>
<javax.servlet.version>${javax.servlet4.version}</javax.servlet.version>
<spring.version>${spring5.version}</spring.version>
<spring.security.version>${spring.security5.version}</spring.security.version>
Expand Down
3 changes: 1 addition & 2 deletions metric-module/metric/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-metric-module</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>

<artifactId>pinpoint-metric</artifactId>
Expand Down Expand Up @@ -132,7 +132,6 @@
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>4.0.3</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.navercorp.pinpoint.metric.web;

import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Profile;
import org.springframework.context.annotation.PropertySource;

@ImportResource({"classpath:/pinot-web/applicationContext-web-pinot.xml"})
@PropertySource({"classpath:pinot-web/jdbc-pinot.properties"})
@ImportResource({"classpath:pinot-web/applicationContext-web-pinot.xml"})
@Import(WebMetricPropertySources.class)
@Profile("metric")
public class MetricWebApp {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright 2022 NAVER Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.navercorp.pinpoint.metric.web;

/**
* @author minwoo.jung
*/

import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;

@PropertySources({
@PropertySource(name = "WebMetricPropertySources", value = {WebMetricPropertySources.METRIC}),
@PropertySource(name = "WebMetricPropertySources-pinot", value = {WebMetricPropertySources.PINOT_JDBC})
})
public class WebMetricPropertySources {
public static final String METRIC= "classpath:pinot-web/profiles/${pinpoint.profiles.active:release}/pinpoint-web-metric.properties";

public static final String PINOT_JDBC= "classpath:pinot-web/profiles/${pinpoint.profiles.active:release}/jdbc-pinot.properties";
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<bean id="pinotDataSource"
class="com.navercorp.pinpoint.metric.web.mybatis.DataSourceDelegator">
<constructor-arg index="0" ref="originalDataSource"/>
<constructor-arg index="0" ref="originalPinotDataSource"/>
</bean>

<bean id="originalDataSource"
<bean id="originalPinotDataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${pinpoint.pinot.jdbc.driverClassName}" />
<property name="url" value="${pinpoint.pinot.jdbc.url}" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pinpoint.pinot.jdbc.driverClassName=org.apache.pinot.client.PinotDriver
pinpoint.pinot.jdbc.url=jdbc:pinot://localhost:9000
pinpoint.pinot.jdbc.username=admin
pinpoint.pinot.jdbc.password=admin
pinpoint.pinot.jdbc.username=userId
pinpoint.pinot.jdbc.password=password
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.show.systemMetric=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pinpoint.pinot.jdbc.driverClassName=org.apache.pinot.client.PinotDriver
pinpoint.pinot.jdbc.url=jdbc:pinot://localhost:9000
pinpoint.pinot.jdbc.username=userId
pinpoint.pinot.jdbc.password=password
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
config.show.systemMetric=true
2 changes: 1 addition & 1 deletion metric-module/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>

<artifactId>pinpoint-metric-module</artifactId>
Expand Down
7 changes: 3 additions & 4 deletions metric-module/web-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.navercorp.pinpoint</groupId>
<artifactId>pinpoint-metric-module</artifactId>
<version>2.4.0-SNAPSHOT</version>
<version>2.5.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -17,13 +17,12 @@
<jdk.home>${env.JAVA_11_HOME}</jdk.home>
<sniffer.artifactid>java18</sniffer.artifactid>

<guava.version>${guava-jdk8.version}</guava.version>
<javax.servlet.version>${javax.servlet4.version}</javax.servlet.version>
<spring.version>${spring5.version}</spring.version>
<spring.security.version>${spring.security5.version}</spring.security.version>
<log4j2.version>${log4j2-jdk8.version}</log4j2.version>

<pinpoint.collector.executable.name>${project.artifactId}-boot-${project.version}</pinpoint.collector.executable.name>
<pinpoint.web.executable.name>${project.artifactId}-boot-${project.version}</pinpoint.web.executable.name>
</properties>

<dependencies>
Expand All @@ -47,7 +46,7 @@
<outputDirectory>target/deploy</outputDirectory>
<executable>true</executable>
<attach>false</attach>
<finalName>${pinpoint.collector.executable.name}</finalName>
<finalName>${pinpoint.web.executable.name}</finalName>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
display: block;
width: 100%;
height: 100%;
padding: 15px;
}

.l-main-contents {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export class MetricContentsContainerComponent implements OnInit, OnDestroy {

ngOnInit() {
this.guideMessage$ = this.translateService.get('COMMON.CHART_INTERACTION_GUIDE_MESSAGE');

// merge(
// of(this.webAppSettingDataService.getChartLayoutOption()),
// this.messageQueueService.receiveMessage(this.unsubscribe, MESSAGE_TO.SET_CHART_LAYOUT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface ISNBItem {
disable?: () => boolean;
onClick?: (item: ISNBItem) => void;
childItems?: ISNBItem[];
showItem?: boolean;
}

interface ISNBMeta {
Expand All @@ -31,14 +32,16 @@ interface ISNBMeta {
})
export class SideNavigationBarContainerComponent implements OnInit, OnDestroy {
private unsubscribe = new Subject<void>();

enableRealTime: boolean;
logoPath: string;
minimize = false;
currentItemId: string;
userId = '';
meta: ISNBMeta;

showMetric: boolean;

constructor(
private cd: ChangeDetectorRef,
private windowRefService: WindowRefService,
Expand All @@ -51,7 +54,10 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy {

ngOnInit() {
this.minimize = this.webAppSettingDataService.getSideNavBarScale();

this.webAppSettingDataService.showMetric().subscribe((showMetric: boolean) => {
this.showMetric = showMetric;
});

this.webAppSettingDataService.getUserId().subscribe(userId => {
this.userId = userId || 'dev';
this.meta = this.generatNavItemMeta();
Expand Down Expand Up @@ -83,11 +89,15 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy {
onClickInspector(): void {
this.urlRouteManagerService.moveByApplicationCondition(UrlPath.INSPECTOR);
}
onClickServermap() {

onClickServermap(): void {
this.urlRouteManagerService.moveByApplicationCondition(UrlPath.MAIN);
}

onClickMetric(): void {
this.urlRouteManagerService.moveToMetricPage();
}

onClickGithubLink() {
this.windowRefService.nativeWindow.open('http://github.com/naver/pinpoint');
}
Expand All @@ -100,30 +110,37 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy {
return this.userId;
}


generatNavItemMeta() {
generatNavItemMeta(): ISNBMeta {
return {
topItems: [
{
title: 'Servermap',
id: 'servermap',
path: '/main',
iconClass: 'fa fa-network-wired',
{
id: 'servermap',
title: 'Servermap',
path: '/main',
iconClass: 'fa fa-network-wired',
onClick: () => this.onClickServermap(),
},
{
id: 'inspector',
title: 'Inspector',
path: '/inspector',
iconClass: 'fas fa-chart-line',
{
id: 'inspector',
title: 'Inspector',
path: '/inspector',
iconClass: 'fas fa-chart-line',
onClick: () => this.onClickInspector(),
},
{
id: 'infrastructure',
title: 'Infrastructure',
path: '/metric',
iconClass: 'fas fa-server',
showItem: this.showMetric,
onClick: () => this.onClickMetric(),
}
],
bottomItems: [
{
{
id: 'configuration',
title: 'Configuration',
iconClass: 'fas fa-cog',
title: 'Configuration',
iconClass: 'fas fa-cog',
childItems: [
{ title: 'User Group', id: 'userGroup', path: '/config/userGroup', },
{ title: 'Alarm', id: 'alarm', path: '/config/alarm', },
Expand All @@ -138,19 +155,19 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy {
{ title: 'Experimental', id: 'experimental', path: '/config/experimental', },
],
},
{
{
id: 'administration',
title: 'Administration',
iconClass: 'fas fa-user-cog',
title: 'Administration',
iconClass: 'fas fa-user-cog',
childItems: [
{ title: 'Agent Statistic', id: 'agentStatistic', path: '/config/agentStatistic', onClick: () => ''},
{ title: 'Agent management', id: 'agentmanagement', path: '/config/agentManagement', },
]
},
{
{
id: 'user',
title: this.userId,
iconClass: 'fas fa-user-circle',
title: this.userId,
iconClass: 'fas fa-user-circle',
childItems: [
{ title: 'General', id: 'general', path: '/config/general', },
{ title: 'Favorite List', id: 'favoriteList', path: '/config/favorite', },
Expand All @@ -160,6 +177,6 @@ export class SideNavigationBarContainerComponent implements OnInit, OnDestroy {
]
},
]
}
};
}
}
Loading

0 comments on commit 7d08d69

Please sign in to comment.