-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
klogs-plugin
: add links integration
#444
base: main
Are you sure you want to change the base?
Conversation
@@ -10,9 +10,28 @@ import ( | |||
"go.uber.org/zap" | |||
) | |||
|
|||
func (i *instance) enrichAutolinks(fields []Field) []Field { | |||
autolinkIntegrations := make([]IntegrationAutolinks, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't expect this slice to become huge, same with i.integrations
. If desired we can filter the autolinkIntegrations
slice outside of this method (which is invoked on every request). Furthermore I could make it a map[string]IntegrationAutolinks
with the columnName
as key. This would further reduce the overhead in L22-L26.
return; | ||
} | ||
|
||
path = path.replaceAll('<<value>>', value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also use a pattern here instead. For example:
# autolink.path = /goto?foo=$1
# autolink.match = bar-(.*)
value = bar-1234
# resolves to
path = /goto?foo=1234
Codecov Report
@@ Coverage Diff @@
## main #444 +/- ##
==========================================
- Coverage 43.77% 43.76% -0.02%
==========================================
Files 143 143
Lines 12396 12424 +28
==========================================
+ Hits 5426 5437 +11
- Misses 6829 6846 +17
Partials 141 141
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This PR solves the issue #255 for the klogs plugin. It allows users to specify a column name and a path to direct users to a different plugin inside kobs or any other place (grafana, jaeger, etc.). It's possible to:
<<value>>
(this is replaced with the actual document value for the specific column) and/ortimeStart
andtimeEnd
(with<<timeStart>>
and<<timeEnd>>
). This can be useful to create a query for a different platform that benefits from limited time-ranges (e.g jaeger or grafana).