Add option to format span name with context by vearutop · Pull Request #29 · opencensus-integrations/ocsql · GitHub
Skip to content

Add option to format span name with context - #29

Open
vearutop wants to merge 1 commit into
opencensus-integrations:masterfrom
vearutop:ctx-span-name
Open

Add option to format span name with context#29
vearutop wants to merge 1 commit into
opencensus-integrations:masterfrom
vearutop:ctx-span-name

Conversation

@vearutop

Copy link
Copy Markdown
Contributor

This PR adds option to format span name with func(ctx context.Context, baseName string) string.

That can be handy to make spans more relevant to application flow and enable precise tracing.
Somewhat similar approach is used in ochttp.Handler:

    // FormatSpanName holds the function to use for generating the span name
    // from the information found in the incoming HTTP Request. By default the
    // name equals the URL Path.
    FormatSpanName func(*http.Request) string

@basvanbeek

Copy link
Copy Markdown
Member

@vearutop

Copy link
Copy Markdown
Contributor Author

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.

2 participants