A method for interoperating accounts between a self-developed system and Grafana

By deploying Prometheus and building OAuth2.0 in Grafana and self-developed systems, single sign-on is realized, which solves the problems of poor user experience, security risks and complex management caused by multi-point sign-in, improves user experience and system security, and simplifies Identity management and auditing capabilities.

CN117692164BActive Publication Date: 2024-10-22广西壮族自治区信息中心
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311437300.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2024-10-22
Estimated Expiration
2043-10-31

AI Technical Summary

Technical Problem

In the monitoring solution that integrates Grafana and self-developed systems, multiple logins lead to poor user experience, increased security risks, complex identity management, and lack of centralized control and auditing, affecting user experience and system security.

Method used

By deploying Prometheus, configuring Grafana data sources, building OAuth2.0 and implementing single sign-on, using tokens to synchronize user identities, simplify the login process and uniformly manage user permissions.

Benefits of technology

It enables users to access two systems with one identity verification, improves user experience and security, simplifies identity management and audit functions, and reduces administrator workload and security risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117692164B_ABST
    Figure CN117692164B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and in particular to a method for intercommunication of accounts based on a self-developed system and Grafana, comprising the following steps: configuring the server of the Prometheus and configuring the probe Exporter of the Prometheus, and adding the job configuration of the probe Exporter in the configuration file of the Prometheus; adding the data source of the Prometheus to the server of the Grafana to obtain the indicator data of the Prometheus; creating a dashboard in the Grafana; building OAuth2.0 in the self-developed system; querying the monitoring status of the Prometheus of the target machine to verify whether the Prometheus is collecting data normally; the background of the self-developed system uses token as an information medium, and logs in synchronously through the OAuth2.0 method, and cancels the account on the Grafana platform. The present invention can realize single sign-on of the account of the self-developed system and Grafana, and effectively solves the drawbacks of user experience, security, management efficiency and auditing existing in multi-point login.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an account intercommunication method based on a self-developed system and Grafana. Background Art

[0002] In order to enable users of self-developed systems to easily collect and store key performance indicators and system data, real-time data on system performance and health status is provided to provide a basis for subsequent monitoring and analysis. Dashboards, charts, and reports can be created to intuitively display the changing trends of system performance and key indicators. This helps developers, operation and maintenance teams, and business decision makers to better understand the operation and effects of the system, and perform data analysis and troubleshooting through a graphical interface. Therefore, many Internet companies and traditional IT industries choose to integrate monitoring solutions into their self-developed systems, which are also deployed on a large scale in production environments and adopted by more and more companies.

[0003] When integrating the monitoring solution built with Grafana and Prometheus into the self-developed system, because Grafana has its own user system independent of the self-developed system, it is necessary to log in to Grafana while logging in to the self-developed system, that is, multi-point login, to synchronize the user data of both parties. However, multi-point login has defects and shortcomings, including:

[0004] Multiple logins: If there are multiple applications or services in the system, users need to log in and authenticate for each application separately. This is cumbersome for users, who need to remember and manage multiple different usernames and passwords.

[0005] Poor user experience: Repeated login processes affect the user experience, especially when users need to frequently switch and access different applications. Users need to enter their credentials repeatedly, wasting time and energy.

[0006] Increased security risks: When users need to use different usernames and passwords for each application, they may tend to choose simple passwords, reuse passwords, or easily reveal passwords to others, thereby increasing the security risk of the system. In addition, password management in multiple systems can also pose challenges.

[0007] Complex identity management: Without single sign-on technology, the system needs to manage user accounts, roles, and permissions for each application separately. This may make identity management complicated and increase the workload of administrators and developers.

[0008] Lack of centralized control and auditing: The lack of a single sign-on mechanism means that each application has independent login authentication and permission control, which may make it difficult to implement unified access control and auditing functions across the entire system. When a security breach occurs or an incident needs to be investigated, it will become more difficult to track user activities and maintain audit logs. Summary of the invention

[0009] In order to solve the above problems, the present invention provides an account intercommunication method based on a self-developed system and Grafana, which can realize single sign-on of the self-developed system and Grafana accounts, and effectively solve the drawbacks of user experience, security, management efficiency and auditing existing in multi-point login.

[0010] In order to achieve the above object, the technical solution adopted by the present invention is:

[0011] A method for intercommunication between accounts based on a self-developed system and Grafana includes the following steps:

[0012] S1. Deployment of Prometheus: configure the Prometheus server and configure the Prometheus probe Exporter, and add the job configuration of the probe Exporter in the configuration file of the Prometheus so that the job configuration points to the address and port of the target machine where the Exporter is located;

[0013] S2. Grafana configuration: add the Prometheus data source to the Grafana server to obtain the Prometheus indicator data; create a dashboard in the Grafana to display the indicator data;

