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

docs(js): nextjs-13 example #489

Merged
merged 10 commits into from
May 22, 2024
Merged

docs(js): nextjs-13 example #489

merged 10 commits into from
May 22, 2024

Conversation

mikeldking
Copy link
Contributor

@mikeldking mikeldking commented May 22, 2024

resolves #452

Note that I am only able to make this work using Nextjs 13. Otel doesn't seem to "stick" with nextjs 14 as the compilation of the server code strips the instrumentation (patches are removed).

Screenshot 2024-05-21 at 7 59 10 PM

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 22, 2024
@mikeldking mikeldking changed the title docs(js): nextjs-13-example docs(js): nextjs-13 example May 22, 2024

## Learn More

To learn more about Arize Phoenix, take a look at the following resources:
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing the follow-up list.

Copy link
Contributor

Choose a reason for hiding this comment

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

addressed in c9d0c2f


const provider = new NodeTracerProvider({
resource: new Resource({
["openinference.project.name"]: "nextjs-chat",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Use our semantic convention constant here rather than hard-coding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's not in the conventions right now. #494

span.setAttributes({
[SemanticConventions.OPENINFERENCE_SPAN_KIND]:
OpenInferenceSpanKind.CHAIN,
[INPUT_VALUE]: question,
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing mime types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's text

});
const answer: string = chatCompletion.choices[0].message.content || "";
span.setAttributes({
[OUTPUT_VALUE]: answer,
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing mime types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

leaving it off for simplicity. The default mimetype is text so leaving it.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 22, 2024
@mikeldking mikeldking merged commit 655cf56 into main May 22, 2024
3 checks passed
@mikeldking mikeldking deleted the nextjs-example branch May 22, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature request] NextJS Full-stack example
2 participants