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

📈 pass through runTelemetry option from landing page configs to embeds #7504

Conversation

mayakoneval
Copy link
Contributor

@mayakoneval mayakoneval commented Apr 12, 2023

Hi! We had a user request the ability to turn off telemetry, lets allow that.

We support this in the embed in this merged PR and in studio in this merged PR

Fixes #7494

@netlify
Copy link

netlify bot commented Apr 12, 2023

Deploy Preview for apollo-server-docs ready!

Name Link
🔨 Latest commit 1a57505
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/643d8ef8754ffd000851187e
😎 Deploy Preview https://deploy-preview-7504--apollo-server-docs.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 12, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1a57505:

Sandbox Source
Apollo Server Typescript Configuration
Apollo Server Configuration

@mayakoneval mayakoneval force-pushed the maya/NBLA-2242/runTelemetry-in-landing-pages branch from a153580 to 1711044 Compare April 12, 2023 20:34
Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

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

Will you please add the new config option to the API docs?

packages/server/src/plugin/landingPage/default/types.ts Outdated Show resolved Hide resolved
packages/server/src/plugin/landingPage/default/types.ts Outdated Show resolved Hide resolved
'@apollo/server': minor
---

Add runTelemetry boolean option to embedded landing pages
Copy link
Member

Choose a reason for hiding this comment

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

Will you please provide a brief explanation of what this config option does (and maybe the telemetry we collect)?
A little code snippet to show how to configure the plugin with this option would be great too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I wasn't sure if we wanted to make this super public, but I don't see why we wouldn't. I'll update with the docs and this! 🙏🏻

mayakoneval and others added 5 commits April 17, 2023 11:09
Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
….com:mayakoneval/apollo-server into maya/NBLA-2242/runTelemetry-in-landing-pages
Comment on lines +11 to +29
```
const server = new ApolloServer({
typeDefs,
resolvers,
plugins: [
process.env.NODE_ENV === 'production'
? ApolloServerPluginLandingPageProductionDefault({
graphRef: 'my-graph-id@my-graph-variant',
embed: {
runTelemetry: false
},
})
: ApolloServerPluginLandingPageLocalDefault({
embed: {
runTelemetry: false
},
}),
],
});
Copy link
Member

Choose a reason for hiding this comment

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

Not sure how to suggest or correctly escape a ``` but this needs one to close.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏻 done

Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

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

LGTM, I just need to get the docs build failures sorted (it's not you)

@trevor-scheer trevor-scheer merged commit 22a5be9 into apollographql:main Apr 17, 2023
17 checks passed
@github-actions github-actions bot mentioned this pull request Apr 17, 2023
trevor-scheer added a commit that referenced this pull request Apr 17, 2023
In the Apollo Server Landing Page Local config, you can now opt out of the telemetry
that Apollo Studio runs in the embedded Sandbox & Explorer landing pages. This
telemetry includes Google Analytics for event tracking and Sentry for error tracking.

Fixes #7494

---------

Co-authored-by: Trevor Scheer <trevor.scheer@gmail.com>
trevor-scheer pushed a commit that referenced this pull request Apr 20, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @apollo/server@4.7.0

### Minor Changes

- [#7504](#7504)
[`22a5be934`](22a5be9)
Thanks [@mayakoneval](https://github.com/mayakoneval)! - In the Apollo
Server Landing Page Local config, you can now opt out of the telemetry
that Apollo Studio runs in the
embedded Sandbox & Explorer landing pages. This telemetry includes
Google Analytics for event tracking and
    Sentry for error tracking.

    Example of the new config option:

        const server = new ApolloServer({
          typeDefs,
          resolvers,
          plugins: [
            process.env.NODE_ENV === 'production'
              ? ApolloServerPluginLandingPageProductionDefault({
                  graphRef: 'my-graph-id@my-graph-variant',
                  embed: {
                    runTelemetry: false
                  },
                })
              : ApolloServerPluginLandingPageLocalDefault({
                  embed: {
                    runTelemetry: false
                  },
                }),
          ],
        });

## @apollo/server-integration-testsuite@4.7.0

### Patch Changes

- [#7509](#7509)
[`5c20aa02e`](5c20aa0)
Thanks [@renovate](https://github.com/apps/renovate)! - Update
`graphql-http` dependency

- [#7475](#7475)
[`b9ac2d6b2`](b9ac2d6)
Thanks [@renovate](https://github.com/apps/renovate)! - Update
graphql-http dependency

- Updated dependencies
\[[`22a5be934`](22a5be9)]:
    -   @apollo/server@4.7.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow disabling telemetry for Apollo Studio
2 participants