Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
172 changes: 172 additions & 0 deletions THIRD_PARTY_NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ COMPONENT INVENTORY
- npm: @ag-ui/encoder 1.0.2 (declared license: MIT)
- npm: @ag-ui/proto 1.0.2 (declared license: MIT)
- npm: @bufbuild/protobuf 2.16.0 (declared license: (Apache-2.0 AND BSD-3-Clause)); no license file was present in the installed package
- npm: @codemirror/autocomplete 6.20.3 (declared license: MIT)
- npm: @codemirror/commands 6.11.1 (declared license: MIT)
- npm: @codemirror/lang-sql 6.10.0 (declared license: MIT)
- npm: @codemirror/language 6.12.4 (declared license: MIT)
- npm: @codemirror/lint 6.9.7 (declared license: MIT)
- npm: @codemirror/state 6.7.6 (declared license: MIT)
- npm: @codemirror/view 6.43.13 (declared license: MIT)
- npm: @dagrejs/dagre 3.1.1 (declared license: MIT)
- npm: @dagrejs/graphlib 4.0.5 (declared license: MIT)
- npm: @floating-ui/core 1.8.0 (declared license: MIT)
Expand All @@ -88,8 +95,12 @@ COMPONENT INVENTORY
- npm: @floating-ui/utils 0.2.12 (declared license: MIT)
- npm: @fontsource-variable/geist 5.3.0 (declared license: OFL-1.1)
- npm: @fontsource-variable/geist-mono 5.3.0 (declared license: OFL-1.1)
- npm: @lezer/common 1.5.3 (declared license: MIT)
- npm: @lezer/highlight 1.2.5 (declared license: MIT)
- npm: @lezer/lr 1.4.11 (declared license: MIT)
- npm: @mantine/core 9.7.2 (declared license: MIT)
- npm: @mantine/hooks 9.7.2 (declared license: MIT)
- npm: @marijn/find-cluster-break 1.0.4 (declared license: MIT)
- npm: @modelcontextprotocol/client 2.3.1 (declared license: Apache-2.0)
- npm: @modelcontextprotocol/core 2.3.1 (declared license: Apache-2.0)
- npm: @modelcontextprotocol/ext-apps 2.0.3 (declared license: MIT)
Expand Down Expand Up @@ -127,6 +138,7 @@ COMPONENT INVENTORY
- npm: comma-separated-tokens 2.0.3 (declared license: MIT)
- npm: compare-versions 6.1.1 (declared license: MIT)
- npm: cookie-es 3.1.1 (declared license: MIT)
- npm: crelt 1.0.7 (declared license: MIT)
- npm: cross-spawn 7.0.6 (declared license: MIT)
- npm: csstype 3.2.3 (declared license: MIT)
- npm: debug 4.4.3 (declared license: MIT)
Expand Down Expand Up @@ -247,6 +259,7 @@ COMPONENT INVENTORY
- npm: space-separated-tokens 2.0.2 (declared license: MIT)
- npm: stringify-entities 4.0.4 (declared license: MIT)
- npm: strip-json-comments 5.0.3 (declared license: MIT)
- npm: style-mod 4.1.4 (declared license: MIT)
- npm: style-to-js 1.1.21 (declared license: MIT)
- npm: style-to-object 1.0.14 (declared license: MIT)
- npm: tabbable 6.5.0 (declared license: MIT)
Expand All @@ -272,6 +285,7 @@ COMPONENT INVENTORY
- npm: uuid 14.0.3 (declared license: MIT)
- npm: vfile 6.0.3 (declared license: MIT)
- npm: vfile-message 4.0.3 (declared license: MIT)
- npm: w3c-keyname 2.2.8 (declared license: MIT)
- npm: walk-up-path 4.0.0 (declared license: ISC)
- npm: which 2.0.2 (declared license: ISC)
- npm: yaml 2.9.1 (declared license: ISC)
Expand Down Expand Up @@ -7305,6 +7319,38 @@ not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.

