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

Support Metadata Plugins #154

Closed

Conversation

matt-hobbs-prima
Copy link
Contributor

This PR introduces a plugin mechanism to allow integrators to specify / create their our metadata.

The plugins are passed as a setup option (metadata_plugins) and get a callback with the Absinthe.Blueprint to extract any information they need

@matt-hobbs-prima matt-hobbs-prima changed the title [COAPL-946]: Expose user-agent of GraphQL operations in DD Support Metadata Plugins May 23, 2024
@matt-hobbs-prima matt-hobbs-prima self-assigned this May 23, 2024
@matt-hobbs-prima matt-hobbs-prima marked this pull request as ready for review May 23, 2024 15:06
@matt-hobbs-prima matt-hobbs-prima requested a review from a team as a code owner May 23, 2024 15:06
@matt-hobbs-prima matt-hobbs-prima requested a review from a team May 23, 2024 15:06
Copy link
Member

@MaeIsBad MaeIsBad left a comment

Choose a reason for hiding this comment

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

No notes about the code, but

  • can you update the changelog?
  • what's the use case? What extra annotations would you want to add?

How about an alternative implementation where clients can attach metadata to the absinthe context instead of having this plugin system?

@matt-hobbs-prima
Copy link
Contributor Author

matt-hobbs-prima commented May 24, 2024

No notes about the code, but

  • can you update the changelog?
    > Yep, sorry missed it.
  • what's the use case? What extra annotations would you want to add?
    > The use case for is that we want to know who's making GraphQL queries to Peano, alongside the metrics that are already gathered. (Trying to give it some love :) ) Some of the queries are anonymous so we want to add 'user-agent' as metadata. That concept doesn't exist in Absinthe so we have take the approach to add it to the context and then have a plugin that takes it from the context and adds it as metadata. Here is an implementation of how it would work.

How about an alternative implementation where clients can attach metadata to the absinthe context instead of having this plugin system?
 > That's an interesting (and simpler!) idea, let me experiment with it.

Thanks for the feedback

Copy link
Contributor

@Johnabell Johnabell left a comment

Choose a reason for hiding this comment

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

👍 Nice work would be good to update the changes log

@matt-hobbs-prima
Copy link
Contributor Author

Closing this one in favour of:
#155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants