Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft: Prometheus updates #217

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
005f2c6
save
Sep 9, 2024
653df19
intro to prometheus done
Sep 9, 2024
c503db0
got prom to connect to fa but can't see data yet
Sep 10, 2024
b1e7448
got prometheus chart to work
Sep 10, 2024
82f06c5
use prometheus with curl
Sep 10, 2024
2593503
explain notify
Sep 10, 2024
897a82e
include webhook sites in monitor article
Sep 11, 2024
284dc0a
got alertmanager to work
Sep 12, 2024
636c556
documented prometheus and alertmanager and nfty. now for loki and gra…
Sep 12, 2024
f9485d6
grafana done
Sep 16, 2024
e5bc680
save loki
Sep 16, 2024
5029522
edit
Sep 17, 2024
a6661b7
ai proofread
Sep 17, 2024
bd10e32
image updates
rideam Sep 18, 2024
863be23
text updates
rideam Sep 18, 2024
9eb4bd5
loki intro
Sep 24, 2024
54a668a
architecture
Sep 24, 2024
81f46e8
running loki container
Sep 24, 2024
a7f6cb3
save
Sep 25, 2024
05127b4
save
Sep 26, 2024
b18908f
Prometheus language edit
worktheclock Sep 26, 2024
2214905
Merge pull request #216 from ritza-co/prometheus-language-edit
sixhobbits Sep 26, 2024
7b42510
Merge pull request #213 from ritza-co/update-prometheus-qa
sixhobbits Sep 26, 2024
52d5230
logs import but getting error in terminal
Sep 26, 2024
4454eac
Merge branch 'main' into prometheusConflict
Sep 26, 2024
c8c8362
Merge pull request #218 from ritza-co/prometheusConflict
sixhobbits Sep 26, 2024
8b611a6
document loki
Sep 27, 2024
50e626c
edit
Sep 27, 2024
a32751e
done with loki
Sep 27, 2024
11a5816
Edit diagram
Sep 27, 2024
08a3f0a
text updates
rideam Oct 3, 2024
a5aed80
text updates
rideam Oct 3, 2024
2f6b5f0
Merge pull request #221 from ritza-co/update-loki
sixhobbits Oct 4, 2024
e467af6
Merge branch 'update-prometheus' into loki
worktheclock Oct 4, 2024
67fcabb
Prometheus after Loki addition language edit
worktheclock Oct 4, 2024
d07b79b
fix vale
sixhobbits Oct 16, 2024
56a8b86
Merge pull request #223 from ritza-co/prometheus-loki-language-edit
sixhobbits Oct 31, 2024
075aacd
Merge pull request #222 from ritza-co/loki
sixhobbits Oct 31, 2024
6499c3e
Merge branch 'main' into update-prometheus
rideam Nov 1, 2024
d1cce75
update accept file
rideam Nov 1, 2024
c41de49
fix ntfy
rideam Nov 1, 2024
183ffc0
Update astro/src/content/docs/operate/secure-and-monitor/prometheus.mdx
sixhobbits Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
import Diagram from 'src/components/mermaid/FlowchartDiagram.astro';

const { alt } = Astro.props;

