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

Disables run tracer with PREFECT_CLOUD_ENABLE_ORCHESTRATION_TELEMETRY #17417

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jeanluciano
Copy link
Contributor

@jeanluciano jeanluciano commented Mar 7, 2025

Disables the creation of spans when PREFECT_CLOUD_ENABLE_ORCHESTRATION_TELEMETRY is on. This fixes issue with users importing our run telemetry with their own OTEL setup.
closes #17190

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • If this pull request adds new functionality, it includes unit tests that cover the changes
  • If this pull request removes docs files, it includes redirect settings in mint.json.
  • If this pull request adds functions or classes, it includes helpful docstrings.
    __

Copy link

codspeed-hq bot commented Mar 7, 2025

CodSpeed Performance Report

Merging #17417 will not alter performance

Comparing jean/eng-1533-allow-user-to-disable-prefects-automatic-opentelemetry (dd37cbf) with main (e574d28)

Summary

✅ 2 untouched benchmarks

@jeanluciano jeanluciano marked this pull request as ready for review March 7, 2025 18:34
@github-actions github-actions bot added the bug Something isn't working label Mar 7, 2025
…opentelemetry' of https://github.com/PrefectHQ/prefect into jean/eng-1533-allow-user-to-disable-prefects-automatic-opentelemetry
Copy link
Collaborator

@zzstoatzz zzstoatzz left a comment

Choose a reason for hiding this comment

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

lgtm! one small request to use T | None instead of Optional[T] since we already have from __future__ import annotations here

Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

LGTM! I left a couple of suggestions based on @zzstoatzz's comment


async def async_start_span(
self,
run: FlowOrTaskRun,
client: PrefectClient,
parameters: dict[str, Any] | None = None,
) -> Span:
) -> Optional[Span]:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
) -> Optional[Span]:
) -> Span | None:

@@ -73,7 +78,10 @@ def start_span(
run: FlowOrTaskRun,
client: SyncPrefectClient,
parameters: dict[str, Any] | None = None,
) -> Span:
) -> Optional[Span]:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
) -> Optional[Span]:
) -> Span | None:

@@ -2,7 +2,7 @@

import time
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, Union
from typing import TYPE_CHECKING, Any, Optional, Union
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
from typing import TYPE_CHECKING, Any, Optional, Union
from typing import TYPE_CHECKING, Any, Union

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow user to disable Prefect’s Automatic OpenTelemetry flow/task Span generation
3 participants