Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cloud_Computing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Tim Hobelsberger
Cloud_Computing
Commits
6ec4ab6c
Commit
6ec4ab6c
authored
2 years ago
by
Markus Klose
Browse files
Options
Downloads
Plain Diff
Merge branch 'mongo-exporter' into 'main'
Comments See merge request
!7
parents
3d0c9c6a
30c9b564
No related branches found
No related tags found
1 merge request
!7
Comments
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
index.js
+5
-1
5 additions, 1 deletion
index.js
with
5 additions
and
1 deletion
index.js
+
5
−
1
View file @
6ec4ab6c
...
@@ -53,6 +53,10 @@ client.collectDefaultMetrics({register});
...
@@ -53,6 +53,10 @@ client.collectDefaultMetrics({register});
help: 'The total number of client connections'
help: 'The total number of client connections'
}); */
}); */
// Declaring custom metrics to monitor the chatserver
// These metrics will monitor the system during runtime
// Prometheus will scrape these metrics and provide them to Gafana
const
messageCounterIn
=
new
client
.
Counter
({
const
messageCounterIn
=
new
client
.
Counter
({
name
:
'
node_message_counter_in
'
,
name
:
'
node_message_counter_in
'
,
help
:
'
Counts the amount of incoming messages from clients to server
'
help
:
'
Counts the amount of incoming messages from clients to server
'
...
@@ -116,7 +120,7 @@ const totalClientsInDB = new client.Gauge({
...
@@ -116,7 +120,7 @@ const totalClientsInDB = new client.Gauge({
});
});
global
.
TOTALCLIENTSINDB
=
totalClientsInDB
;
global
.
TOTALCLIENTSINDB
=
totalClientsInDB
;
// Register the metrics, to be collected in Prometheus database
register
.
registerMetric
(
messageCounterIn
);
register
.
registerMetric
(
messageCounterIn
);
register
.
registerMetric
(
messageCounterOut
);
register
.
registerMetric
(
messageCounterOut
);
register
.
registerMetric
(
messageAll
);
register
.
registerMetric
(
messageAll
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment