Skip to content

Commit 243a656

Browse files
committed
Created Grafana.md and updated test-integrations-check-grafana-versions.rec
1 parent 435f3fd commit 243a656

File tree

2 files changed

+167
-0
lines changed

2 files changed

+167
-0
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: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,70 @@ If new versions are detected, test will fail with detailed instructions:
9595
- Shows where to add new version tests
9696
- Reminds to update documentation in manual/
9797
- Reminds to update website in site repo (manticoresearch-grafana-integration blog post)
98+
––– input –––
99+
bash << 'SCRIPT'
100+
# Check documentation versions for Grafana
101+
echo "Checking Grafana version references in documentation..."
102+
echo ""
103+
104+
# Must match LATEST_TESTED_VERSION above
105+
GRAFANA_LATEST="12.2"
106+
107+
# 1. Check manual documentation (local file mounted via workflow)
108+
echo "=== Checking manual documentation ==="
109+
GRAFANA_MANUAL="/manual/english/Integration/Grafana.md"
110+
if [ -f "$GRAFANA_MANUAL" ]; then
111+
echo "✓ Checking $GRAFANA_MANUAL"
112+
FOUND_VERSION=$(grep -o "versions [0-9.–-]* are" "$GRAFANA_MANUAL" | head -1)
113+
if echo "$FOUND_VERSION" | grep -q "${GRAFANA_LATEST}"; then
114+
echo "✅ Manual: $FOUND_VERSION"
115+
else
116+
echo "❌ Manual must contain version ${GRAFANA_LATEST}" >&2
117+
echo " Current: $FOUND_VERSION" >&2
118+
echo " Update to: versions 10.0-${GRAFANA_LATEST} are tested and supported" >&2
119+
exit 1
120+
fi
121+
else
122+
echo "❌ Manual not found at $GRAFANA_MANUAL" >&2
123+
echo "Manual must be mounted via workflow: -v \$(pwd)/manual:/manual" >&2
124+
exit 1
125+
fi
126+
127+
echo ""
128+
echo "=== Checking website blog post ==="
129+
# 2. Check website blog post
130+
BLOG_URL="https://manticoresearch.com/blog/manticoresearch-grafana-integration/"
131+
echo "✓ Fetching $BLOG_URL"
132+
133+
# Try curl first, fallback to wget
134+
if command -v curl > /dev/null 2>&1; then
135+
BLOG_CONTENT=$(curl -s "$BLOG_URL")
136+
elif command -v wget > /dev/null 2>&1; then
137+
BLOG_CONTENT=$(wget -qO- "$BLOG_URL")
138+
else
139+
echo "❌ Neither curl nor wget available" >&2
140+
exit 1
141+
fi
142+
143+
if [ -z "$BLOG_CONTENT" ]; then
144+
echo "⚠️ WARNING: Blog fetch failed - skipping" >&2
145+
elif echo "$BLOG_CONTENT" | grep -E "compatible with Grafana versions.*(up to |-|–)${GRAFANA_LATEST}" > /dev/null; then
146+
echo "✅ Blog: contains ${GRAFANA_LATEST}"
147+
else
148+
BLOG_VERSION=$(echo "$BLOG_CONTENT" | grep -o "compatible with Grafana versions [0-9.–-]* " | head -1 | sed 's/compatible with Grafana versions //')
149+
echo "⚠️ WARNING: Blog does NOT contain ${GRAFANA_LATEST} (found: ${BLOG_VERSION})" >&2
150+
echo " Update: site/content/english/blog/manticoresearch-grafana-integration/index.md" >&2
151+
fi
152+
153+
echo ""
154+
echo "✅ Documentation validation complete"
155+
SCRIPT
156+
––– output –––
157+
Checking Grafana version references in documentation...
158+
=== Checking manual documentation ===
159+
✓ Checking /manual/english/Integration/Grafana.md
160+
✅ Manual: versions 10.0-12.2 are
161+
=== Checking website blog post ===
162+
✓ Fetching https://manticoresearch.com/blog/manticoresearch-grafana-integration/
163+
✅ Blog: contains 12.2
164+
✅ Documentation validation complete

0 commit comments

Comments
 (0)