//language=Mermaid
const code = `
graph LR
D(User)
subgraph I[Your server]
subgraph G[Docker]
H[(PostgreSQL)]
end
subgraph C[Docker]
A(FusionAuth)
end
subgraph J[Docker]
F(Your app)
end
end
D --> J
D --> C
C --> G
F --> C
style I fill:#999
`;
---
<Diagram {code} alt={alt} />
<style is:global>
foreignObject > div {
transform: translateY(-4px);
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
import Diagram from 'src/components/mermaid/FlowchartDiagram.astro';

const { alt } = Astro.props;

//language=Mermaid
const code = `
graph LR
D(User)
subgraph I[Your server]
subgraph G[Docker]
H[(PostgreSQL)]
end
subgraph C[Docker]
A(FusionAuth)
end
subgraph E[Docker]
B(Prometheus)
end
subgraph J[Docker]
F(Your app)
end
end
D --> J
D --> C
C --> G
F --> C
E --> |Prometheus pulls metrics from FusionAuth| C
style I fill:#999
style E fill:#944
`;
---
<Diagram {code} alt={alt} />
<style is:global>
foreignObject > div {
transform: translateY(-4px);
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
import Diagram from 'src/components/mermaid/FlowchartDiagram.astro';

const { alt } = Astro.props;

//language=Mermaid
const code = `
graph LR
D(User)
N(Ntfy.sh)
subgraph I[Your server]
subgraph G[Docker]
H[(PostgreSQL)]
end
subgraph C[Docker]
A(FusionAuth)
end
subgraph E[Docker]
B(Prometheus)
end
subgraph K[Docker]
L(AlertManager)
end
subgraph J[Docker]
F(Your app)
end
end
D --> J
D --> C
C --> G
F --> C
E --> |Prometheus pulls metrics from FusionAuth| C
E --> K
K --> N
style I fill:#999
style E fill:#944
style K fill:#944
style N fill:#944
`;
---
<Diagram {code} alt={alt} />
<style is:global>
foreignObject > div {
transform: translateY(-4px);
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
import Diagram from 'src/components/mermaid/FlowchartDiagram.astro';

const { alt } = Astro.props;

//language=Mermaid
const code = `
graph LR
D(User)
subgraph I[Your server]
subgraph G[Docker]
H[(PostgreSQL)]
end
subgraph C[Docker]
A(FusionAuth)
end
subgraph E[Docker]
B(Prometheus)
end
subgraph J[Docker]
F(Your app)
end
subgraph M[Docker]
O(Grafana)
end
end
D --> J
D --> C
C --> G
F --> C
E --> |Prometheus pulls metrics from FusionAuth| C
M --> E
style I fill:#999
style E fill:#944
style M fill:#944
`;
---
<Diagram {code} alt={alt} />
<style is:global>
foreignObject > div {
transform: translateY(-4px);
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
import Diagram from 'src/components/mermaid/FlowchartDiagram.astro';

const { alt } = Astro.props;

//language=Mermaid
const code = `
graph LR
D(User)
N(Ntfy.sh)
subgraph I[Your server]
subgraph G[Docker]
H[(PostgreSQL)]
end
subgraph C[Docker]
A(FusionAuth)
end
subgraph E[Docker]
B(Prometheus)
end
subgraph K[Docker]
L(AlertManager)
end
subgraph P[Docker]
Q(Loki)
end
subgraph R[Docker]
S(Promtail)
end
subgraph J[Docker]
F(Your app)
end
subgraph M[Docker]
O(Grafana)
end
end
D --> J
D --> C
C --> G
F --> C
E --> C
E --> K
K --> N
M --> E
E --> |Prometheus reads Loki logs| P
R --> |Promtail reads FusionAuth logs| C
R --> |Promtail sends logs to Loki| P
M --> |Grafana queries Loki logs| P
style I fill:#999
style E fill:#944
style K fill:#944
style N fill:#944
style M fill:#944
style P fill:#944
style R fill:#944
`;
---
<Diagram {code} alt={alt} />
<style is:global>
foreignObject > div {
transform: translateY(-4px);
}
</style>
7 changes: 4 additions & 3 deletions astro/src/content/docs/operate/secure-and-monitor/monitor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import LoadTestingTips from 'src/content/docs/get-started/run-in-the-cloud/_load

## Overview

Once you've installed FusionAuth and your applications use it for authentication, you'll want to ensure FusionAuth remains online and operational. An ecosystem of tools, protocols, and paid services are available to monitor applications and provide telemetry (remote measurement) to help you maintain FusionAuth's availability and performance.
Once you've installed FusionAuth and your applications use it for authentication, you'll want to ensure FusionAuth remains online and operational. An ecosystem of tools, protocols, and paid services are available to monitor applications and provide telemetry (remote measurement) to help you maintain FusionAuth's availability and performance.

This overview article will introduce you to various metrics (measurements) you can extract from FusionAuth and common monitoring tools to process, store, and visualize them.

Expand Down Expand Up @@ -116,7 +116,7 @@ Read the [guide to monitoring FusionAuth with OpenTelemetry](/docs/operate/secur

### What Is Prometheus?

[Prometheus](https://prometheus.io/docs/introduction/overview) is a monitoring and alerting toolkit with a built-in time series database designed to efficiently store metrics and provide data through a custom query language. Prometheus offers instrumentation tools to collect metrics from networks, machines, and some [programming languages](https://prometheus.io/docs/instrumenting/clientlibs/). While Prometheus includes basic charting capabilities, more advanced dashboards require integration with Grafana. You can use the Prometheus [Alertmanager](https://github.com/prometheus/alertmanager) to handle alerts.
[Prometheus](https://prometheus.io/docs/introduction/overview) is a monitoring and alerting toolkit with a built-in time series database designed to efficiently store metrics and provide data through a custom query language. Prometheus offers instrumentation tools to collect metrics from networks, machines, and some [programming languages](https://prometheus.io/docs/instrumenting/clientlibs/). While Prometheus includes basic charting capabilities, more advanced dashboards require integration with Grafana. You can use the Prometheus [Alertmanager](https://github.com/prometheus/alertmanager) to handle alerts.

Prometheus can be used for all activities in the monitoring chain, though some at a very basic level, but should [not be used to store logs](https://prometheus.io/docs/introduction/faq/#how-to-feed-logs-into-prometheus).

Expand Down Expand Up @@ -162,6 +162,7 @@ Some of the monitoring components discussed in the previous sections can alert s

- Email: You will probably need to subscribe to a mail sender service to receive email alerts, unless your internet provider allows you access to the SMTP protocol.
- Computer chat apps: Computer chat apps like Slack and Discord can receive alert messages in a specific channel for free. Slack and Discord clients can be installed on your phone to be sure you never miss an alert.
- Public notification web apps: There are public websites, like https://ntfy.sh and https://webhook.site that allow anyone to send messages to named channels for free. ntfy also has a mobile app that will notify you when a channel receives a message. Since these services are public, you should never send secrets to them.
- Phone chat apps: For example, WhatsApp and Threema. WhatsApp requires a phone number to sign up. Threema does not need a phone number but requires you to buy the mobile app for a small one-time fee. Both services charge a fee for businesses to send messages to users.

Grafana's OnCall tool consolidates and redirects multiple alerts from various systems. This might be a good option for you if you have support staff that monitor an alert system in shifts rather than wait to receive an email.
Expand All @@ -188,7 +189,7 @@ Remember that Prometheus, Loki, and Grafana all work together, in the same way a
| Prometheus | Yes | Yes | Yes | Yes | Yes (Alertmanager) | No |
| Grafana | No | No | No | Yes | Yes (OnCall) | No |
| Loki (logs only) | No | Yes | Yes | No | No | No |
| Email, Slack, Discord, WhatsApp, Threema | No | No | No | No | No | Yes |
| Email, Slack, Discord, WhatsApp, Threema, Webhook.site, ntfy.sh | No | No | No | No | No | Yes |

There are other paid and hosted monitoring services that aren't discussed in this article, like Splunk (integration guide with FusionAuth [here](/docs/operate/secure-and-monitor/splunk)) and Datadog, which have their own tools and typically implement the OpenTelemetry Protocol.

Expand Down
Loading