Skip to content
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

feat: schema field level usage analytics #174

Merged
merged 111 commits into from
Oct 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
b5bcc2b
feat: implement resolve stats collector
StarpTech Oct 9, 2023
db12da9
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 9, 2023
3dc039a
chore: fix router dockerfile
StarpTech Oct 9, 2023
96863e9
chore: update
StarpTech Oct 10, 2023
45dcfa7
chore: update graphqlmetrics contract
jensneuse Oct 10, 2023
9ce05f7
chore: readd main server
StarpTech Oct 10, 2023
744afcb
chore: bootstrap service
StarpTech Oct 10, 2023
0ad875f
chore: improve
StarpTech Oct 10, 2023
4520a05
chore: improve
StarpTech Oct 10, 2023
97f7ec1
chore: improve
StarpTech Oct 10, 2023
a350a6f
chore: improve
StarpTech Oct 11, 2023
72f52a0
chore: fix workflows
StarpTech Oct 11, 2023
05854bd
chore: improve
StarpTech Oct 12, 2023
5ec01ab
chore: improve
StarpTech Oct 12, 2023
f3c6304
chore: improve
StarpTech Oct 12, 2023
68c78f2
chore: implement jwt auth
StarpTech Oct 12, 2023
80d3157
chore: improve
StarpTech Oct 12, 2023
2ab6c22
chore: improve
StarpTech Oct 12, 2023
c1e2bde
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 12, 2023
561d86d
chore: improve
StarpTech Oct 12, 2023
e75ee67
chore: improve
StarpTech Oct 12, 2023
01bc980
chore: improve
StarpTech Oct 12, 2023
3cf9c57
chore: improve
StarpTech Oct 12, 2023
5372787
chore: improve
StarpTech Oct 12, 2023
050a2c3
chore: improve
StarpTech Oct 12, 2023
277e7fd
chore: improve
StarpTech Oct 12, 2023
410be29
chore: improve
StarpTech Oct 12, 2023
b408d6d
chore: improve
StarpTech Oct 12, 2023
73e6f2b
chore: improve
StarpTech Oct 12, 2023
a5f203e
chore: improve
StarpTech Oct 12, 2023
2ec6112
chore: improve
StarpTech Oct 12, 2023
1c4f537
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 12, 2023
3ba704f
chore: improve
StarpTech Oct 12, 2023
263a52f
chore: improve
StarpTech Oct 12, 2023
9a6acac
feat: add schema usage info to GraphQL Handler (#182)
jensneuse Oct 13, 2023
208b8e1
chore: initial exporter impl
StarpTech Oct 13, 2023
2a47e4a
chore: improve
StarpTech Oct 13, 2023
1d9c3bf
chore: improve
StarpTech Oct 13, 2023
d585f46
chore: move to new go namespace, enable brotli compression
StarpTech Oct 13, 2023
c6e552d
chore: improve
StarpTech Oct 14, 2023
0b9b71b
chore: improve
StarpTech Oct 14, 2023
c8b00f6
chore: improve
StarpTech Oct 14, 2023
13f98a7
chore: improve
StarpTech Oct 14, 2023
2235514
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 14, 2023
3b6e56c
chore: implement backoff retry for exporter, remove webhook buf gen
StarpTech Oct 14, 2023
1954be4
chore: improve
StarpTech Oct 14, 2023
32fbe97
chore: remove atomic
StarpTech Oct 14, 2023
4fa859a
chore: improve
StarpTech Oct 14, 2023
bab3ca1
chore: improve
StarpTech Oct 15, 2023
979ca44
chore: improve
StarpTech Oct 15, 2023
9daccaa
chore: improve
StarpTech Oct 15, 2023
154cce3
chore: improve
StarpTech Oct 15, 2023
ab13ccb
chore: improve
StarpTech Oct 15, 2023
97acb68
chore: improve
StarpTech Oct 15, 2023
83a64c9
chore: improve
StarpTech Oct 15, 2023
166c912
chore: improve
StarpTech Oct 15, 2023
83669ad
chore: improve
StarpTech Oct 15, 2023
914411e
chore: improve
StarpTech Oct 15, 2023
dcef133
chore: improve, add tests
StarpTech Oct 15, 2023
96bf7f5
chore: improve
StarpTech Oct 15, 2023
b4b4584
chore: improve
StarpTech Oct 15, 2023
f70021a
chore: improve
StarpTech Oct 15, 2023
f40d002
chore: improve
StarpTech Oct 15, 2023
81787a1
chore: improve readme
StarpTech Oct 15, 2023
7095c76
chore: improve
StarpTech Oct 15, 2023
01817c3
chore: add service to docker compose files and lerna
StarpTech Oct 15, 2023
915315b
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 15, 2023
9f48133
chore: improve
StarpTech Oct 16, 2023
4c7de83
chore: improve
StarpTech Oct 16, 2023
a4f5014
chore: improve
StarpTech Oct 16, 2023
9839d98
chore: add graphqlmetrics service to helm chart
StarpTech Oct 16, 2023
4f791ef
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 16, 2023
c9b738d
chore: merge
StarpTech Oct 16, 2023
3f75a42
chore: improve
StarpTech Oct 16, 2023
8c34d8f
chore: improve
StarpTech Oct 16, 2023
d18e4f3
chore: improve
StarpTech Oct 16, 2023
c2383b6
chore: improve
StarpTech Oct 16, 2023
cde1db5
chore: improve
StarpTech Oct 16, 2023
eec92eb
chore: update engine branch
Aenimus Oct 16, 2023
f148559
chore: update
StarpTech Oct 16, 2023
99d1493
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 16, 2023
1fe9262
chore: improve
StarpTech Oct 16, 2023
9f60557
chore: improve
StarpTech Oct 16, 2023
c0137ff
chore: use zstd(3)
StarpTech Oct 16, 2023
d0745a8
chore: improve
StarpTech Oct 16, 2023
3f22506
chore: move prepare plan to pre handler to centralize metric collection
StarpTech Oct 20, 2023
ca76f03
feat: schema coverage ui (#191)
thisisnithin Oct 23, 2023
3c003c7
chore: add mv for graphql metrics, sort data before insert
StarpTech Oct 23, 2023
861618f
chore: partial merge (#198)
StarpTech Oct 24, 2023
6f8cbb4
Merge remote-tracking branch 'origin/main' into dustin/eng-4276-imple…
fiam Oct 24, 2023
0cca47f
update mv
thisisnithin Oct 25, 2023
dde3027
ui fixes
thisisnithin Oct 25, 2023
d14da40
fix ui
thisisnithin Oct 25, 2023
2062ab3
fix ui layouts
thisisnithin Oct 25, 2023
fce09ca
loop command
thisisnithin Oct 25, 2023
1aaf9b5
fix empty operation name
thisisnithin Oct 25, 2023
e042105
query filter fix
thisisnithin Oct 25, 2023
e99a0d5
fix import
thisisnithin Oct 25, 2023
6a3b4d1
update date picker behavior
thisisnithin Oct 25, 2023
1e74d57
update datepicker ui
thisisnithin Oct 25, 2023
695dd45
fix pagination
thisisnithin Oct 25, 2023
7b73d87
unset sort on table relink
thisisnithin Oct 25, 2023
c99d3bb
fix datepicker state
thisisnithin Oct 25, 2023
15d8488
fix metrics page range and operation trace link
thisisnithin Oct 25, 2023
dc73528
dry code
thisisnithin Oct 25, 2023
3af832c
fix empty results not fetching filters
thisisnithin Oct 25, 2023
a51633b
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 25, 2023
57c9b83
chore: improve
StarpTech Oct 25, 2023
4013524
chore: improve
StarpTech Oct 25, 2023
a2f6f8c
Merge branch 'main' into dustin/eng-4276-implement-resolve-stats-coll…
StarpTech Oct 25, 2023
079df17
fix ui
thisisnithin Oct 25, 2023
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
Prev Previous commit
Next Next commit
chore: improve
  • Loading branch information
StarpTech committed Oct 25, 2023
commit 4013524b4996d602218896ee4fe90dc5c09787b4
32 changes: 31 additions & 1 deletion graphqlmetrics/metrics_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func TestPublishGraphQLMetrics(t *testing.T) {
Name: "wundergraph",
Version: "1.0.0",
},
RequestInfo: &graphqlmetricsv1.RequestInfo{
StatusCode: 200,
Error: true,
},
Attributes: map[string]string{
"test": "test123",
},
Expand All @@ -73,6 +77,8 @@ func TestPublishGraphQLMetrics(t *testing.T) {
)
require.NoError(t, err)

// Validate insert

var opCount int
require.NoError(t, db.QueryRow(`
SELECT COUNT(*) FROM gql_metrics_operations
Expand All @@ -85,19 +91,43 @@ func TestPublishGraphQLMetrics(t *testing.T) {

assert.Greater(t, opCount, 0)

// Validate insert

var fieldUsageCount int
require.NoError(t, db.QueryRow(`
SELECT COUNT(*) FROM gql_metrics_schema_usage
WHERE OperationHash = 'hash123' AND
OrganizationID = 'org123' AND
FederatedGraphID = 'fed123' AND
RouterConfigVersion = 'v1' AND
Attributes['test'] = 'test123' AND
HttpStatusCode = '200' AND
HasError = true AND
ClientName = 'wundergraph' AND
ClientVersion = '1.0.0' AND
hasAny(TypeNames, ['Query']) AND
startsWith(Path, ['hello'])
`).Scan(&fieldUsageCount))

assert.Greater(t, fieldUsageCount, 0)
// Validate materialized view

var fieldUsageCountMv int
require.NoError(t, db.QueryRow(`
SELECT COUNT(*) FROM gql_metrics_schema_usage_5m_90d_mv
WHERE OperationHash = 'hash123' AND
OrganizationID = 'org123' AND
FederatedGraphID = 'fed123' AND
RouterConfigVersion = 'v1' AND
TotalErrors = 1 AND
TotalUsages = 1 AND
TotalClientErrors = 0 AND
ClientName = 'wundergraph' AND
ClientVersion = '1.0.0' AND
hasAny(TypeNames, ['Query']) AND
startsWith(Path, ['hello'])
`).Scan(&fieldUsageCountMv))

assert.Greater(t, fieldUsageCountMv, 0)
}

func TestAuthentication(t *testing.T) {
Expand Down
Loading