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

[feature request] openinference-vercel should respect attributes that have been set already #1145

Open
mshick opened this issue Dec 3, 2024 · 1 comment
Labels
enhancement New feature or request instrumentation Adding instrumentations to open source packages language: js Related to JavaScript or Typescript integration triage Issues that require triage

Comments

@mshick
Copy link

mshick commented Dec 3, 2024

Is your feature request related to a problem? Please describe.
The openinference-vercel span processor overwrites any attributes that it gets values for. Ideally it would respect already-set values, particularly since the span attributes property is marked as readonly.

The logic here is responsible.

In my fork, I do the following, and it seems to work well:

  const attributes = safelyGetOpenInferenceAttributes({...span.attributes});

  if (attributes) {
    // Append-only, since the attributes are readonly
    for (const [name, value] of Object.entries(attributes)) {
      // Do not overwrite explicitly set values
      if (span.attributes[name] == null) {
        span.attributes[name] = value;
      }
    }
  }
@mshick mshick added enhancement New feature or request triage Issues that require triage labels Dec 3, 2024
@github-project-automation github-project-automation bot moved this to 📘 Todo in phoenix Dec 3, 2024
@dosubot dosubot bot added the language: js Related to JavaScript or Typescript integration label Dec 3, 2024
@mikeldking
Copy link
Contributor

Hey @mshick - thanks for the feedback. Still mulling this over since we had not thought about users wanting to override values - I guess more curious about which values you are feeling you need to override (e.g. you feel are inalid)?

@mikeldking mikeldking removed this from phoenix Dec 17, 2024
@mikeldking mikeldking added the instrumentation Adding instrumentations to open source packages label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request instrumentation Adding instrumentations to open source packages language: js Related to JavaScript or Typescript integration triage Issues that require triage
Projects
Status: No status
Development

No branches or pull requests

2 participants