Skip to content

Commit ff11f11

Browse files
Merge pull request #3971 from manticoresoftware/docs-grafana-integration
Created Grafana.md and updated test-integrations-check-grafana-versio…
2 parents 15bc0d4 + a28f85d commit ff11f11

File tree

2 files changed

+153
-12
lines changed

2 files changed

+153
-12
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Integration with Grafana
2+
3+
> NOTE: The integration with Grafana requires [Manticore Buddy](../Installation/Manticore_Buddy.md). If it doesn't work, make sure Buddy is installed.
4+
5+
[Grafana](https://grafana.com/) is an open-source data visualization and monitoring platform that allows you to create interactive dashboards and charts. Manticore Search integrates seamlessly with Grafana using the default MySQL connector, enabling you to visualize search data, monitor performance metrics, and analyze trends in real-time.
6+
7+
Currently, Grafana versions 10.0-12.2 are tested and supported.
8+
9+
## Prerequisites
10+
11+
Before integrating Manticore Search with Grafana, ensure that:
12+
13+
1. Manticore Search (version 6.2.0 or later) is properly installed and configured on your server. Refer to the [official Manticore Search installation guide](../Installation/Installation.md) for assistance.
14+
2. Grafana is set up on your system. Follow the [official Grafana installation guide](https://grafana.com/docs/grafana/latest/setup-grafana/installation/) for installation instructions.
15+
16+
## Connecting Manticore Search to Grafana
17+
18+
To connect Manticore Search to Grafana:
19+
20+
1. Log in to your Grafana dashboard and click on "Configuration" (the gear icon) in the left sidebar.
21+
2. Select "Data Sources" and click on "Add data source."
22+
3. Choose "MySQL" from the list of available data sources.
23+
4. In the settings page, provide the following details:
24+
- **Name**: A name for the data source (e.g., "Manticore Search")
25+
- **Host**: The hostname or IP address of your Manticore Search server (with MySQL port, default: `localhost:9306`)
26+
- **Database**: Leave empty or specify your database name
27+
- **User**: The username with access to Manticore Search (default: `root`)
28+
- **Password**: The password for the specified user (default: empty)
29+
5. Click on "Save & Test" to verify the connection.
30+
31+
## Creating Visualizations and Dashboards
32+
33+
After connecting Manticore Search to Grafana, you can create dashboards and visualizations:
34+
35+
1. In the Grafana dashboard, click on the "+" icon in the left sidebar and select "New dashboard."
36+
2. Click on the "Add visualization" button to start configuring your chart.
37+
3. Choose the Manticore Search data source that you connected via the MySQL connector.
38+
4. Select the type of chart you want to create (e.g., Time Series, Bar chart, Candlestick, Pie chart).
39+
5. Use Grafana's query builder or write an SQL query to fetch data from your Manticore Search tables.
40+
6. Customize the chart's appearance, labels, and other settings as needed.
41+
7. Click "Apply" to save your visualization to the dashboard.
42+
43+
## Example Use Case
44+
45+
Here's a simple example using time-series data. First, create a table and load sample data:
46+
47+
```sql
48+
CREATE TABLE btc_usd_trading (
49+
id bigint,
50+
time timestamp,
51+
open float,
52+
high float,
53+
low float,
54+
close float
55+
);
56+
```
57+
58+
Load the data:
59+
```bash
60+
curl -sSL https://gist.githubusercontent.com/donhardman/df109ba6c5e690f73198b95f3768e73f/raw/0fab3aee69d7007fad012f4e97f38901a64831fb/btc_usd_trading.sql | mysql -h0 -P9306
61+
```
62+
63+
In Grafana, you can create:
64+
- **Time Series chart**: Visualize price changes over time
65+
- **Candlestick chart**: Display open, high, low, close values for financial data
66+
- **Aggregation charts**: Use COUNT, AVG, MAX, MIN functions
67+
68+
Example queries:
69+
```sql
70+
-- Time series query
71+
SELECT time, close FROM btc_usd_trading ORDER BY time;
72+
73+
-- Aggregation query
74+
SELECT DATE(time) as date, AVG(close) as avg_price
75+
FROM btc_usd_trading
76+
GROUP BY date
77+
ORDER BY date;
78+
```
79+
80+
## Supported Features
81+
82+
When working with Manticore Search through Grafana, you can:
83+
84+
- Execute SQL queries against Manticore Search tables
85+
- Use aggregation functions: COUNT, AVG, MAX, MIN
86+
- Apply GROUP BY and ORDER BY operations
87+
- Filter data with WHERE clauses
88+
- Access table metadata via `information_schema.tables`
89+
- Create various visualization types supported by Grafana
90+
91+
## Limitations
92+
93+
- Some advanced MySQL features may not be available when working with Manticore Search through Grafana.
94+
- Only features supported by Manticore Search are available. Refer to the [SQL reference](../Searching/Full_text_matching/Basic_usage.md) for details.
95+
96+
## References
97+
98+
For more information and detailed tutorials:
99+
- [Grafana integration blog post](https://manticoresearch.com/blog/manticoresearch-grafana-integration/)
100+
- [Official Grafana documentation](https://grafana.com/docs/)

test/clt-tests/integrations/grafana/test-integrations-check-grafana-versions.rec

Lines changed: 53 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,35 +76,76 @@ Using tested versions:
7676
12.0
7777
12.1
7878
12.2
79+
––– comment –––
80+
If new versions are detected, test will fail with detailed instructions:
81+
- Lists files that need to be updated in manticoresearch repo
82+
- Shows where to add new version tests
83+
- Reminds to update documentation in manual/
84+
- Reminds to update website in site repo (manticoresearch-grafana-integration blog post)
7985
––– input –––
8086
bash << 'SCRIPT'
81-
# Check blog post for Grafana version
82-
echo "Checking Grafana version in blog post..."
87+
# Check documentation versions for Grafana
88+
echo "Checking Grafana version references in documentation..."
8389
echo ""
8490

8591
# Must match LATEST_TESTED_VERSION above
8692
GRAFANA_LATEST="12.2"
8793

94+
# 1. Check manual documentation (local file mounted via workflow)
95+
echo "=== Checking manual documentation ==="
96+
GRAFANA_MANUAL="/manual/english/Integration/Grafana.md"
97+
if [ -f "$GRAFANA_MANUAL" ]; then
98+
echo "✓ Checking $GRAFANA_MANUAL"
99+
FOUND_VERSION=$(grep -o "versions [0-9.–-]* are" "$GRAFANA_MANUAL" | head -1)
100+
if echo "$FOUND_VERSION" | grep -q "${GRAFANA_LATEST}"; then
101+
echo "✅ Manual: $FOUND_VERSION"
102+
else
103+
echo "❌ Manual must contain version ${GRAFANA_LATEST}" >&2
104+
echo " Current: $FOUND_VERSION" >&2
105+
echo " Update to: versions 10.0-${GRAFANA_LATEST} are tested and supported" >&2
106+
exit 1
107+
fi
108+
else
109+
echo "❌ Manual not found at $GRAFANA_MANUAL" >&2
110+
echo "Manual must be mounted via workflow: -v \$(pwd)/manual:/manual" >&2
111+
exit 1
112+
fi
113+
114+
echo ""
88115
echo "=== Checking website blog post ==="
116+
# 2. Check website blog post
89117
BLOG_URL="https://manticoresearch.com/blog/manticoresearch-grafana-integration/"
90118
echo "✓ Fetching $BLOG_URL"
91119

92-
BLOG_CONTENT=$(curl -s "$BLOG_URL")
120+
# Try curl first, fallback to wget
121+
if command -v curl > /dev/null 2>&1; then
122+
BLOG_CONTENT=$(curl -s "$BLOG_URL")
123+
elif command -v wget > /dev/null 2>&1; then
124+
BLOG_CONTENT=$(wget -qO- "$BLOG_URL")
125+
else
126+
echo "❌ Neither curl nor wget available" >&2
127+
exit 1
128+
fi
93129

94130
if [ -z "$BLOG_CONTENT" ]; then
95131
echo "⚠️ WARNING: Blog fetch failed - skipping" >&2
96-
elif echo "$BLOG_CONTENT" | grep -q "Grafana versions.*${GRAFANA_LATEST}"; then
97-
FOUND_FORMAT=$(echo "$BLOG_CONTENT" | grep -o "Grafana versions [0-9.-]*${GRAFANA_LATEST}" | head -1)
98-
echo "✅ Blog: $FOUND_FORMAT"
132+
elif echo "$BLOG_CONTENT" | grep -E "compatible with Grafana versions.*(up to |-|–)${GRAFANA_LATEST}" > /dev/null; then
133+
echo "✅ Blog: contains ${GRAFANA_LATEST}"
99134
else
100-
BLOG_VERSION=$(echo "$BLOG_CONTENT" | grep -o "Grafana versions [0-9.-]*" | head -1)
101-
echo "⚠️ WARNING: Blog does NOT contain ${GRAFANA_LATEST}" >&2
102-
echo " Found: $BLOG_VERSION" >&2
103-
echo " Expected: Grafana versions 10.0-${GRAFANA_LATEST}" >&2
135+
BLOG_VERSION=$(echo "$BLOG_CONTENT" | grep -o "compatible with Grafana versions [0-9.–-]* " | head -1 | sed 's/compatible with Grafana versions //')
136+
echo "⚠️ WARNING: Blog does NOT contain ${GRAFANA_LATEST} (found: ${BLOG_VERSION})" >&2
137+
echo " Update: site/content/english/blog/manticoresearch-grafana-integration/index.md" >&2
104138
fi
139+
140+
echo ""
141+
echo "✅ Documentation validation complete"
105142
SCRIPT
106143
––– output –––
107-
Checking Grafana version in blog post...
144+
Checking Grafana version references in documentation...
145+
=== Checking manual documentation ===
146+
✓ Checking /manual/english/Integration/Grafana.md
147+
✅ Manual: versions 10.0-12.2 are
108148
=== Checking website blog post ===
109149
✓ Fetching https://manticoresearch.com/blog/manticoresearch-grafana-integration/
110-
✅ Blog: Grafana versions 10.0-12.2
150+
✅ Blog: contains 12.2
151+
✅ Documentation validation complete

0 commit comments

Comments
 (0)