-
Notifications
You must be signed in to change notification settings - Fork 9
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
Self-hosted usage reporting not working #310
Comments
That line works when you pass the token through CLI arguments, but it seems you pass it using the configuration file
Usage reporting is included. Could you help us reproducing the issue? |
@ardatan Not immediately confident I can easily create a reproduction but I'll review what you put together and see if that gleans any more information In the interim, just to clarify as it seems I may have caused confusion, I'm not having any issues passing the token, it's about specifying a usage endpoint that isn't the default The link to the code I was referencing was me wondering if the
With this change, it started working and sending usage reports to our hosted instance |
That part of code handles the token given in the CLI arguments not from the config as in your example. |
@ardatan I wasn't, no. I did a quick test including the token as a CLI argument, but that doesn't seem to influence the endpoint it tries to send usage to If it's useful, my setup is very bare bones: Dockerfile
gateway.config.ts
Values enclosed in <> omitted Expected: |
if (hiveRegistryToken) {
ctx.log.info(`Configuring Hive registry reporting`);
registryConfig = {
reporting: {
type: 'hive',
token: hiveRegistryToken,
...loadedConfig.reporting // <----- added this line
},
};
} I reproduced your issue when I passed the token as a CLI argument which that code part only runs in this case, otherwise that code never runs. I couldn't reproduce the issue when all parameters are given in the configuration file. Maybe I am missing something but could you try with the alphas here? |
@ardatan Shit, sorry, I missed a crucial piece of detail which is I'm passing I also tested your alpha build |
When running the gateway using
supergraph
, adding configuration to support usage reporting to a self hosted instance, Hive is still trying to use the cloud endpoint.Given a config something like:
The gateway doesn't use the
reporting.selfHosting
options and defaults to targetinghttps://app.graphql-hive.com/graphql
:From what I can tell,
reporting
configuration is never passed and instead a basic reporting object is constructed only consisting oftype
andtoken
: https://github.com/graphql-hive/gateway/blob/main/packages/gateway/src/commands/supergraph.ts#L157-L164I notice in the documentation it mentions not all functionality is available in the self-hosted version, including
usage-estimation
, but it's not clear to me if that includes usage reporting in general. Should this configuration work for the self hosting?The text was updated successfully, but these errors were encountered: