Skip to content

Commit

Permalink
fix(tracing): func to parse phase and plugin from span name
Browse files Browse the repository at this point in the history
  • Loading branch information
sumimakito committed Dec 11, 2024
1 parent d611999 commit 6e06210
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/tracing/src/utils/spans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const buildSpanTrees = (spans: Span[]): SpanNode[] => {
* @returns the parsed phase and plugin or undefined if the span is not a plugin span
*/
export const getPhaseAndPlugin = (spanName: string): [phase: string, plugin: string] | undefined => {
const matches = /^kong\.(rewrite|access|response|header_filter|body_filter)\.plugin\.(.+?)(?:$|\..*)/gi.exec(spanName)
const matches = /^kong\.([^.]+)\.plugin\.(.+?)(?:$|\..*)/gi.exec(spanName)
if (!matches) {
return undefined
}
Expand Down

0 comments on commit 6e06210

Please sign in to comment.