[0014] S3. Construction of OAuth2.0: Build OAuth2.0 in the self-developed system, and modify the security module of Grafana, so that the required fields of the database of the self-developed system correspond to the classes of the self-developed system through the redirection of the security module;

[0015] S4. Prometheus verification: Initiate a verification request to the backend of the self-developed system to query the monitoring status of the Prometheus of the target machine to verify whether the Prometheus is running normally to collect data;

[0016] S5. Account synchronization: After the Prometheus verification is successful, a synchronization request between the Grafana account and the self-developed system account is initiated to the backend of the self-developed system. The backend of the self-developed system uses token as the information medium and logs in synchronously through the OAuth2.0 method, and logs out of the account on the Grafana platform, and performs single sign-on with the self-developed system and Grafana.

[0017] Furthermore, in step S1, the configuration file of the Prometheus is modified through Github to configure the monitoring items of the Prometheus server, and the monitoring items include the node of the target machine, the service of the target machine, the address of the self-developed system and the pulling time interval of the self-developed system.

[0018] Furthermore, in step S1, after downloading and installing the probe Exporter, the address and node of each probe Exporter are configured through Prometheus, so that the probe Exporter is connected to the Prometheus and exposes the indicator data of the Prometheus.

[0019] Furthermore, in step S1, after the Prometheus server and the Prometheus probe Exporter are configured, the probe Exporter is started to collect indicator data of the Prometheus service, and the probe Exporter is added to the Prometheus configuration file so that the job configuration points to the address and port of the target machine where the Exporter is located.

[0020] Further, in step S2, after installing and starting the Grafana in the self-developed system, the Prometheus data source is added to the Grafana server, and the Prometheus data source connection information is configured to obtain the Prometheus indicator data.

[0021] Furthermore, in step S4, a verification request is initiated to the background of the self-developed system, and the operation data of the Prometheus is collected through the probe Exporter. When the interface of the probe Exporter returns the status of the Prometheus as true, the verification is successful; when the interface of the probe Exporter returns the status of the Prometheus as false, the verification fails.

[0022] Furthermore, the token generation method of step S5 is: after the Prometheus verification is successful, the self-developed system obtains the configuration information of the Grafana to access OAuth2.0, and the Grafana determines whether the user exists based on the user information. When the user exists, the Grafana generates a token by automatically redirecting the request; when the user does not exist, a new user is created to the user pool of the Grafana, and the Grafana's own token is generated.

[0023] Furthermore, in step S5, the Grafana requests an authorization code based on the token. When the authorization code is obtained, the Grafana is in an authorized login state. When the authorization code is not obtained, the Grafana is in a logged out state, and the OAuth2.0 accesses the validity of the token to destroy the Grafana session when the token is invalid.

[0024] The beneficial effects of the present invention are:

[0025] By deploying the Prometheus server, configuring the Grafana server, and building OAuth2.0 in the self-developed system to achieve single sign-on, users only need to authenticate once to access Grafana and the self-developed system, without having to log in to each system separately and remember multiple usernames and passwords, which improves user convenience and experience; user authentication is uniformly authenticated by the self-developed system, with stricter security measures and verification mechanisms, reducing the chance of users repeatedly entering passwords in the two systems, effectively reducing the risk of password leakage and other security risks; single sign-on simplifies the management of identity authentication and access control. Administrators only need to manage user credentials and permissions in the self-developed system, without having to manage users in each system separately, saving administrators' time and energy, and reducing management errors and maintenance costs; through single sign-on, the self-developed system can track and record user login activities, provide better audit functions and traceability, and make it easier for administrators to view and monitor user access and behavior in the self-developed and integrated systems; single sign-on provides seamless integration capabilities with different systems and applications, and integrates with various platforms and applications through standard authentication protocols and authentication technology OAuth2.0. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flowchart of a method for intercommunication between accounts based on a self-developed system and Grafana according to a preferred embodiment of the present invention.

[0027] Figure 2It is an architecture diagram of an account intercommunication method based on a self-developed system and Grafana according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0030] Please also see Figure 1 and Figure 2 A preferred embodiment of the present invention provides an account intercommunication method based on a self-developed system and Grafana, comprising the following steps:

[0031] S1. Deployment of Prometheus: Configure the Prometheus server and the Prometheus probe Exporter, and add the job configuration of the probe Exporter in the Prometheus configuration file so that the job configuration points to the address and port of the target machine where the Exporter is located.

[0032] In step S1, the Prometheus configuration file is modified through Github to configure the monitoring items of the Prometheus server, and the monitoring items include the nodes of the target machine, the services of the target machine, the address of the self-developed system, and the pull time interval of the self-developed system. In this embodiment, the downloaded installation package Github is decompressed and deployed to the / usr / local / directory, the prometheus.yml configuration file vi prometheus.yml is modified, and the relevant monitoring items are configured.

