Repository: getsentry/sentry-go

Issue:
Add WithDescription SpanOption
<!--

Note that the Sentry team has finite resources and priorities that are not
always visible on GitHub. If your issue doesn't align with our priorities it's
unlikely it will be worked on. As time permits and depending on the request,
we'll follow up and discuss the proposed feature in more detail.

-->

## Summary
<!-- A clear and concise description of what you want to happen. -->
Pretty simple. For Spans, the current process of creating them is:
```
span := sentry.StartSpan(ctx, "function")
span.Description = "doWork"
defer span.Finish()
```
This requires multiple lines each time. If there was a `WithDescription` SpanOption, this then becomes:
```
defer sentry.StartSpan(ctx, "function", WithDescription("doWork").Finish()
```

making calls to sentry a less distracting one-liner at the top of a function. 

## Motivation
<!--
A clear and concise description of what problem or use case this feature addresses.
A good motivation will include arguments supporting why should this be worked on.
-->
The current way to create spans can be made more concise. The more involved change is allowing description to be added in another `StartSpan` function signature, i.e. `StartSpan(ctx, "function", "doWork")`, but that would require more testing to get out. The least intrusive way to accomplish the same thing is adding a SpanOption instead. This doesn't existing uses and is the way we accomplish this now. Would love for this to come from the standard library instead of our `helpers` package.

## Additional Context
<!--
Add any other information that you consider relevant here.
Code snippets can be a good way to explain what the feature is about.
-->


Discussion:
@github-actions: This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it `Status: Backlog` or `Status: In Progress`, I will leave it alone ... forever!

----

"A weed is but an unloved flower." ― _Ella Wheeler Wilcox_ 🥀@greywolve: Seems reasonable @moneymikeMD . :) 

Solution patch:
diff --git a/tracing.go b/tracing.go
index 793bd28..8122a98 100644
--- a/tracing.go
+++ b/tracing.go
@@ -834,6 +834,13 @@ func WithTransactionName(name string) SpanOption {
 	}
 }
 
+// WithDescription sets the description of a span.
+func WithDescription(description string) SpanOption {
+	return func(s *Span) {
+		s.Description = description
+	}
+}
+
 // WithOpName sets the operation name for a given span.
 func WithOpName(name string) SpanOption {
 	return func(s *Span) {



Test patch:
diff --git a/tracing_test.go b/tracing_test.go
index 874f721..2ca01c7 100644
--- a/tracing_test.go
+++ b/tracing_test.go
@@ -340,6 +340,16 @@ func TestSetData(t *testing.T) {
 	}
 }
 
+func TestWithDescription(t *testing.T) {
+	ctx := NewTestContext(ClientOptions{
+		EnableTracing: true,
+	})
+	span := StartSpan(ctx, "Test Span", WithDescription("span desc"))
+	if span.Description != "span desc" {
+		t.Fatalf("Description mismatch, got %v", span.Description)
+	}
+}
+
 func TestIsTransaction(t *testing.T) {
 	ctx := NewTestContext(ClientOptions{
 		EnableTracing: true,