--- Applies to -------------------------------------------------------------
- npm: @codemirror/autocomplete 6.20.3 / LICENSE
- npm: @codemirror/commands 6.11.1 / LICENSE
- npm: @codemirror/lang-sql 6.10.0 / LICENSE
- npm: @codemirror/language 6.12.4 / LICENSE
- npm: @codemirror/lint 6.9.7 / LICENSE
- npm: @codemirror/state 6.7.6 / LICENSE
- npm: @codemirror/view 6.43.13 / LICENSE
----------------------------------------------------------------------------

MIT License

Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: @dagrejs/dagre 3.1.1 / LICENSE
- npm: @dagrejs/graphlib 4.0.5 / LICENSE
Expand Down Expand Up @@ -7555,6 +7601,34 @@ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: @lezer/common 1.5.3 / LICENSE
- npm: @lezer/highlight 1.2.5 / LICENSE
- npm: @lezer/lr 1.4.11 / LICENSE
----------------------------------------------------------------------------

MIT License

Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: @mantine/core 9.7.2 / LICENSE
- npm: @mantine/hooks 9.7.2 / LICENSE
Expand Down Expand Up @@ -7582,6 +7656,32 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: @marijn/find-cluster-break 1.0.4 / LICENSE
----------------------------------------------------------------------------

MIT License

Copyright (C) 2024 by Marijn Haverbeke <marijn@haverbeke.berlin>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: @modelcontextprotocol/client 2.3.1 / LICENSE
- npm: @modelcontextprotocol/core 2.3.1 / LICENSE
Expand Down Expand Up @@ -8170,6 +8270,30 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: crelt 1.0.7 / LICENSE
----------------------------------------------------------------------------

Copyright (C) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: cross-spawn 7.0.6 / LICENSE
----------------------------------------------------------------------------
Expand Down Expand Up @@ -9979,6 +10103,30 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--- Applies to -------------------------------------------------------------
- npm: style-mod 4.1.4 / LICENSE
----------------------------------------------------------------------------

Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: style-to-js 1.1.21 / LICENSE
----------------------------------------------------------------------------
Expand Down Expand Up @@ -10370,6 +10518,30 @@ The above copyright notice and this permission notice shall be included in all c

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: w3c-keyname 2.2.8 / LICENSE
----------------------------------------------------------------------------

Copyright (C) 2016 by Marijn Haverbeke <marijn@haverbeke.berlin> and others

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--- Applies to -------------------------------------------------------------
- npm: walk-up-path 4.0.0 / LICENSE
----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion internal/api/panels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestVariableAndSchemaRoutes(t *testing.T) {
t.Fatalf("resolve %d %s", rec.Code, rec.Body)
}
rec = servePanels(t, &fakePanels{}, http.MethodGet, "/api/telemetry/schema?window=6h", "")
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), `"window":"6h"`) || !strings.Contains(rec.Body.String(), `"sql_relations":{"resource_inventory":`) || !strings.Contains(rec.Body.String(), `"sql_type":"TIMESTAMPTZ_NS"`) {
if rec.Code != http.StatusOK || !strings.Contains(rec.Body.String(), `"window":"6h"`) || !strings.Contains(rec.Body.String(), `"sql_relations":{`) || !strings.Contains(rec.Body.String(), `"resource_inventory":`) || !strings.Contains(rec.Body.String(), `"service_rollup":`) || !strings.Contains(rec.Body.String(), `"edge_rollup":`) || !strings.Contains(rec.Body.String(), `"sql_type":"TIMESTAMPTZ_NS"`) {
t.Fatalf("schema %d %s", rec.Code, rec.Body)
}
}
Expand Down
68 changes: 34 additions & 34 deletions internal/mcp/apps/panels.html

Large diffs are not rendered by default.

