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

Request for Custom SpanStatus Constuctor #1548

Closed
ostk0069 opened this issue Jul 13, 2023 · 4 comments
Closed

Request for Custom SpanStatus Constuctor #1548

ostk0069 opened this issue Jul 13, 2023 · 4 comments

Comments

@ostk0069
Copy link

Problem Statement

by looking at https://github.com/getsentry/sentry-dart/blob/main/dart/lib/src/protocol/span_status.dart ,
SpanStatus only support custom SpanStatus with SpanStatus.fromString().
Our project has original HttpStatus to handle.
Is there any problem to create constructor for both value and httpStatusCode.

Solution Brainstorm

add constructor for SpanStatus with

/// Creates SpanStatus from both String and httpStatusCode.
  factory SpanStatus.custom(String value, int httpStatusCode) => SpanStatus._(value, httpStatusCode);

Are you willing to submit a PR?

Yes

@ostk0069
Copy link
Author

ostk0069 commented Jul 13, 2023

I would like to create a PR, if there is no problem with it
So, please let me know.

@krystofwoldrich
Copy link
Member

Hi,
thank you for the message,
what you are suggesting looks to me like SpanStatus.fromHttpStatusCode(statusCode)? Or did I misunderstand?

factory SpanStatus.fromHttpStatusCode(

@ostk0069
Copy link
Author

ostk0069 commented Jul 13, 2023

what you are suggesting looks to me like SpanStatus.fromHttpStatusCode(statusCode)? Or did I misunderstand?

our project has original http status which is not included in https://github.com/getsentry/sentry-dart/blob/main/dart/lib/src/protocol/span_status.dart 😢

@marandaneto
Copy link
Contributor

@ostk0069 the Sentry's span status is a sentry protocol, it does not map 1:1 to the HTTP spec.
https://develop.sentry.dev/sdk/event-payloads/span/
We will eventually simplify this: getsentry/develop#383 but we are not there yet.
So you may use the one that is close enough and has the same meaning for now.

@github-project-automation github-project-automation bot moved this from Needs More Information to Done in Mobile & Cross Platform SDK Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

No branches or pull requests

3 participants