Skip to content

Commit

Permalink
add application name for serive monitor list
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjoey committed Mar 13, 2024
1 parent 5a96b55 commit 106384e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/proto/msp/apm/service/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ message Service {
erda.common.Language language = 3;
string lastHeartbeat = 4;
AggregateMetric aggregateMetric = 5;
string appName = 6;
}

message AggregateMetric {
Expand Down
3 changes: 2 additions & 1 deletion internal/apps/msp/apm/service/apm.service.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (s *apmServiceService) GetServices(ctx context.Context, req *pb.GetServices
start, end := TimeRange("-24h")

// get services list
statement := fmt.Sprintf("SELECT service_id::tag,service_name::tag,service_agent_platform::tag,max(timestamp) FROM application_service_node "+
statement := fmt.Sprintf("SELECT service_id::tag,service_name::tag,service_agent_platform::tag,max(timestamp),application_name::tag FROM application_service_node "+
"WHERE $condition GROUP BY service_id::tag ORDER BY max(timestamp) DESC LIMIT %v OFFSET %v", req.PageSize, (req.PageNo-1)*req.PageSize)
condition := " terminus_key::tag=$terminus_key "
queryParams := map[string]*structpb.Value{
Expand Down Expand Up @@ -143,6 +143,7 @@ func (s *apmServiceService) GetServices(ctx context.Context, req *pb.GetServices
service.Name = row.Values[1].GetStringValue()
service.Language = parseLanguage(row.Values[2].GetStringValue())
service.LastHeartbeat = time.Unix(0, int64(row.Values[3].GetNumberValue())).Format("2006-01-02 15:04:05")
service.AppName = row.Values[4].GetStringValue()
service.AggregateMetric = &pb.AggregateMetric{}
services = append(services, service)
}
Expand Down

0 comments on commit 106384e

Please sign in to comment.