graphql-hive / console

Hive Console is a GraphQL platform: schema registry, analytics and gateway for GraphQL federation and other GraphQL APIs
https://the-guild.dev/graphql/hive
MIT License
427 stars 101 forks source link

Operation Insights: Metadata Tags for operations #4931

Open erikwrede opened 5 months ago

erikwrede commented 5 months ago

It would be great if Hive reports were taggable and filterable by custom user-defined tags. Use cases for tags could include

Essentially, tags complement ClientInfo to provide additional metadata on the request. An operation could have one or multiple tags, resulting in the following changes to the Hive Reporting Spec:

export interface RequestOperation {
  timestamp: number
  operationMapKey: string
  execution: Execution
  metadata?: Metadata
}

export interface Metadata {
  client?: Client
+ tag?: string // OR
+ tags?: string[]
}

In the first iteration, the insights UI could be adjusted to have an additional filter like this:

image

If you agree on this feature being useful, there's several points to discuss:

Looking forward to your opinion on this.

Happy to draft an initial PR once we are aligned on the open points.

kamilkisiela commented 5 months ago

Makes sense, it shouldn't be an issue to maintain it and it's relatively easy to implement. Yeah, we could accept such PR.

and we're good to go

erikwrede commented 2 weeks ago

Small update, I still have this on my list and have started work. Some other things sadly got in between, but I'm still hoping to push this through soon!