[0033] In step S1, after downloading and installing the probe Exporter through the official website, the address and node of each probe Exporter are configured through Prometheus, so that the probe Exporter is connected to Prometheus and the indicator data of Prometheus is exposed.

[0034] In step S1, after the Prometheus server and the Prometheus probe Exporter are configured, the probe Exporter is started to collect the indicator data of the Prometheus service, and the probe Exporter is added to the Prometheus configuration file so that the job configuration points to the address and port of the target machine where the Exporter is located. After modifying the Prometheus configuration file, reload the Prometheus configuration.

[0035] S2. Grafana configuration: Add the Prometheus data source to the Grafana server to obtain Prometheus indicator data; create a dashboard in Grafana to display the indicator data.

[0036] In this embodiment, Grafana is installed first. Different methods are used to install Grafana in different self-developed systems. In Ubuntu, you can use the apt package manager to install it. In CentOS, you can use the yum package manager to install it. Using Docker, you can run the command docker run-dp 3000:3000--name=grafanagrafana / grafana installation. When using apt or yum to install, Grafana usually starts automatically. To verify whether the installation and startup are successful, you can open http: / / localhost:3000 in a web browser to see the Grafana login page.

[0037] In step S2, after installing and starting Grafana in the self-developed system, add the Prometheus data source to the Grafana server and configure the Prometheus data source connection information to obtain Prometheus indicator data.

[0038] In Grafana, data sources are used to connect to different indicator data stores. You can add various data sources, such as Prometheus, InfluxDB, Elasticsearch, etc. In the Grafana interface, navigate to "Configuration"->"Data Sources", then click "Add Data Source", in the data source type list, select "Prometheus" as the data source type, and on the "HTTP" tab, configure the connection information for the Prometheus data source.

[0039] In Create Dashboard. In Grafana, dashboards are used to visualize and display metric data. You can create a new dashboard and add elements such as charts and panels. Navigate to "Create"->"Dashboard" and select Add Chart and Panel to configure.

[0040] S3. Construction of OAuth2.0: Build OAuth2.0 in the self-developed system and modify the security module of Grafana. Through the redirection of the security module, the required fields of the database of the self-developed system correspond to the classes of the self-developed system.

[0041] S4.Prometheus verification: Initiate a verification request to the backend of the self-developed system to query the monitoring status of Prometheus on the target machine to verify whether Prometheus is running normally to collect data.

[0042] In step S4, a verification request is initiated to the backend of the self-developed system, and the running data of Prometheus is collected through the probe Exporter. When the interface of the probe Exporter returns the status of Prometheus as true, the verification is successful; when the interface of the probe Exporter returns the status of Prometheus as false, the verification fails.

[0043] S5. Account synchronization: After Prometheus verification is successful, a synchronization request between the Grafana account and the self-developed system account is initiated to the backend of the self-developed system. The backend of the self-developed system uses token as the information medium and logs in synchronously through OAuth2.0, and logs out of the account on the Grafana platform, using the self-developed system and Grafana for single sign-on.

[0044] The token generation method of step S5 is as follows: after the Prometheus verification is successful, the self-developed system obtains the configuration information of Grafana to access OAuth2.0. Grafana determines whether the user exists based on the user information. When the user exists, Grafana generates a token by automatically redirecting the request; when the user does not exist, a new user is created to the Grafana user pool, and Grafana's own token is generated.

[0045] In step S5, Grafana obtains an authorization code based on the token request. When the authorization code is obtained, Grafana is in an authorized login state; when the authorization code is not obtained, Grafana is in a logged out state, and the validity of the OAuth2.0 access token is checked to destroy the Grafana session when the token is invalid.

[0046] In this embodiment, single sign-on is implemented by deploying the Prometheus server, configuring the Grafana server, and building OAuth2.0 in the self-developed system. Users only need to authenticate once to access Grafana and the self-developed system, without having to log in to each system separately and remember multiple user names and passwords, thereby improving user convenience and experience; user authentication is uniformly authenticated by the self-developed system, with stricter security measures and verification mechanisms, reducing the chance of users repeatedly entering passwords in the two systems, and effectively reducing the risk of password leakage and other security risks; single sign-on simplifies the management of identity authentication and access control, and administrators only need to manage user credentials and permissions in the self-developed system, without having to manage users in each system separately, saving administrators' time and energy, and reducing management errors and maintenance costs; through single sign-on, the self-developed system can track and record user login activities, provide better audit functions and traceability, and make it easier for administrators to view and monitor user access and behavior in the self-developed and integrated systems; single sign-on provides seamless integration capabilities with different systems and applications, and integrates with various platforms and applications through standard authentication protocols and authentication technology OAuth2.0.

