Skip to content

docs(router): metrics#7696

Open
kamilkisiela wants to merge 14 commits intomainfrom
kamil-router-metrics
Open

docs(router): metrics#7696
kamilkisiela wants to merge 14 commits intomainfrom
kamil-router-metrics

Conversation

@kamilkisiela
Copy link
Contributor

@kamilkisiela kamilkisiela commented Feb 13, 2026

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @kamilkisiela, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the documentation for OpenTelemetry metrics in the Hive Router by introducing dedicated UI components for presenting metric and label information clearly. It provides users with a comprehensive guide on how to configure, export, and interpret the various metrics available, improving observability and troubleshooting capabilities for router operations.

Highlights

  • New UI Components for Metrics Documentation: Introduced LabelCard, MetricCard, and MetricsSection React components to provide a structured and interactive way to display OpenTelemetry metrics and their associated labels within the documentation.
  • Comprehensive OpenTelemetry Metrics Documentation: Added a new documentation page (metrics.mdx) detailing the OpenTelemetry metrics exposed by the Hive Router, covering configuration for OTLP and Prometheus, instrumentation customization, and a detailed reference for various metric categories.
  • Detailed Metric and Label References: The new documentation includes extensive references for GraphQL, Supergraph, HTTP server, HTTP client, and Cache metrics, along with explanations of their labels, typical values, and monitoring recommendations for production environments.
Changelog
  • packages/web/docs/src/components/otel-metrics/label-card.tsx
    • Added a new React component to display individual metric labels with their meaning, typical values, and notes.
  • packages/web/docs/src/components/otel-metrics/metric-card.tsx
    • Added a new React component to display individual metrics, including their name, type, unit, description, and associated labels, with a copy-to-link feature.
  • packages/web/docs/src/components/otel-metrics/metrics-section.tsx
    • Added a new React component to group and render multiple MetricCard and LabelCard components, providing an expandable section for labels.
  • packages/web/docs/src/content/router/observability/metrics.mdx
    • Added a new documentation page detailing OpenTelemetry metrics for the Hive Router, covering configuration, instrumentation, and a comprehensive reference of GraphQL, Supergraph, HTTP server, HTTP client, and Cache metrics.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/cli 0.58.1-alpha-20260216151046-a7dc6de7cd0da593a8b7038d6ad153b0e21220a6 npm ↗︎ unpkg ↗︎
hive 9.4.1-alpha-20260216151046-a7dc6de7cd0da593a8b7038d6ad153b0e21220a6 npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/amd64

Image Tag: a7dc6de7cd0da593a8b7038d6ad153b0e21220a6

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces comprehensive documentation for OpenTelemetry metrics, complete with new React components for a structured and interactive presentation. The implementation is solid, and the new documentation page is well-organized. I have a few suggestions to enhance semantic correctness, accessibility, and component reusability, primarily concerning the use of an <a> tag for a copy-link action and refactoring the MetricsSection component for better flexibility.

Comment on lines +96 to +113
<button
type="button"
onClick={() => {
void copyMetricLink();
}}
className={`hive-focus inline-flex items-center justify-center rounded font-mono text-sm font-semibold leading-none transition-all duration-200 ${isCopied ? 'translate-y-0 text-gray-500 opacity-100 dark:text-slate-500' : 'translate-y-0 text-gray-500 opacity-0 hover:text-gray-700 focus:text-gray-700 group-focus-within:opacity-100 group-hover:opacity-100 dark:text-slate-500 dark:hover:text-slate-200 dark:focus:text-slate-200'}`}
aria-label={`Copy link to ${name}`}
title="Copy metric link"
>
{isCopied ? (
<>
<span>✓</span>
<span className="ml-1 text-xs">copied</span>
</>
) : (
'#'
)}
</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For semantic correctness and better accessibility, consider changing this <button> to an <a> tag. The button's content is # and its fallback behavior involves navigation, which are characteristics of a link. Using an <a> tag aligns the element's semantics with its behavior and appearance, adhering to web standards and improving user experience, especially for users of assistive technologies.

              <a
                href={`#${metricId}`}
                onClick={e => {
                  e.preventDefault();
                  void copyMetricLink();
                }}
                className={`hive-focus inline-flex items-center justify-center rounded font-mono text-sm font-semibold leading-none transition-all duration-200 ${isCopied ? 'translate-y-0 text-gray-500 opacity-100 dark:text-slate-500' : 'translate-y-0 text-gray-500 opacity-0 hover:text-gray-700 focus:text-gray-700 group-focus-within:opacity-100 group-hover:opacity-100 dark:text-slate-500 dark:hover:text-slate-200 dark:focus:text-slate-200'}`}
                aria-label={`Copy link to ${name}`}
                title="Copy metric link"
              >
                {isCopied ? (
                  <>
                    <span>✓</span>
                    <span className="ml-1 text-xs">copied</span>
                  </>
                ) : (
                  '#'
                )}
              </a>
References
  1. For navigation, use an <a> tag (e.g., via a router's Link component) instead of a <button> element to ensure semantic correctness and accessibility.

Comment on lines +24 to +25
title?: string;
description?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The props title and description are defined in MetricsSectionProps but are not used within the MetricsSection component. They should be removed to keep the component's API clean and avoid confusion for future developers.

Comment on lines +36 to +45
<div className="space-y-4">
<h4 className="mt-8 text-xl font-semibold tracking-tight text-slate-900 dark:text-slate-100">
Metrics
</h4>
<div className="grid gap-4">
{metrics.map(metric => (
<MetricCard key={metric.name} {...metric} />
))}
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The component includes a hardcoded <h4>Metrics</h4> heading. This can lead to incorrect heading hierarchies when used within metrics.mdx (e.g., an h4 as a direct child of another h4) and reduces the component's flexibility. It's better to remove this heading and let the consumer of the component (the MDX file) control the document structure and headings.

        <div className="grid gap-4">
          {metrics.map(metric => (
            <MetricCard key={metric.name} {...metric} />
          ))}
        </div>

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

💻 Website Preview

The latest changes are available as preview in: https://pr-7696.hive-landing-page.pages.dev

@kamilkisiela kamilkisiela added the waiting-on:router-release Do not merge: waiting for Router release that includes this feature. label Feb 17, 2026
@kamilkisiela kamilkisiela marked this pull request as ready for review February 17, 2026 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-on:router-release Do not merge: waiting for Router release that includes this feature.

Development

Successfully merging this pull request may close these issues.

1 participant