Skip to content

Conversation

@tonybaroneee
Copy link

  • Consolidate the two classes which implement LogRecordExporter into one.

@tonybaroneee tonybaroneee requested a review from a team as a code owner November 19, 2025 20:58
@changeset-bot
Copy link

changeset-bot bot commented Nov 19, 2025

⚠️ No Changeset found

Latest commit: 52a24d2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist
Copy link

Summary of Changes

Hello @tonybaroneee, 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 streamlines the logging architecture within the telemetry package by consolidating log exporter responsibilities. The primary goal is to reduce complexity and improve maintainability by merging the functionality of two distinct LogRecordExporter implementations into a single, more capable OTLPLogExporter. This change simplifies the log processing pipeline, making it more efficient and easier to understand.

Highlights

  • Consolidation of Log Exporters: The AsyncAttributeLogExporter class has been removed, and its functionality for resolving and appending dynamic attributes to log records has been integrated directly into the OTLPLogExporter.
  • Simplified Logger Provider Creation: The createLoggerProvider function now directly uses the OTLPLogExporter within the BatchLogRecordProcessor, removing the need for an intermediate AsyncAttributeLogExporter.
  • Enhanced OTLPLogExporter: The OTLPLogExporter now directly accepts dynamicLogAttributeProviders in its constructor and overrides the export method to handle asynchronous attribute resolution before delegating to the base exporter.
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.

Copy link

@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 simplifies the logger-provider by consolidating two classes that implement LogRecordExporter into one. This is a great refactoring that improves code clarity and maintainability. I have one suggestion to optimize the performance of how dynamic log attributes are applied.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 19, 2025

Size Report 1

Affected Products

  • @firebase/telemetry

    TypeBase (25ebd49)Merge (d9c8400)Diff
    browser8.66 kB8.61 kB-56 B (-0.6%)
    main8.04 kB7.99 kB-56 B (-0.7%)
    module8.66 kB8.61 kB-56 B (-0.6%)
  • firebase

    TypeBase (25ebd49)Merge (d9c8400)Diff
    firebase-telemetry.js88.2 kB88.1 kB-87 B (-0.1%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/c7Mf0fFxIP.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Nov 19, 2025

Size Analysis Report 1

Affected Products

  • @firebase/telemetry

    • captureError

      Size

      TypeBase (25ebd49)Merge (d9c8400)Diff
      size5.20 kB5.17 kB-34 B (-0.7%)
      size-with-ext-deps64.6 kB64.5 kB-36 B (-0.1%)

      Dependency

      TypeBase (25ebd49)Merge (d9c8400)Diff
      classes

      AppCheckProvider
      AsyncAttributeLogExporter
      FetchTransport
      InstallationIdProvider
      OTLPLogExporter
      TelemetryService

      AppCheckProvider
      FetchTransport
      InstallationIdProvider
      OTLPLogExporter
      TelemetryService

      - AsyncAttributeLogExporter

    • flush

      Size

      TypeBase (25ebd49)Merge (d9c8400)Diff
      size4.31 kB4.28 kB-34 B (-0.8%)
      size-with-ext-deps63.0 kB63.0 kB-36 B (-0.1%)

      Dependency

      TypeBase (25ebd49)Merge (d9c8400)Diff
      classes

      AppCheckProvider
      AsyncAttributeLogExporter
      FetchTransport
      InstallationIdProvider
      OTLPLogExporter
      TelemetryService

      AppCheckProvider
      FetchTransport
      InstallationIdProvider
      OTLPLogExporter
      TelemetryService

      - AsyncAttributeLogExporter

    • getTelemetry

      Size

      TypeBase (25ebd49)Merge (d9c8400)Diff
      size4.35 kB4.31 kB-34 B (-0.8%)
      size-with-ext-deps70.0 kB70.0 kB-36 B (-0.1%)

      Dependency

      TypeBase (25ebd49)Merge (d9c8400)Diff
      classes

      AppCheckProvider
      AsyncAttributeLogExporter
      FetchTransport
      InstallationIdProvider
      OTLPLogExporter
      TelemetryService

      AppCheckProvider
      FetchTransport
      InstallationIdProvider
      OTLPLogExporter
      TelemetryService

      - AsyncAttributeLogExporter

    • nextOnRequestError

      Size

      TypeBase (25ebd49)Merge (d9c8400)Diff
      size5.57 kB5.54 kB-34 B (-0.6%)
      size-with-ext-deps71.9 kB71.9 kB-36 B (-0.1%)

      Dependency

      TypeBase (25ebd49)Merge (d9c8400)Diff
      classes

      AppCheckProvider
      AsyncAttributeLogExporter
      FetchTransport
      InstallationIdProvider
      OTLPLogExporter
      TelemetryService

      AppCheckProvider
      FetchTransport
      InstallationIdProvider
      OTLPLogExporter
      TelemetryService

      - AsyncAttributeLogExporter

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/emEzBHKzBs.html

@tonybaroneee tonybaroneee merged commit af4779c into telemetry Nov 19, 2025
47 of 48 checks passed
@tonybaroneee tonybaroneee deleted the telemetry-refactor branch November 19, 2025 23:09
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