Skip to content

feat(opentelemetry): add sampling rate #968

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

Merged
merged 6 commits into from
Apr 18, 2025
Merged

Conversation

EmrysMyrddin
Copy link
Collaborator

@EmrysMyrddin EmrysMyrddin commented Mar 27, 2025

Related to GW-91

@Copilot Copilot AI review requested due to automatic review settings March 27, 2025 23:25
@EmrysMyrddin EmrysMyrddin changed the base branch from main to v2 March 27, 2025 23:25
@EmrysMyrddin EmrysMyrddin changed the title feat(opentelemetry): correct span parenting + fix batching support feat(opentelemetry): add sampling rate Mar 27, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes span parenting issues and improves batching support for OpenTelemetry instrumentation across multiple packages and end-to-end tests. Key changes include:

  • Removing the setExecutionRequest callback in favor of directly mutating executionRequest.extensions.
  • Refactoring executor wrapping and instrumentation handling in the runtime.
  • Updating test expectations and configuration parameters for both OpenTelemetry and Cloudflare Workers integrations.

Reviewed Changes

Copilot reviewed 28 out of 34 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/plugins/hmac-upstream-signature/src/index.ts Removed setExecutionRequest usage and updated signature assignment logic.
packages/fusion-runtime/src/utils.ts Refactored executor wrapping and integrated instrumentation handling.
packages/fusion-runtime/src/unifiedGraphManager.ts Updated instrumentation payload type to include subgraphName.
e2e/opentelemetry/opentelemetry.e2e.ts Modified test expectations and adjusted timeout and error handling logic.
e2e/opentelemetry/gateway.config.ts Added diagnostic level and batching configuration for exporters.
e2e/cloudflare-workers/src/index.ts Changed runtime initialization to lazy caching for Cloudflare Workers.
e2e/cloudflare-workers/cloudflare-workers.e2e.ts Updated expectations and formatting of numeric literals in tests.
DEPS_RESOLUTIONS_NOTES.md, .changeset/* Various dependency updates and changelog documentation for breaking changes.
Files not reviewed (6)
  • .yarn/patches/@opentelemetry-exporter-trace-otlp-http-npm-0.200.0-80a44c64cd.patch: Language not supported
  • .yarn/patches/@opentelemetry-otlp-exporter-base-npm-0.200.0-6fb25211c7.patch: Language not supported
  • .yarn/patches/@opentelemetry-otlp-exporter-base-npm-0.56.0-ba3dc5f5c5.patch: Language not supported
  • .yarn/patches/@opentelemetry-resources-npm-1.29.0-112f89f0c5.patch: Language not supported
  • .yarn/patches/@opentelemetry-resources-npm-2.0.0-f20376a5f9.patch: Language not supported
  • package.json: Language not supported

): Promise<void> {
const url = `http://0.0.0.0:${jaeger.additionalPorts[16686]}/api/traces?service=${service}`;

let res!: JaegerTracesApiResponse;
let err: any;
const signal = AbortSignal.timeout(15_000);
const timeout = AbortSignal.timeout(15_00);
Copy link
Preview

Copilot AI Mar 27, 2025

Choose a reason for hiding this comment

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

The numeric literal '15_00' may be a typo: if a 15-second timeout was intended, it should likely be '15_000' to avoid unintended shorter timeouts.

Suggested change
const timeout = AbortSignal.timeout(15_00);
const timeout = AbortSignal.timeout(15_000);

Copilot uses AI. Check for mistakes.

@theguild-bot
Copy link
Collaborator

theguild-bot commented Mar 27, 2025

🚀 Snapshot Release (alpha)

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

Package Version Info
@graphql-mesh/fusion-runtime 0.11.11-alpha-e50027355a2e37471e153a27787d6392630d1724 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway 1.13.7-alpha-e50027355a2e37471e153a27787d6392630d1724 npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 1.0.11-alpha-e50027355a2e37471e153a27787d6392630d1724 npm ↗︎ unpkg ↗︎
@graphql-hive/plugin-aws-sigv4 1.0.8-alpha-e50027355a2e37471e153a27787d6392630d1724 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-jwt-auth 1.5.4-alpha-e50027355a2e37471e153a27787d6392630d1724 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-opentelemetry 2.0.0-alpha-e50027355a2e37471e153a27787d6392630d1724 npm ↗︎ unpkg ↗︎
@graphql-mesh/plugin-prometheus 1.3.43-alpha-e50027355a2e37471e153a27787d6392630d1724 npm ↗︎ unpkg ↗︎
@graphql-hive/gateway-runtime 1.8.1-alpha-e50027355a2e37471e153a27787d6392630d1724 npm ↗︎ unpkg ↗︎

@theguild-bot
Copy link
Collaborator

theguild-bot commented Mar 27, 2025

🚀 Snapshot Release (Binary for Linux-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Mar 27, 2025

🚀 Snapshot Release (Binary for macOS-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Mar 27, 2025

🚀 Snapshot Release (Binary for Linux-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Mar 27, 2025

🚀 Snapshot Release (Node Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:1.13.7-alpha-e50027355a2e37471e153a27787d6392630d1724

@theguild-bot
Copy link
Collaborator

theguild-bot commented Mar 27, 2025

🚀 Snapshot Release (Bun Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:1.13.7-alpha-e50027355a2e37471e153a27787d6392630d1724-bun

@theguild-bot
Copy link
Collaborator

theguild-bot commented Mar 27, 2025

🚀 Snapshot Release (Binary for macOS-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Mar 27, 2025

🚀 Snapshot Release (Binary for Windows-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@enisdenjo enisdenjo force-pushed the v2 branch 3 times, most recently from 5879f2b to 0bc8a1c Compare April 17, 2025 17:50
@EmrysMyrddin EmrysMyrddin force-pushed the feat/otel/sampling-strategy branch from 4c57231 to e500273 Compare April 18, 2025 18:12
@EmrysMyrddin EmrysMyrddin merged commit 1a58317 into v2 Apr 18, 2025
61 checks passed
@EmrysMyrddin EmrysMyrddin deleted the feat/otel/sampling-strategy branch April 18, 2025 18:47
enisdenjo pushed a commit that referenced this pull request Apr 21, 2025
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
enisdenjo pushed a commit that referenced this pull request May 12, 2025
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
enisdenjo pushed a commit that referenced this pull request May 20, 2025
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
enisdenjo pushed a commit that referenced this pull request May 22, 2025
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
enisdenjo pushed a commit that referenced this pull request Jun 5, 2025
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

4 participants