-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Create a /quality-metrics endpoint #6608
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1932a2b
Return 400
ADI-ROXX 5288d8c
Merge remote-tracking branch 'upstream/main'
ADI-ROXX a9067ad
Create a /quality-metrics endpoint
ADI-ROXX 8ca78a8
Dummy data in the correct format
ADI-ROXX 6b68418
lint
ADI-ROXX 1861fd4
interface{}->any for lint
ADI-ROXX ce7929e
Added tests for coverage
ADI-ROXX 3c434b6
app/qualitymetrics
ADI-ROXX 6f55732
Merge branch 'main' into dummyRoutes
ADI-ROXX eb6f2e6
basic-test
ADI-ROXX 8d5df2d
Merge branch 'dummyRoutes' of https://github.com/ADI-ROXX/jaeger into…
ADI-ROXX 55aa6d9
Merge branch 'main' into dummyRoutes
ADI-ROXX 5646223
minor adjustments
ADI-ROXX 9a8841b
Merge branch 'dummyRoutes' of https://github.com/ADI-ROXX/jaeger into…
ADI-ROXX b18cc7e
new link
ADI-ROXX 8fdd9c6
Not be empty
ADI-ROXX 6f434d4
Remove assert string
ADI-ROXX 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 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 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 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,102 @@ | ||
// Copyright (c) 2025 The Jaeger Authors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package qualitymetrics | ||
|
||
func GetSampleData() TQualityMetrics { | ||
return TQualityMetrics{ | ||
TraceQualityDocumentationLink: "https://github.com/jaegertracing/jaeger-analytics-java#trace-quality-metrics", | ||
BannerText: &BannerText{ | ||
Value: "🛑 Made up data, for demonstration only!", | ||
Styling: map[string]any{ | ||
"color": "blue", | ||
"fontWeight": "bold", | ||
}, | ||
}, | ||
Scores: []Score{ | ||
{ | ||
Key: "coverage", | ||
Label: "Instrumentation Coverage", | ||
Max: 100, | ||
Value: 90, | ||
}, | ||
{ | ||
Key: "quality", | ||
Label: "Trace Quality", | ||
Max: 100, | ||
Value: 85, | ||
}, | ||
}, | ||
Metrics: []Metric{ | ||
{ | ||
Name: "Span Completeness", | ||
Category: "coverage", | ||
Description: "Measures the completeness of spans in traces.", | ||
MetricDocumentationLink: "https://example.com/span-completeness-docs", | ||
MetricWeight: 0.6, | ||
PassCount: 1500, | ||
PassExamples: []Example{ | ||
{TraceID: "trace-id-001"}, | ||
{TraceID: "trace-id-002"}, | ||
}, | ||
FailureCount: 100, | ||
FailureExamples: []Example{ | ||
{TraceID: "trace-id-003"}, | ||
}, | ||
Details: []Detail{ | ||
{ | ||
Description: "Detailed breakdown of span completeness.", | ||
Header: "Span Completeness Details", | ||
Columns: []ColumnDef{ | ||
{Key: "service", Label: "Service"}, | ||
{Key: "spanCount", Label: "Span Count"}, | ||
}, | ||
Rows: []Row{ | ||
{"service": "sample-service-A", "spanCount": 150}, | ||
{"service": "sample-service-B", "spanCount": 200}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
Name: "Error Rate", | ||
Category: "quality", | ||
Description: "Percentage of spans that resulted in errors.", | ||
MetricDocumentationLink: "https://example.com/error-rate-docs", | ||
MetricWeight: 0.4, | ||
PassCount: 1400, | ||
PassExamples: []Example{ | ||
{TraceID: "trace-id-004"}, | ||
}, | ||
FailureCount: 80, | ||
FailureExamples: []Example{ | ||
{TraceID: "trace-id-005"}, | ||
}, | ||
Details: []Detail{ | ||
{ | ||
Description: "Detailed breakdown of error rates.", | ||
Header: "Error Rate Details", | ||
Columns: []ColumnDef{ | ||
{Key: "service", Label: "Service"}, | ||
{Key: "errorCount", Label: "Error Count"}, | ||
}, | ||
Rows: []Row{ | ||
{"service": "sample-service-A", "errorCount": 5}, | ||
{"service": "sample-service-B", "errorCount": 3}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
Clients: []Client{ | ||
{ | ||
Version: "1.0.0", | ||
MinVersion: "0.9.0", | ||
Count: 10, | ||
Examples: []Example{ | ||
{TraceID: "trace-id-006"}, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
This file contains 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 @@ | ||
// Copyright (c) 2025 The Jaeger Authors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package qualitymetrics | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/jaegertracing/jaeger/pkg/testutils" | ||
) | ||
|
||
func TestGetSampleData(t *testing.T) { | ||
data := GetSampleData() | ||
assert.NotEmpty(t, data.TraceQualityDocumentationLink) | ||
} | ||
|
||
func TestMain(m *testing.M) { | ||
testutils.VerifyGoLeaks(m) | ||
} |
This file contains 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,83 @@ | ||
// Copyright (c) 2025 The Jaeger Authors. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package qualitymetrics | ||
|
||
// TQualityMetrics represents the entire quality metrics response. | ||
type TQualityMetrics struct { | ||
TraceQualityDocumentationLink string `json:"traceQualityDocumentationLink"` | ||
BannerText *BannerText `json:"bannerText,omitempty"` | ||
Scores []Score `json:"scores"` | ||
Metrics []Metric `json:"metrics"` | ||
Clients []Client `json:"clients,omitempty"` | ||
} | ||
|
||
// BannerText stores the optional banner text with styling | ||
type BannerText struct { | ||
Value string `json:"value"` | ||
Styling map[string]any `json:"styling,omitempty"` | ||
} | ||
|
||
// Score represents individual score entries. | ||
type Score struct { | ||
Key string `json:"key"` | ||
Label string `json:"label"` | ||
Max int `json:"max"` | ||
Value int `json:"value"` | ||
} | ||
|
||
// Metric represents individual metrics with detailed information. | ||
type Metric struct { | ||
Name string `json:"name"` | ||
Category string `json:"category"` | ||
Description string `json:"description"` | ||
MetricDocumentationLink string `json:"metricDocumentationLink"` | ||
MetricWeight float64 `json:"metricWeight"` | ||
PassCount int `json:"passCount"` | ||
PassExamples []Example `json:"passExamples"` | ||
FailureCount int `json:"failureCount"` | ||
FailureExamples []Example `json:"failureExamples"` | ||
ExemptionCount *int `json:"exemptionCount"` | ||
ExemptionExamples []Example `json:"exemptionExamples"` | ||
Details []Detail `json:"details"` | ||
} | ||
|
||
// Detail represents additional details for a metric. | ||
type Detail struct { | ||
Description string `json:"description"` | ||
Header string `json:"header"` | ||
Columns []ColumnDef `json:"columns"` | ||
Rows []Row `json:"rows"` | ||
} | ||
|
||
// ColumnDef represents column definitions in details. | ||
type ColumnDef struct { | ||
Key string `json:"key"` | ||
Label string `json:"label"` | ||
PreventSort bool `json:"preventSort"` | ||
Styling map[string]any `json:"styling,omitempty"` | ||
} | ||
|
||
// Row represents a single row of data in details. | ||
type Row map[string]any | ||
|
||
// StyledValue represents a value that may include styling or a link. | ||
type StyledValue struct { | ||
LinkTo string `json:"linkTo"` | ||
Styling map[string]any `json:"styling"` | ||
Value any `json:"value"` | ||
} | ||
|
||
// Example represents a sample trace | ||
type Example struct { | ||
SpanIDs []string `json:"spanIDs"` | ||
TraceID string `json:"traceID"` | ||
} | ||
|
||
// Client represents client information. | ||
type Client struct { | ||
Version string `json:"version"` | ||
MinVersion string `json:"minVersion"` | ||
Count int `json:"count"` | ||
Examples []Example `json:"examples"` | ||
} |
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.
why
T
?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.
what's the answer to the question?
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.
general advice - it's a poor choice to resolve comments without actually responding or fixing the code.