[0047] In this embodiment, Prometheus is an open source monitoring and alerting system. Prometheus specifies the targets to be monitored by configuration. These targets can be various applications, services, or system components. Each target usually exposes an HTTP or HTTPS endpoint, and Prometheus monitors the target by obtaining indicator data from these endpoints.

[0048] Grafana is a data visualization monitoring platform. It provides a powerful data visualization and monitoring platform through functions such as configuring data sources, defining query statements, data processing and display, interactive operations, and alarm settings. It can display monitoring data from different data sources in a unified interface, and enable users to understand and analyze data more intuitively through charts and dashboards, thereby supporting users to make faster and more accurate decisions.

[0049] The OAuth 2.0 login protocol provides a more secure, controllable, and scalable login and authorization mechanism by reducing third-party applications' reliance on user credentials and allowing users to grant limited permissions and access to resources.

[0050] like Figure 2 As mentioned above, Prometheus Server is the core part of the Prometheus component, responsible for acquiring, storing and querying monitoring data.

[0051] Exporter: Exporter exposes the endpoint for monitoring data collection to Prometheus Server through HTTP service. Prometheus Server can obtain the data to be collected by accessing the endpoint provided by it.

[0052] Pushgateway: A plug-in for passively pulling data.

[0053] Altermanager: Alarm sending module.

[0054] Prometheus web UI: interface, also includes combining with Grafana for data display or alarm sending.

Claims

1. A method for intercommunication between accounts based on a self-developed system and Grafana, characterized in that: The steps include: S1. Deployment of Prometheus: configure the Prometheus server and configure the Prometheus probe Exporter, and add the job configuration of the probe Exporter in the Prometheus configuration file so that the job configuration points to the address and port of the target machine where the Exporter is located; S2. Grafana configuration: add the Prometheus data source to the Grafana server to obtain the Prometheus indicator data; create a dashboard in the Grafana to display the indicator data; S3. Building OAuth2.0: Building OAuth2.0 in the self-developed system, and modifying the security module of Grafana, so that the required fields of the database of the self-developed system correspond to the classes of the self-developed system through the redirection of the security module; S4. Prometheus verification: Initiate a verification request to the backend of the self-developed system to query the monitoring status of the Prometheus of the target machine to verify whether the Prometheus is operating normally to collect data; S5. Account synchronization: After the Prometheus verification is successful, a synchronization request is initiated to the backend of the self-developed system to synchronize the Grafana account with the account of the self-developed system. The backend of the self-developed system uses the token as the information medium and logs in synchronously through the OAuth2.0 method, and logs out of the account on the Grafana platform, and performs single sign-on with the self-developed system and Grafana; The token generation method of step S5 is as follows: after the Prometheus verification is successful, the self-developed system obtains the configuration information of the Grafana to access OAuth2.0, and the Grafana determines whether the user exists according to the user information. When the user exists, the Grafana generates a token by automatically redirecting the request; when the user does not exist, a new user is created to the user pool of the Grafana, and the Grafana's own token is generated; In step S5, the Grafana requests an authorization code according to the token. After the authorization code is obtained, the Grafana is in an authorized login state; When the authorization code is not obtained, the Grafana is in a logged out state, and the OAuth2.0 accesses the validity of the token to destroy the Grafana session when the token is invalid.

2. According to claim 1, a method for intercommunication between accounts based on a self-developed system and Grafana, characterized in that: In step S1, the configuration file of the Prometheus is modified through Github to configure the monitoring items of the Prometheus server, and the monitoring items include the node of the target machine, the service of the target machine, the address of the self-developed system and the pulling time interval of the self-developed system.

3. According to claim 2, a method for intercommunication between accounts based on a self-developed system and Grafana is characterized in that: In step S1, after downloading and installing the probe Exporter, the address and node of each probe Exporter are configured through Prometheus, so that the probe Exporter is connected to the Prometheus and exposes the indicator data of the Prometheus.

4. According to claim 3, the account intercommunication method based on the self-developed system and Grafana is characterized in that: In step S1, after the Prometheus server and the Prometheus probe Exporter are configured, the probe Exporter is started to collect the indicator data of the Prometheus service, and the probe Exporter is added to the Prometheus configuration file so that the job configuration points to the address and port of the target machine where the Exporter is located.

5. According to claim 1, the account intercommunication method based on the self-developed system and Grafana is characterized in that: In step S2, after installing and starting the Grafana in the self-developed system, the Prometheus data source is added to the Grafana server, and the Prometheus data source connection information is configured to obtain the Prometheus indicator data.

6. According to claim 1, a method for intercommunication between accounts based on a self-developed system and Grafana, characterized in that: In step S4, a verification request is initiated to the background of the self-developed system, and the running data of the Prometheus is collected through the probe Exporter. When the interface of the probe Exporter returns the status of the Prometheus as true, the verification is successful; when the interface of the probe Exporter returns the status of the Prometheus as false, the verification fails.