26 changes: 25 additions & 1 deletion internal/panel/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestSchemaDiscoversColumnsAttributesAndValues(t *testing.T) {
t.Fatal(err)
}
spans := schema.Signals["spans"]
if len(schema.Signals) != 3 || len(schema.SQLRelations) != 1 || len(schema.SQLRelations["resource_inventory"].Columns) != 6 {
if len(schema.Signals) != 3 || len(schema.SQLRelations) != 3 || len(schema.SQLRelations["resource_inventory"].Columns) != 6 {
t.Fatalf("SQL relation discovery: %+v", schema)
}
if got := schema.SQLRelations["resource_inventory"]; got.Columns[3].SQLType != "VARIANT" || got.Columns[4].SQLType != "TIMESTAMPTZ_NS" {
Expand Down Expand Up @@ -62,6 +62,30 @@ func TestSchemaDiscoversColumnsAttributesAndValues(t *testing.T) {
}
}

func TestSchemaRollupColumnsMatchEngine(t *testing.T) {
_, db := metricFixture(t)
for _, name := range []string{"service_rollup", "edge_rollup"} {
rows, err := db.QueryContext(t.Context(), "SELECT * FROM "+name+" LIMIT 0")
if err != nil {
t.Fatal(err)
}
columns, err := rows.ColumnTypes()
rows.Close()
if err != nil {
t.Fatal(err)
}
catalog := SQLRelations()[name].Columns
if len(columns) != len(catalog) {
t.Fatalf("%s: engine has %d columns, catalog has %d", name, len(columns), len(catalog))
}
for i, column := range columns {
if column.Name() != catalog[i].Name || column.DatabaseTypeName() != catalog[i].SQLType {
t.Errorf("%s column %d: engine %s %s, catalog %+v", name, i, column.Name(), column.DatabaseTypeName(), catalog[i])
}
}
}
}

func TestSchemaReturnsOperationalErrorsUnwrapped(t *testing.T) {
e := newFixtureExecutor(t)
ctx, cancel := context.WithCancel(t.Context())
Expand Down
28 changes: 28 additions & 0 deletions internal/panel/sql_relations.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,34 @@ type SQLColumnSchema struct {
// SQLRelations is the shared catalog for discovery and generated documentation.
func SQLRelations() map[string]SQLRelationSchema {
return map[string]SQLRelationSchema{
"service_rollup": {
Description: "Per-service analytical rollup by namespace and time bucket. Panel SQL only; filter bucket with $__window(bucket).",
Columns: []SQLColumnSchema{
{Field: str("namespace", "OpenTelemetry service namespace"), SQLType: "VARCHAR"},
{Field: ts("bucket", "Rollup time bucket"), SQLType: "TIMESTAMP"},
{Field: str("service", "Service name"), SQLType: "VARCHAR"},
{Field: num("spans", "count", "Total spans"), SQLType: "BIGINT"},
{Field: num("served_spans", "count", "Spans describing work performed by this service"), SQLType: "BIGINT"},
{Field: num("p50_ms", "ms", "Median service latency"), SQLType: "DOUBLE"},
{Field: num("p95_ms", "ms", "95th percentile service latency"), SQLType: "DOUBLE"},
{Field: num("error_rate", "percent", "Error rate"), SQLType: "DOUBLE"},
{Field: num("log_count", "count", "Log events"), SQLType: "BIGINT"},
{Field: num("metric_count", "count", "Metric data points"), SQLType: "BIGINT"},
},
},
"edge_rollup": {
Description: "Dependency analytical rollup by namespace, time bucket, caller, callee and edge type. Panel SQL only; filter bucket with $__window(bucket).",
Columns: []SQLColumnSchema{
{Field: str("namespace", "OpenTelemetry service namespace"), SQLType: "VARCHAR"},
{Field: ts("bucket", "Rollup time bucket"), SQLType: "TIMESTAMP"},
{Field: str("caller", "Calling service"), SQLType: "VARCHAR"},
{Field: str("callee", "Called service"), SQLType: "VARCHAR"},
{Field: num("calls", "count", "Calls between services"), SQLType: "BIGINT"},
{Field: num("avg_ms", "ms", "Average call duration"), SQLType: "DOUBLE"},
{Field: num("error_rate", "percent", "Error rate"), SQLType: "DOUBLE"},
{Field: str("edge_type", "Dependency edge type"), SQLType: "VARCHAR"},
},
},
"resource_inventory": {
Description: "Distinct full resource identities per signal, namespace and service observed inside the logical panel window [start,end). Panel SQL only; unavailable to structured query.from, variables and unscoped SQL. count(*) counts resource identities per signal, not events or instances. Resource extrema describe actual observations inside the selected window, not a historical registry.",
Columns: []SQLColumnSchema{
Expand Down
Loading
Loading