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

Add keystone telemetry inform command and update telemetry policy #9292

Merged
merged 19 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from 15 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
5 changes: 5 additions & 0 deletions .changeset/add-telemetry-inform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@keystone-6/core": minor
---

Adds `keystone telemetry inform` command to show an informed consent notice
5 changes: 5 additions & 0 deletions .changeset/fix-telemetry-policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@keystone-6/core": patch
---

Update https://keystonejs.com/docs/reference/telemetry to show that `database` type is collected as part of telemetry
25 changes: 14 additions & 11 deletions docs/content/docs/reference/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Keystone collects telemetry information in the form of two different types of da
We refer to these two different reports, as “device telemetry” and “project telemetry” respectively.

These reports are forwarded to [https://telemetry.keystonejs.com/](https://telemetry.keystonejs.com/), and are reported separately to minimize any correlation between them insofar as the timing and grouping of that data, that an otherwise combined report may have. We are collecting these two reports for different reasons, and thus have no need to associate them.
We differentiate and record the type and version of reports from the URL used by Keystone.
Copy link
Member Author

@dcousens dcousens Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving forward, we'll use the /3 version in the endpoint to differentiate report schema versions in the same way we differentiate report types using /project and /device.

This makes that abundantly transparent.


We additionally record a timestamp of the time that the report is received by the server at [https://telemetry.keystonejs.com](https://telemetry.keystonejs.com/).

Expand All @@ -78,9 +79,9 @@ A device telemetry report is formatted as JSON and currently looks like:

```json
{
"previous": "2022-11-23",
"lastSentDate": "2024-11-23",
"os": "darwin",
"node": "18"
"node": "20"
}
```

Expand All @@ -89,27 +90,29 @@ A device telemetry report is formatted as JSON and currently looks like:
The type of information contained within a project telemetry report is currently:

- The last date you used `keystone dev` for this project, and
- The resolved versions of any `@keystone-6` packages used by this project, and
- The resolved package versions of any `@keystone-6` packages used by this project, and
- The database type used by the project,
- The number of lists for this project, and
- The name and number of field types that you are using

A project telemetry report is formatted as JSON and currently looks like:

```json
{
"previous": "2022-11-23",
"versions": {
"@keystone-6/auth": "5.0.1",
"@keystone-6/core": "3.1.2",
"lastSentDate": "2024-11-23",
"packages": {
"@keystone-6/auth": "8.0.1",
"@keystone-6/core": "6.1.0",
"@keystone-6/document-renderer": "1.1.2",
"@keystone-6/fields-document": "5.0.2"
},
"database": "postgresql",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DavidMulder0 as in #9290, with this missed in our telemetry policy - I will set this field to NULL for any remaining telemetry data that is to be aggregated.

UPDATE ProjectEvent SET database = NULL;

"lists": 3,
"fields": {
"unknown": 1,
"@keystone-6/text": 5,
"@keystone-6/image": 1,
"@keystone-6/file": 1
"@keystone-6/timestamp": 2,
"@keystone-6/checkbox": 1
}
}
```
Expand Down Expand Up @@ -185,8 +188,8 @@ If you wish to see how telemetry is currently configured for your device or proj

## What if I have a complaint or question

If you have any questions or concerns about the information that is gathered please contact us by logging a GitHub Issue [https://github.com/keystonejs/keystone](https://github.com/keystonejs/keystone).
If you have any questions or concerns about the information that is gathered please contact us by logging a GitHub Issue [https://github.com/keystonejs/keystone](https://github.com/keystonejs/keystone).

Alternatively please contact our Privacy Officer by email to [privacy@keystonejs.com](mailto:privacy@keystonejs.com), or by mail to Level 10, 191 Clarence Street, Sydney NSW 2000.
Alternatively please contact our Privacy Officer by email to [privacy@keystonejs.com](mailto:privacy@keystonejs.com), or by mail to Level 10, 191 Clarence Street, Sydney NSW 2000.

For further information about Keystone’s security policy please see [https://github.com/keystonejs/keystone/security/policy](https://github.com/keystonejs/keystone/security/policy)
2 changes: 1 addition & 1 deletion examples/custom-output-paths/keystone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default config({

// when working in a monorepo environment you may want to output the prisma client elsewhere
// you can use .db.prismaClientPath to configure where that is
prismaClientPath: 'node_modules/.myprisma/client',
prismaClientPath: 'node_modules/myprisma',
prismaSchemaPath: 'my-prisma.prisma',
},
lists,
Expand Down
2 changes: 1 addition & 1 deletion examples/custom-output-paths/my-prisma.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datasource sqlite {

generator client {
provider = "prisma-client-js"
output = "node_modules/.myprisma/client"
output = "node_modules/myprisma"
}

model Post {
Expand Down
20 changes: 10 additions & 10 deletions examples/custom-output-paths/my-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,22 +123,22 @@ export type KeystoneAdminUISortDirection =
| 'DESC'

type ResolvedPostCreateInput = {
id?: import('./node_modules/.myprisma/client').Prisma.PostCreateInput['id']
title?: import('./node_modules/.myprisma/client').Prisma.PostCreateInput['title']
content?: import('./node_modules/.myprisma/client').Prisma.PostCreateInput['content']
publishDate?: import('./node_modules/.myprisma/client').Prisma.PostCreateInput['publishDate']
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated, but this is problematic in different situations, only included in this pull request to reduce conflicts

id?: import('./node_modules/myprisma').Prisma.PostCreateInput['id']
title?: import('./node_modules/myprisma').Prisma.PostCreateInput['title']
content?: import('./node_modules/myprisma').Prisma.PostCreateInput['content']
publishDate?: import('./node_modules/myprisma').Prisma.PostCreateInput['publishDate']
}
type ResolvedPostUpdateInput = {
id?: undefined
title?: import('./node_modules/.myprisma/client').Prisma.PostUpdateInput['title']
content?: import('./node_modules/.myprisma/client').Prisma.PostUpdateInput['content']
publishDate?: import('./node_modules/.myprisma/client').Prisma.PostUpdateInput['publishDate']
title?: import('./node_modules/myprisma').Prisma.PostUpdateInput['title']
content?: import('./node_modules/myprisma').Prisma.PostUpdateInput['content']
publishDate?: import('./node_modules/myprisma').Prisma.PostUpdateInput['publishDate']
}

export declare namespace Lists {
export type Post<Session = any> = import('@keystone-6/core').ListConfig<Lists.Post.TypeInfo<Session>>
namespace Post {
export type Item = import('./node_modules/.myprisma/client').Post
export type Item = import('./node_modules/myprisma').Post
export type TypeInfo<Session = any> = {
key: 'Post'
isSingleton: false
Expand Down Expand Up @@ -166,8 +166,8 @@ export type TypeInfo<Session = any> = {
lists: {
readonly Post: Lists.Post.TypeInfo<Session>
}
prisma: import('./node_modules/.myprisma/client').PrismaClient
prismaTypes: import('./node_modules/.myprisma/client').Prisma
prisma: import('./node_modules/myprisma').PrismaClient
prismaTypes: import('./node_modules/myprisma').Prisma
session: Session
}

Expand Down
Loading
Loading