Repository navigation
Add OpenObserve plugin #177
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
johnhayes-squaredup
wants to merge
22
commits into
squaredup:main
Choose a base branch
from
johnhayes-squaredup:work/jh/openobserve
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
77379cb
Add OpenObserve plugin shell (streams, config validation)
johnhayes-squaredup 60b40e9
Complete OpenObserve plugin: self-hosted auth, import, streams, dashbβ¦
johnhayes-squaredup b6653c8
Add Metrics, Traces, Pipelines, and Incidents streams
johnhayes-squaredup 2ee48d9
Improve tracesLatest: span count, date timestamps, trace link
johnhayes-squaredup 5380153
Collapse per-service/model arrays in tracesLatest
johnhayes-squaredup 80c98eb
Fix required validation on four SQL/PromQL query fields
johnhayes-squaredup 01014c8
Add guided Simple Metrics Query picker (metric/label/value cascade)
johnhayes-squaredup 8de7fce
Restructure metrics query output: Name column + per-label columns
johnhayes-squaredup 5bee4cf
Use a code editor for the Metrics Query PromQL field
johnhayes-squaredup 78c224d
Surface pipeline source stream name/type as columns
johnhayes-squaredup bd1ca1c
Fix Traces Latest date bucketing, add configurable bucket interval
johnhayes-squaredup d7039b1
Fix empty Pipeline History timestamp, clarify Query Took's unit
johnhayes-squaredup c8df938
Drop Stream Field Values data stream
johnhayes-squaredup c07f882
Drop Functions data stream
johnhayes-squaredup bd1951a
Add SLOs data stream
johnhayes-squaredup 89f7923
Restrict Traces Latest to last1hour to avoid OOMing the server
johnhayes-squaredup a99d5a2
Add Alerts data stream, hide Cluster Info and Incidents streams
johnhayes-squaredup 639b1f0
Retag hidden Cluster Info and Incidents streams
johnhayes-squaredup 62f2611
Fix Pipelines Last Error formatting and Paused At unit
johnhayes-squaredup 39c85d9
Fix Pipeline History columns that failed to format
johnhayes-squaredup 8885897
Replace test server IP with a generic example URL
johnhayes-squaredup 4e42744
Address CodeRabbit review on OpenObserve plugin
johnhayes-squaredup 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
There are no files selected for viewing
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,11 @@ | ||
| { | ||
| "steps": [ | ||
| { | ||
| "displayName": "Authenticate", | ||
| "dataStream": { "name": "streams" }, | ||
| "required": true, | ||
| "error": "Could not authenticate. Check your URL, port, organization, and API Key.", | ||
| "success": "Connected successfully." | ||
| } | ||
| ] | ||
| } |
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,9 @@ | ||
| [ | ||
| { | ||
| "name": "OpenObserve Stream", | ||
| "sourceType": "Stream", | ||
| "icon": "stream", | ||
| "singular": "Stream", | ||
| "plural": "Streams" | ||
| } | ||
| ] |
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,69 @@ | ||
| { | ||
| "name": "alerts", | ||
| "displayName": "Alerts", | ||
| "description": "Alert rules defined in the organization, with their current state and last evaluation outcome", | ||
| "tags": ["Alerts"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "../v2/{{dataSource.organization}}/alerts", | ||
| "getArgs": [{ "key": "folder", "value": "{{folder || null}}" }], | ||
| "postRequestScript": "alerts.js" | ||
| }, | ||
| "matches": "none", | ||
| "ui": [ | ||
| { | ||
| "type": "text", | ||
| "name": "folder", | ||
| "label": "Folder (optional)" | ||
| } | ||
| ], | ||
| "metadata": [ | ||
| { "name": "id", "displayName": "ID", "shape": "string" }, | ||
| { "name": "name", "displayName": "Name", "shape": "string", "role": "label" }, | ||
| { "name": "description", "displayName": "Description", "shape": "string" }, | ||
| { | ||
| "name": "level", | ||
| "displayName": "Level", | ||
| "shape": [ | ||
| "state", | ||
| { | ||
| "map": { | ||
| "success": ["ok"], | ||
| "warning": ["warning"], | ||
| "error": ["critical", "error", "firing"] | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "name": "lastOutcome", | ||
| "displayName": "Last Outcome", | ||
| "shape": [ | ||
| "state", | ||
| { | ||
| "map": { | ||
| "success": ["normal"], | ||
| "error": ["error", "firing", "triggered"] | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { "name": "enabled", "displayName": "Enabled", "shape": "boolean" }, | ||
| { "name": "priority", "displayName": "Priority", "shape": "number" }, | ||
| { "name": "alertType", "displayName": "Alert Type", "shape": "string" }, | ||
| { "name": "isRealTime", "displayName": "Real Time", "shape": "boolean" }, | ||
| { "name": "streamName", "displayName": "Stream", "shape": "string" }, | ||
| { "name": "streamType", "displayName": "Stream Type", "shape": "string" }, | ||
| { "name": "conditionType", "displayName": "Condition Type", "shape": "string" }, | ||
| { "name": "folderName", "displayName": "Folder", "shape": "string" }, | ||
| { "name": "owner", "displayName": "Owner", "shape": "string" }, | ||
| { "name": "tags", "displayName": "Tags", "shape": "string" }, | ||
| { "name": "levelSince", "displayName": "Level Since", "shape": "date" }, | ||
| { "name": "lastOutcomeAt", "displayName": "Last Evaluated", "shape": "date", "role": "timestamp" }, | ||
| { "name": "lastOutcomeSince", "displayName": "Last Outcome Since", "shape": "date" }, | ||
| { "name": "lastTriggeredAt", "displayName": "Last Triggered", "shape": "date" }, | ||
| { "name": "lastSatisfiedAt", "displayName": "Last Satisfied", "shape": "date" } | ||
| ], | ||
| "timeframes": false | ||
| } |
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,21 @@ | ||
| { | ||
| "name": "clusterInfo", | ||
| "displayName": "Cluster Info", | ||
| "description": "Pending compaction jobs per node, grouped by region, for the OpenObserve cluster", | ||
| "tags": ["Streams"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "cluster_info", | ||
| "postRequestScript": "clusterInfo.js", | ||
| "errorHandling": { "type": "script", "script": "errorHandling/clusterInfo.js" } | ||
| }, | ||
| "matches": "none", | ||
| "visibility": { "type": "hidden" }, | ||
| "metadata": [ | ||
| { "name": "region", "displayName": "Region", "shape": "string" }, | ||
| { "name": "node", "displayName": "Node", "shape": "string", "role": "label" }, | ||
| { "name": "pendingJobs", "displayName": "Pending Compaction Jobs", "shape": "number" } | ||
| ], | ||
| "timeframes": false | ||
| } |
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,26 @@ | ||
| { | ||
| "name": "incidentStats", | ||
| "displayName": "Incident Stats", | ||
| "description": "Summary statistics for alert incidents in the organization", | ||
| "tags": ["Alerts"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "../v2/{{dataSource.organization}}/alerts/incidents/stats", | ||
| "postRequestScript": "incidentStats.js", | ||
| "errorHandling": { "type": "script", "script": "errorHandling/incidentStats.js" } | ||
| }, | ||
| "matches": "none", | ||
| "visibility": { "type": "hidden" }, | ||
| "metadata": [ | ||
| { "name": "total_incidents", "displayName": "Total Incidents", "shape": "number" }, | ||
| { "name": "open_incidents", "displayName": "Open Incidents", "shape": "number" }, | ||
| { "name": "acknowledged_incidents", "displayName": "Acknowledged Incidents", "shape": "number" }, | ||
| { "name": "resolved_incidents", "displayName": "Resolved Incidents", "shape": "number" }, | ||
| { "name": "alerts_per_incident_avg", "displayName": "Alerts Per Incident (avg)", "shape": ["number", { "decimalPlaces": 2 }] }, | ||
| { "name": "mttr_minutes", "displayName": "Mean Time to Resolve (min)", "shape": "number" }, | ||
| { "name": "by_severity", "displayName": "By Severity", "shape": "json" }, | ||
| { "name": "by_service", "displayName": "By Service", "shape": "json" } | ||
| ], | ||
| "timeframes": false | ||
| } |
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,97 @@ | ||
| { | ||
| "name": "incidents", | ||
| "displayName": "Incidents", | ||
| "description": "Alert incidents in the organization, groups of correlated alerts", | ||
| "tags": ["Alerts"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "../v2/{{dataSource.organization}}/alerts/incidents", | ||
| "getArgs": [ | ||
| { "key": "status", "value": "{{status || null}}" }, | ||
| { "key": "limit", "value": "{{limit}}" }, | ||
| { "key": "offset", "value": "{{offset}}" } | ||
| ], | ||
| "pathToData": "incidents" | ||
| }, | ||
| "matches": "none", | ||
| "visibility": { "type": "hidden" }, | ||
| "ui": [ | ||
| { | ||
| "type": "choiceChips", | ||
| "name": "status", | ||
| "label": "Status filter (optional)", | ||
| "isMulti": false, | ||
| "options": [ | ||
| { "value": "open", "label": "Open" }, | ||
| { "value": "acknowledged", "label": "Acknowledged" }, | ||
| { "value": "resolved", "label": "Resolved" } | ||
| ] | ||
| }, | ||
| { | ||
| "type": "number", | ||
| "name": "limit", | ||
| "label": "Limit", | ||
| "defaultValue": 50 | ||
| }, | ||
| { | ||
| "type": "number", | ||
| "name": "offset", | ||
| "label": "Offset", | ||
| "defaultValue": 0 | ||
| } | ||
| ], | ||
| "metadata": [ | ||
| { "name": "id", "displayName": "ID", "shape": "string", "role": "label" }, | ||
| { "name": "title", "displayName": "Title", "shape": "string" }, | ||
| { | ||
| "name": "status", | ||
| "displayName": "Status", | ||
| "shape": [ | ||
| "state", | ||
| { | ||
| "map": { | ||
| "error": ["open"], | ||
| "warning": ["acknowledged"], | ||
| "success": ["resolved"] | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { "name": "severity", "displayName": "Severity", "shape": "string" }, | ||
| { "name": "alert_count", "displayName": "Alert Count", "shape": "number" }, | ||
| { "name": "assigned_to", "displayName": "Assigned To", "shape": "string" }, | ||
| { | ||
| "name": "created_at", | ||
| "displayName": "Created At", | ||
| "shape": "date", | ||
| "role": "timestamp", | ||
| "valueExpression": "{{ new Date($['created_at'] / 1000).toISOString() }}" | ||
| }, | ||
| { | ||
| "name": "updated_at", | ||
| "displayName": "Updated At", | ||
| "shape": "date", | ||
| "valueExpression": "{{ new Date($['updated_at'] / 1000).toISOString() }}" | ||
| }, | ||
| { | ||
| "name": "first_alert_at", | ||
| "displayName": "First Alert At", | ||
| "shape": "date", | ||
| "valueExpression": "{{ new Date($['first_alert_at'] / 1000).toISOString() }}" | ||
| }, | ||
| { | ||
| "name": "last_alert_at", | ||
| "displayName": "Last Alert At", | ||
| "shape": "date", | ||
| "valueExpression": "{{ new Date($['last_alert_at'] / 1000).toISOString() }}" | ||
| }, | ||
| { | ||
| "name": "resolved_at", | ||
| "displayName": "Resolved At", | ||
| "shape": "date", | ||
| "valueExpression": "{{ $['resolved_at'] ? new Date($['resolved_at'] / 1000).toISOString() : null }}" | ||
| } | ||
| ], | ||
| "timeframes": false | ||
| } | ||
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,29 @@ | ||
| { | ||
| "name": "labelValues", | ||
| "displayName": "Label Values", | ||
| "description": "Values present for a label on a metric", | ||
| "tags": ["Metrics"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "prometheus/api/v1/label/{{labelName}}/values", | ||
| "getArgs": [ | ||
| { "key": "match[]", "value": "{{metric}}" }, | ||
| { "key": "start", "value": "{{timeframe.unixStart}}" }, | ||
| { "key": "end", "value": "{{timeframe.unixEnd}}" } | ||
| ], | ||
| "postRequestScript": "labelValues.js" | ||
| }, | ||
| "matches": "none", | ||
| "visibility": { "type": "hidden" }, | ||
| "ui": [ | ||
| { "type": "text", "name": "metric", "label": "Metric" }, | ||
| { "type": "text", "name": "labelName", "label": "Label" } | ||
| ], | ||
| "metadata": [ | ||
| { "name": "result", "visible": false }, | ||
| { "name": "label", "computed": true, "valueExpression": "{{ $['result'] }}", "role": "label" }, | ||
| { "name": "value", "computed": true, "valueExpression": "{{ $['result'] }}", "role": "value" } | ||
| ], | ||
| "timeframes": true | ||
| } |
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,50 @@ | ||
| { | ||
| "name": "logsSearch", | ||
| "displayName": "Logs Search", | ||
| "description": "Log records matching a SQL query, across any log stream", | ||
| "tags": ["Search"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "post", | ||
| "endpointPath": "_search", | ||
| "getArgs": [{ "key": "type", "value": "logs" }], | ||
| "postBody": { | ||
| "query": { | ||
| "sql": "{{sql}}", | ||
| "start_time": "{{timeframe.unixStart * 1000000}}", | ||
| "end_time": "{{timeframe.unixEnd * 1000000}}", | ||
| "from": 0, | ||
| "size": "{{size || 100}}" | ||
| }, | ||
| "search_type": "ui" | ||
| }, | ||
| "postRequestScript": "search.js" | ||
| }, | ||
| "matches": "none", | ||
| "ui": [ | ||
| { | ||
| "type": "textarea", | ||
| "name": "sql", | ||
| "label": "SQL Query", | ||
| "help": "The stream name isn't auto-substituted β type it yourself in the FROM clause, e.g. SELECT * FROM \"default\" LIMIT 100. This stream searches logs only.", | ||
| "placeholder": "SELECT * FROM \"default\" LIMIT 100", | ||
| "validation": { "required": true } | ||
| }, | ||
| { | ||
| "type": "number", | ||
| "name": "size", | ||
| "label": "Max rows", | ||
| "defaultValue": 100 | ||
| } | ||
| ], | ||
| "metadata": [ | ||
| { | ||
| "name": "recordTime", | ||
| "displayName": "Timestamp", | ||
| "role": "timestamp", | ||
| "shape": "date" | ||
| }, | ||
| { "pattern": ".*" } | ||
| ], | ||
| "timeframes": true | ||
| } |
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,26 @@ | ||
| { | ||
| "name": "metricLabels", | ||
| "displayName": "Metric Labels", | ||
| "description": "Label names present on a metric", | ||
| "tags": ["Metrics"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "prometheus/api/v1/labels", | ||
| "getArgs": [ | ||
| { "key": "match[]", "value": "{{metric}}" }, | ||
| { "key": "start", "value": "{{timeframe.unixStart}}" }, | ||
| { "key": "end", "value": "{{timeframe.unixEnd}}" } | ||
| ], | ||
| "postRequestScript": "metricLabels.js" | ||
| }, | ||
| "matches": "none", | ||
| "visibility": { "type": "hidden" }, | ||
| "ui": [{ "type": "text", "name": "metric", "label": "Metric" }], | ||
| "metadata": [ | ||
| { "name": "result", "visible": false }, | ||
| { "name": "label", "computed": true, "valueExpression": "{{ $['result'] }}", "role": "label" }, | ||
| { "name": "value", "computed": true, "valueExpression": "{{ $['result'] }}", "role": "value" } | ||
| ], | ||
| "timeframes": true | ||
| } |
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,24 @@ | ||
| { | ||
| "name": "metricNames", | ||
| "displayName": "Metric Names", | ||
| "description": "Metric names available for querying", | ||
| "tags": ["Metrics"], | ||
| "baseDataSourceName": "httpRequestUnscoped", | ||
| "config": { | ||
| "httpMethod": "get", | ||
| "endpointPath": "streams", | ||
| "getArgs": [ | ||
| { "key": "type", "value": "metrics" }, | ||
| { "key": "fetchSchema", "value": "false" } | ||
| ], | ||
| "pathToData": "list" | ||
| }, | ||
| "matches": "none", | ||
| "visibility": { "type": "hidden" }, | ||
| "metadata": [ | ||
| { "name": "name", "visible": false }, | ||
| { "name": "label", "computed": true, "valueExpression": "{{ $['name'] }}", "role": "label" }, | ||
| { "name": "value", "computed": true, "valueExpression": "{{ $['name'] }}", "role": "value" } | ||
| ], | ||
| "timeframes": false | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert incident dates before metadata evaluation.
Each
valueExpressionreads the field that it overrides.pipelineHistory.jsdocuments that this same self-reference rendered its date column empty. Incident date columns can therefore render empty even when the API supplies timestamps. Convert the raw fields in apostRequestScript, then remove these expressions. (raw.githubusercontent.com)Also applies to: 75-75, 81-81, 87-87, 93-93