-
Notifications
You must be signed in to change notification settings - Fork 73
Conversation
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.
LGTM! Left a comment in case you also run into this issue in fire
, if not disregard it 😄
}, [] as Label[]); | ||
|
||
// Check if we are editing a label value right now. If so also get name of the label | ||
const matchLabelValue = text.substring(0, offset).match(/(\w+)=("?)[^"]*$/); |
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.
This regex won't match labels that include dots .
. Not sure if it's possible for them to have dots in fire
but I ran into this issue for tempo
.
For example http.status_code
only matched status_code
with this regex and it results in the autocomplete value being empty.
Same issue in line 179.
A quick fix is to replace (\w+)
at the start with ([\w.]+)
.
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.
hmm @cyriltovena can there be dots in the label names?
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.
https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels names no ! but value yes possibly.
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.
Thanks. Yeah going to change the regex according to prom spec
Datasource: Query editor autocomplete
Simple autocomplete for the query editor:
Future considerations: