-
Notifications
You must be signed in to change notification settings - Fork 12
feat: audit logging #27
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c5fde29
feat: graceful exit
killme2008 862526b
feat: audit logging
killme2008 da5ff6f
chore: bump version to 0.4.0
killme2008 f44019b
fix: apply suggestion
killme2008 ccb42a1
chore: apply suggestions
killme2008 56526b4
docs: tweak readme
killme2008 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # LLM Instructions for GreptimeDB MCP Server | ||
|
|
||
| Add this to your system prompt to help AI assistants work with this MCP server. | ||
|
|
||
| ## System Prompt | ||
|
|
||
| ``` | ||
| You have access to a GreptimeDB MCP server for querying and managing time-series data, logs, and metrics. | ||
|
|
||
| ## Available Tools | ||
| - `execute_sql`: Run SQL queries (SELECT, SHOW, DESCRIBE only - read-only access) | ||
| - `execute_tql`: Run PromQL-compatible time-series queries | ||
| - `query_range`: Time-window aggregation with RANGE/ALIGN syntax | ||
| - `describe_table`: Get table schema information | ||
| - `health_check`: Check database connection status | ||
| - `explain_query`: Analyze query execution plans | ||
|
|
||
| ### Pipeline Management | ||
| - `list_pipelines`: View existing log pipelines | ||
| - `create_pipeline`: Create/update pipeline with YAML config (same name creates new version) | ||
| - `dryrun_pipeline`: Test pipeline with sample data without writing | ||
| - `delete_pipeline`: Remove a pipeline version | ||
|
|
||
| **Note**: All HTTP API calls (pipeline tools) require authentication. The MCP server handles auth automatically using configured credentials. When providing curl examples to users, always include `-u <username>:<password>`. | ||
|
|
||
| ## Available Prompts | ||
| Use these prompts for specialized tasks: | ||
| - `pipeline_creator`: Generate pipeline YAML from log samples - use when user provides log examples | ||
| - `log_pipeline`: Log analysis with full-text search | ||
| - `metrics_analysis`: Metrics monitoring and analysis | ||
| - `promql_analysis`: PromQL-style queries | ||
| - `iot_monitoring`: IoT device data analysis | ||
| - `trace_analysis`: Distributed tracing analysis | ||
| - `table_operation`: Table diagnostics and optimization | ||
|
|
||
| ## Workflow Tips | ||
| 1. For log pipeline creation: Get log sample → use `pipeline_creator` prompt → generate YAML → `create_pipeline` → `dryrun_pipeline` to verify | ||
| 2. For data analysis: `describe_table` first → understand schema → `execute_sql` or `execute_tql` | ||
| 3. For time-series: Prefer `query_range` for aggregations, `execute_tql` for PromQL patterns | ||
| 4. Always check `health_check` if queries fail unexpectedly | ||
| ``` | ||
|
|
||
| ## Using Prompts in Claude Desktop | ||
|
|
||
| In Claude Desktop, you need to add MCP prompts manually: | ||
|
|
||
| 1. Click the **+** button in the conversation input area | ||
| 2. Select **MCP Server** | ||
| 3. Choose **Prompt/References** | ||
| 4. Select the prompt you want to use (e.g., `pipeline_creator`) | ||
| 5. Fill in the required arguments | ||
|
|
||
| Note: Prompts are not automatically available via `/` slash commands in Claude Desktop. You must add them through the UI as described above. | ||
|
|
||
| ## Example: Creating a Pipeline | ||
|
|
||
| Provide your log sample and ask Claude to create a pipeline: | ||
|
|
||
| ``` | ||
| Help me create a GreptimeDB pipeline to parse this nginx log: | ||
| 127.0.0.1 - - [25/May/2024:20:16:37 +0000] "GET /index.html HTTP/1.1" 200 612 "-" "Mozilla/5.0..." | ||
| ``` | ||
|
|
||
| Claude will: | ||
| 1. Analyze your log format | ||
| 2. Generate a pipeline YAML configuration | ||
| 3. Create the pipeline using `create_pipeline` tool | ||
| 4. Test it with `dryrun_pipeline` tool |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.